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

flash actionscript : passing variables between scenes


kaliedo
5/20/2004 9:32:56 PM
i have a project with 5 scenes. When a user drags a movieclip to its target
position i need it to make a related movieclip invisible in another scene.
currently i have attempted to do this using variables on hitting target:


tellTarget (_root.clothes2)
gotoAndPlay(3); //plays an unrealted
animation
_global.clothes2drop = 1; // adds the necessary variable to
eventually set the partner movieclip to

i
invisible //(directing it to a a blank frame within that mc timeline)


then you move back to the partnered movieclips scene timeline but initally to
a different mc. At the end of this mc there are two bits of code, one
directing you back to the beginning of that scenes timeline and the other
giving an if statement to put the variable into play:


onClipEvent (load) {}

onClipEvent (enterFrame) {
toDrop= (_global.clothes2drop == 1) ;

if (toDrop) {
tellTarget(_root.clothes){
gotoAndPlay(16); // this directs you to a blank
frame within the mc making it invisible
}
}
}


this has the desired effect but only until you move to another scene then
when you come back your mc is visible again i.e. its moved back to frame 1
instead of staying on 16.

sorry if this sounds really complicated and there is a much easier way of
achieving the same thing - i'd love to be enlightened so please reply!!

cheers
kaliedo
mandingo
5/20/2004 10:51:44 PM
zip your .fla and upload it and we can better understand your issues and your layout.

kaliedo
5/21/2004 10:56:29 AM
i posted this question in another form under "hit target make invisible" post
and seem to have come up trumps!

thanks to " Shan-Dysigns" for his helpful comments and others for their
imput....

cheers kaliedo
AddThis Social Bookmark Button