zain
June 12th, 2002, 07:49 AM
hiyaa...
how does this work? :
I have a flash movie consisting of 3 layers each with one frame only...
(1) On the firstkeyframe of layer 1 , i have initialized a variable :
rotation=0;
(2) on the firstkeyframe of layer 2 i have a button with the following actionscript:
on(release){
rotation+=10;
}
(3) on the firstkeyframe of layer 3 i have a movieclip with the following actionscript
onClipEvent(enterFrame){
setProperty(this,_rotation,_root.rotation)
}
now the thing is all this code works fine in rotating the movie clip everytime i click the button.
what i DONT understand is when the movie is playing when it loops, how come it doesnt set the rotation variable back to 0, as in the first layer we set rotation=0;??? wont the variable be reinitialized to 0 again?
this is confusing me a bit.... why does it take the value of rotation to be the value the button set it to and not what the frame set it to?
any ideas? any help would be appreciated..
cheers
Zain
how does this work? :
I have a flash movie consisting of 3 layers each with one frame only...
(1) On the firstkeyframe of layer 1 , i have initialized a variable :
rotation=0;
(2) on the firstkeyframe of layer 2 i have a button with the following actionscript:
on(release){
rotation+=10;
}
(3) on the firstkeyframe of layer 3 i have a movieclip with the following actionscript
onClipEvent(enterFrame){
setProperty(this,_rotation,_root.rotation)
}
now the thing is all this code works fine in rotating the movie clip everytime i click the button.
what i DONT understand is when the movie is playing when it loops, how come it doesnt set the rotation variable back to 0, as in the first layer we set rotation=0;??? wont the variable be reinitialized to 0 again?
this is confusing me a bit.... why does it take the value of rotation to be the value the button set it to and not what the frame set it to?
any ideas? any help would be appreciated..
cheers
Zain