0
votes

so I tried all examples given here, mainly all the 3 options from another post:

 //option 1
MovieClip(this.root).gotoAndPlay(134);

//option 2
MovieClip(parent).gotoAndPlay(134);

//option 3
var mc:MovieClip = this.parent as MovieClip;
mc.gotoAndPlay(134);

And here is my issue: On my main timeline I have a mc tweening from frame 1 to frame 25. The movieclip instance has the instance name "carMc". ON frame 25 I have the following code:

var carMc:MovieClip = this.parent as MovieClip;
carMc.gotoAndPlay(5);

carMc has 6 frames. A stop action on frame 1 and a gotoAndPlay(5); action on frame 6

My issue is that carMc won't go as directed to play frame 5.When I run a trace on frame 25 of the main timeline I get a

[object carMc_3] 

returned...And have no idea why this is. For some reason it doesn't seem as if Flash is treating my movieclip instance on the timeline as a movieclip.

Any ideas??? Thanks guys!

1
Frame 1-25 of the carMC's timeline, or frame 1-25 of the main timeline? Your question is hard to understand. Can you update your question to clarity the context in which each posted code is running (main timeline, child movie clip etc). Also, where are tracing?BadFeelingAboutThis

1 Answers

1
votes

Your problem is a bit complicated to understand but i'll try.

On my main timeline I have a mc tweening from frame 1 to frame 25. The movieclip instance has the instance name "carMc". ON frame 25 I have the following code:

var carMc:MovieClip = this.parent as MovieClip; carMc.gotoAndPlay(5);

If this code is in main timeline than this.parent would be Stage which is indeed an object. If you want to reference car movieclip than you need to reference it as

this.CarMc