Tuesday, January 4, 2011

ActionScript

Have been a long time I didn't write any message inside my blog, now I going to put the "actionscript 2.0" that I use for my application. This AS2 use for my "PHOTO GALLERY" for Strip of Scrolling Thumbnails. Here's the script:

_root.onEnterFrame = function(){
if(_root.ymouse<460){
myVar=false;
}
if(_root.ymouse>461){
myVar=true;
}
if(_root.xmouse<1800 and myVar == true){
imgBar.prevFrame();
imgBar.prevFrame();
imgBar.prevFrame();
} else{
imgBar.play();
}
if(_root.xmouse>2200 and myVar == true){
imgBar.nextFrame();
imgBar.nextFrame();
} else{
imgBar.play();
}
if(_root._xmouse>50 && _root._xmouse<550 && myVar == true){
imgBar.stop();
}
}

Here's the script for picture to pop out after click the thumbnails:

var frameNum:Number;

function photoChange(){
_root.photos.gotoAndStop("img"+frameNum);
}
btn1.onRelease = function(){
frameNum = 1;
photoChange();
}
btn2.onRelease = function(){
frameNum = 2;
photoChange();