View Full Version : next scene from movieclip
marcuslm
04-16-2002, 04:54 PM
I have a flah movie with two scenes. On scene #1 I have a moviclip. I want to have the main movie proceed to scene #2 when the movieclip on scene #1 is clicked on with the mouse.
I can't seem to get the on(press) actionscript to work. I think my problem is scope. Please help!!!!!! This is driving me crazy! Any help appreciated.
Thanks!
Marcus :confused:
:D perhaps a little bit of what you have in your button would help.
sth like
on (press){
gotoAndPlay ("scene2", 1);
}
is this sth you have?
marcuslm
04-16-2002, 07:55 PM
That's exactly what I have. It seems to do nothing.
maowang
04-16-2002, 08:07 PM
try add "play" on Scene 2 frame 1
marcuslm
04-16-2002, 08:41 PM
I tried putting play in Scene #2. Still did not work.
farafiro
04-17-2002, 09:30 AM
give the first frame a lable and use it instead of the number of the frame
on (press){
gotoAndPlay ("scene2", frameLable);
}
marcuslm
04-17-2002, 12:58 PM
I tried using a label instead of the frame number and still I get nothing. A friend sent me this code and it does work, BUT isn't tellTarget deprecated?!?
on (press) {
tellTarget (_root) {
gotoAndPlay("Scene2", 1);
}
}
Marcus
pinkaboo
04-17-2002, 02:08 PM
BUT isn't tellTarget deprecated?!?
yes
out of interest have you tried labelling the frame and using:
on (release) {
_root.gotoAndPlay ("framelabelhere");
}
?
I think it's the _root bit it's missing and getting confused *perhaps*
:D Ahh.... yes. I get it now. your movie must be resided in the main timeline. that's why using only
on (press) {
gotoAndPlay (...);
}
won't work. you need to tell it to get out of that movie to the main timeline and go to next scene. that's why your friend tells you to use
on (press) {
tellTarget (_root) {
gotoAndPlay("Scene2", 1);
}
}
Anyways, good to hear that it works.
i'm in a bit late on this one but i think there is a general concensus that using scenes is a lil dodgy.
i would paste everything from scene 2 after what u have in scene 1 and put a label at the beginning.
then on ur button put what pinkaboo said
on (release) {
_root.gotoAndPlay ("framelabelhere");
}
this is telling ur _root to go and play the label.
BLEEDs
marcuslm
04-17-2002, 11:24 PM
Dodgy? Meaning bug ridden or just not optimal for perfomance reasons? Using scenes just seemed like an organized way to do it. But if there are reasons why I should not do it this way then I will use a single long timeline. Comments?
Marcus
snapple
04-18-2002, 01:13 AM
marcuslm,
Avoiding scenes is generally recommended, although at first (when i started using flash i certainly thought this), scenes may seem almost crucial in organising large projects, it can make coding (targeting certain MC's within different scenes) more complicated, as all your really doing is adding more parent timelines for flash (and you) to deal with. As long as your '_root' timeline does not have masses of animation on it, then labeling frames and using one timeline is by far best.
Hope this helped in some way
Snapple
:)
Absolutely agree with using frame label instead of scene. :D
maowang
04-20-2002, 09:30 PM
[QUOTE]Originally posted by toke
Absolutely agree with using frame label instead of scene. :D [/QUOT
what about the file size? does it make any difference between scene and lable the frame?
i've not ever tested it nut i don't think it would be a considerable difference either way (if there is any difference)
cheers
BLEEDA
umm... I don't think there is any differences. If you want to have a small file size, you can use save as and give it a different name then use save as again to save it back to the original file.
say... I have a file name "blabla.fla" and the size is about 1.727 MB. I want to reduce this file so I save it as "blabla1.fla", and the size is reduced to 1.696 MB. It's not much but sure help decreasing the size.
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.