Groups | Blog | Home
all groups > flash actionscript > may 2004 >

flash actionscript : Slide out



plugin+
5/23/2004 3:16:22 PM
Hi people,

I am sure this is a simple query but I just can't get my head round working it
out, I am pretty new to AS, maybe thats the problem:

I have four button links which trigger off a sliding panel (movie), how can I
give Flash the intelligence to know which was the last button clicked so that
it can send the previous panel back to its original state as well as slide the
current one out? Hope this makes sense, here is an example:

http://www.nirinc.com/launch.html

Have they used an if / else chain to work out which one to slide back in (the
links)

I have been trying to work this out for nearly 5 hours... AHHHGGG

Help
Thanks
kglad
5/23/2004 5:12:20 PM
plugin+
5/23/2004 5:33:31 PM
With my limited variable knowledge I have just done what you recomended but I
can't get the last sliding panel to slide back when the next one is clicked,

If possible, I want Flash to know which was the last button pressed and then
send it back via a label in the Movie timeline named back, if this is too
dificult then simple remove the last movie clip.

Here is the code I have inc. so far:

This is what I added to the first frame on the main timeline

// declare the variable for holding the slide intelligence
_global.click1 = 0;
_global.click2 = 0;
_global.click3 = 0;
_global.click4 = 0;


Here is the code attached to the button(s)

on(rollOver){
slideout1_mc.gotoAndPlay("roll");
}
on(rollOut){
slideout1_mc.gotoAndPlay("back");
}

on (release) {
click1 = 1;
click2 = 0;
click3 = 0;
click4 = 0;

if (click1 == 1){
click1_mc.gotoAndPlay("roll");
}
else if (click2 == 1){
click2_mc.gotoAndPlay("roll");
}
else if (click3 == 1){
click3_mc.gotoAndPlay("roll");
}
else {
click4_mc.gotoAndPlay("roll");
}
}





// declare the variable for holding the slide intelligence
_global.click1 = 0;
_global.click2 = 0;
_global.click3 = 0;
_global.click4 = 0;
plugin+
5/23/2004 5:34:45 PM
With my limited variable knowledge I have just done what you recomended but I
can't get the last sliding panel to slide back when the next one is clicked,

If possible, I want Flash to know which was the last button pressed and then
send it back via a label in the Movie timeline named back, if this is too
dificult then simple remove the last movie clip.

Here is the code I have inc. so far:

This is what I added to the first frame on the main timeline

// declare the variable for holding the slide intelligence
_global.click1 = 0;
_global.click2 = 0;
_global.click3 = 0;
_global.click4 = 0;


Here is the code attached to the button(s)

on(rollOver){
slideout1_mc.gotoAndPlay("roll");
}
on(rollOut){
slideout1_mc.gotoAndPlay("back");
}

on (release) {
click1 = 1;
click2 = 0;
click3 = 0;
click4 = 0;

if (click1 == 1){
click1_mc.gotoAndPlay("roll");
}
else if (click2 == 1){
click2_mc.gotoAndPlay("roll");
}
else if (click3 == 1){
click3_mc.gotoAndPlay("roll");
}
else {
click4_mc.gotoAndPlay("roll");
}
}





// declare the variable for holding the slide intelligence
_global.click1 = 0;
_global.click2 = 0;
_global.click3 = 0;
_global.click4 = 0;
AddThis Social Bookmark Button