Monday, April 25, 2011

Codes !!

The codes used!!

ActionScript 2.0


fscommand("fullscreen", "true");
//----------Mouse-Cursor-------\\
var myMusic:Sound = new Sound();
myMusic.attachSound("music");
myMusic.start(0,9999);
cursor_mc.startDrag("true");
Mouse.hide();
cursor_mc._x = _xmouse;
cursor_mc._y = _ymouse;


//calcuate the position
function calculate() {
var px = _root._xmouse/Stage.width;
var py = _root._ymouse/Stage.height;
var x = 2000*px;
var y = 2000*py;
world.motionCam({x:x, y:y, z:0}, 20);
world.rotateZ(0, 10);
}

//world init initialize listener
var lis = {};
lis.onWorldInit = function() {
_root.calculate();
};

//set listener
world.addEventListener("onWorldInit", lis);

//set mouse event
_root.onMouseMove=calculate;

function onBtnRelease(btn,nm){
_root.onMouseMove=null;
_root.panel.title_txt.text=btn.title;
_root.panel._visible=true;
}


panel._visible=false;

The above code is for the 3d or space effect, it is generally used with a flash extension to get the effect working.

on(rollOver){
var mySong:Sound = new Sound();
mySong.attachSound("over1");
this.mySong.start();
this.gotoAndPlay(2);
}
on(rollOut){
var mySong:Sound = new Sound();
mySong.attachSound("over1");
//this.mySong.stop();
this.gotoAndPlay(1);
}

Above is the rollover code for the buttons.

No comments:

Post a Comment