View Full Version : Path from nested m/c back to root
prendo
08-22-2002, 10:07 AM
I'm trying to send my movie back to the main timeline from a nested movieclip but can't get the code to work.
I basically have a path like this: MainTimeline>MC1>MC2
and I've tried various lines of code in the end frame of MC2 to send the playhead back to the beginning (_root) eg:
_root.play();
_root.play('MainTimeline')
_root.gotoAndPlay(1);
_parent._parent.gotoAndPlay(1);
It seems that all of the above are simply being ignored as MC2 just loops round and round. I'm sure that all the above lines should work, can anyone tell me what I'm doing wrong?
Thanks
vosgien
08-22-2002, 10:39 AM
Hi,
There is absolutely no reason why :
_root.gotoAndPlay()
shouldn't work.
Only thing I can think of is : is mc2 in your main movie or a sub-movie - if so you could try _level. etc etc
Otherwise i suggest you post your file here for a fresh pair of eyes
Cheers
Vosgien
prendo
08-22-2002, 10:52 AM
Yes I think you're right, MC2 is a submovie. How would I target the level exactly? I tried the following but that didn't work either.
_level0.play();
I've uploaded the files at www.riley.co.uk/test/golf1.html (fla also).
Cheers
Ricod
08-22-2002, 11:16 AM
The only reason I can think of why _root wouldn''t work is that you're using Flash 4 ...
prendo
08-22-2002, 11:24 AM
No, I'm using Flash 5.
Any other ideas??
If MC2 is a submovie of MC1, which is a child of the root timeline does this mean that MC2 resides on level1 or level2. (just tryin to figure out if my code above was actually correct) eg _level0.play();
There must be another explanation why Flash can't see my MC cos it's such a straightforward command. I'm lost. anyone please?
www.riley.co.uk/test/golf1.html
Thanks
pinkaboo
08-22-2002, 11:29 AM
where's your fla? it's not uploaded so we can't see your code. :(
hmm, you don't have a forgotten action in a frame prior to the end one that is perhaps looping the mc before it reaches your _root.gotoAndPlay(1); frame do you?
pinK
prendo
08-22-2002, 11:35 AM
oops sorry, I missed off the fla extension some how. It should be ok to download now. Otherwise it may be the firewall. Let me know and I'll upload at geocities or somewhere.
and no, there's no left over frame actions that I can see in MC2.
thanks
pinkaboo
08-22-2002, 11:42 AM
ah.. your _root only has one frame, so your code is working just fine, it's doing exactly what you are telling it to do. It's playing frame 1 again, which will in effect refresh the mc, hence it loops.
so this begs the question..what is it you are really trying to do? Which frame of which mc do you want to play?
-pinK
pinkaboo
08-22-2002, 11:47 AM
oh and forget about the levels stuff, it's all on _level0 which is the same as _root. _level1 and above are levels that don't exist in the working environment/timeline but that you can utilise if you load swfs into them during runtime. I think Vosgien was asking whether your mcs were in an external swf being loaded into a higher level, that would effect your pathing you see. But here, you are just dealing with _root or _level0 as your main timeline.
prendo
08-22-2002, 11:57 AM
WOOHOO!
thanks PINk. It took a moment to sink in but I think I got it now. Just name my individual mc instances and target them specifically.
Very much appreciate your help!
(this has been by far the most responsive and helpful flash forum I've visited in a while!)
thanks to all concerned.
vosgien
08-22-2002, 12:16 PM
Whoa, I just stepped out for a spot of lunch and when I get back - your all sorted !!
Wehter you're askin' or answerin' this definitely the best site around
Cheers
Vosgien
prendo
08-22-2002, 12:45 PM
Well, I think I've been a little premature..
The solution outlined above has only opened up more problems. I named all my mc instances and put a label in the 1st frame of each. I then targeted the start of the main movie from the end so that it would continually loop around (similar to a banner ad). I used the code:
_root.mc1.gotoAndPlay("begin");
This worked in that it did go back to the beginning but once at the end of this mc it jumped right to the end again rather than moving thru all my m/cs sequentially.
I then named all the other m/cs and used a similar command at the end of each to try to get them to play in the correct order.
Unfortunately this just causes the first m/c (the golf club) to loop madly. Maybe I'm not structuring my movies in a very elegant way and this is the real problem...I may just start from scratch, any advice appreciated.
Please can anyone see a solution from the fla file at:
www.riley.co.uk/test/golf1.html
pinK, did u manage to get it workin?
vosgien
08-22-2002, 01:12 PM
Hey Prendo,
Can you put your fla up on this site, I can't get it from the link you made.
Despite the fact that it keeps looping, love the colour, like the club, no need to start again yet, just let us see what you're trying to get at
Vosgien
pinkaboo
08-22-2002, 01:21 PM
sorry, having pooter problems, but before I reboot, why not just restructure your file so that all those mcs follow each other on the main timeline and then it should all loop round in the right order automatically.
hope I haven't just botched the file though - can't see what I'm doing - poop to my video card.
:)
K
prendo
08-22-2002, 01:34 PM
vosgien, I'm on a Mac and I only have a free version of stuffit which I believe creates .SIT files not .ZIP. (I don't have the more powerful version that creates ZIP files) and I don't think this site allows upload .SIT files..Let me know if it's possible.
Well it looks like pinK has just provided a ZIP. Thanx pinK!!:) hope that works ok vosgien. I'm gonna try the suggestion about reordering the main timeline though, it makes sense. Then I'll go for a walk(can't see wood 4 trees!!)
vosgien
08-22-2002, 01:45 PM
Hi,
yep, I got Pinks .zip, what do you want it to do ? The club hits the ball, the text appears and then what ? I assule from this post that you want it to go back to frame one and not have it play over again. Is that right. If so what will happen in fr1 after the first ( and only) loop.
I am also suffering "can't see the wood 4 the trees" or was tha
vosgien
08-22-2002, 01:46 PM
Hi,
yep, I got Pinks .zip, what do you want it to do ? The club hits the ball, the text appears and then what ? I assume from this post that you want it to go back to frame one and not have it play over again. Is that right. If so what will happen in fr1 after the first ( and only) loop.
I am also suffering "can't see the wood 4 the trees" (on a prob of my own )or was that a golf pun
Vosgien
pinkaboo
08-22-2002, 01:49 PM
sorry to confuse things, but here is prendo's original file all nicely zipped.
(the other was my crude bash at getting the mcs to fire in the right order on the main timeline.)
pinK
prendo
08-22-2002, 01:59 PM
no not a pun, I'm beyond punning right now. just a state of mind.
First of all the golf clubs swings (MC1)
Then the ball lands in the water (MC2)
Then the following text appears in (MC3)
Need to work on your swing?
The Riley Advertising Golf Day. Thursday September 26th, City West Hotel & Country Club.
Then the movie goes back to the start (MC1) and plays over.
thanks
prendo
08-22-2002, 02:28 PM
I think I've finally sorted this out. Sorry for taking up so much of your time. I repositioned all the mcs on the main timeline like pinK said. I think I've got it now, it seems to be looping ok, I just need to get the synchronization right now.
Thanks to you both, I couldn't have got here without your help.
cheers
vosgien
08-22-2002, 02:37 PM
Hi Prendo,
Thats exactly what Pink has done for you, if you can't download the .zip, its achieved by :
main Movie = layer1:ball place in Fr1, put blank keyFraem in Fr21
layer2:waterplace in fr22 ditto above in Fr74
layer3:textblur place in Fr75 ditto above in Fr325
in your mc.hitball the first frame should be blank and the code on the last frame should be gotoAndStop(1);
in mc.water movie last fr code should be gotoAndStop(1);
in your mc.textmotion blur, the nested mc's should have the same code.
Although the movie will loop automatically I would still be inclined to put a gotoAndPlay(1) on the last fr. of the main timeline
That should just about do it
- hope it helps
Vosgien
pinkaboo
08-22-2002, 02:39 PM
no problem, glad I "kinda" helped, I'm all ditzy today so it's good to know something is working out there, cos it certainly isn't my side of the pooter!
.o0(*work? pah!*)
;)
pinK
smallplate
08-22-2002, 04:25 PM
[QUOTE]Originally posted by prendo
[B]vosgien, I'm on a Mac and I only have a free version of stuffit which I believe creates .SIT files not .ZIP. (I don't have the more powerful version that creates ZIP files) and I don't think this site allows upload .SIT files..Let me know if it's possible.
hey prendo, FYI the latest version of stuffit come chock full of files compressors and tis free!! i forget thefilesize, but even if you are on a modem it is a worthwile download. it makes getting files to people on pc's a lot easier.
prendo
08-22-2002, 04:30 PM
thanks, I'll try that!
prendo
08-23-2002, 10:32 AM
www.riley.ie/news
Finally got there. Thanks again.:D
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.