MSFX said
you don’t need to cast it as a movieclip, that’s why you’re getting the error…
Thank you MSFX !
I did something a little different, but you got me to the issue.
Thanks
yuanhao_viva said
you can start from trace (parent,parent.parent,parent.parent…..)like this,and then you will know where is your target mc.
Thanks. I did the trace statement. It found [object Stage], but I’m still getting an error:
TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::Stage@2d128f99 to flash.display.MovieClip.
at YouTube_Panel_fla::MainTimeline/mouseDownHandler()
Here is my button in my EXTERNAL SWF to access the main timeline.
test_btn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
function mouseDownHandler(event:MouseEvent):void
{
trace(parent.parent.parent);
MovieClip(parent.parent.parent).myMovie_mc.gotoAndStop(3);
}
Thanks
Tim
tsafi said
timmylogue saidWe’ll let me clear something …. I only reply today to post from member i am fond of …. Don’t take it to the wrong way
You act like my posts are annoying.![]()
lol gotcha 
I don’t sell any products on here, but it looks like envato allows you to push the preview link to your own url… then host it yourself?
Then the person is just using this for the fake iframe look.<a href="http://codecanyon.net/item/translucent-responsive-banner-rotator-slider/801607"><div style="height:42px; width:100%; background: #000000 url(http://vectorflower.com/preview/trans_banner/trans_banner/cc_buy.jpg) top right no-repeat;" /></a>
Is that what you are asking?
tsafi said
^It’s like your 5 topic here I see you submit and you keep mixing AS2 with AS3 coding.When working with AS3 forget everything you know about AS2 .
What concern me more is you need to handle all this external swf MC when you swap to a new swf, you must dump your entire asset first before you load a new swf it’s not AS2 you know.
The load and unload your external swf in a template is one of the most imported thing in our coding.
You keep patching thing from your bad AS2 habit and you confuse everyone here![]()
haha what are you talking about?
1) Where is there AS2 code here?
2) I’m only loading one external swf. I know how to unload external swf in AS3 .
3) How i’m I confusing everyone?
You act like my posts are annoying. Most posts on here are about stupid crap
and not what its suppose to be. 
MSFX said
then..myMovie_mc.gotoAndStop(5);
should suffice or is this not in your document class?
No this is not the main class. The main class is adding the myMovie to the stage.
MSFX said
the events look fine, you can’t make the stage (root) into a movieclip hence the error… where is the mc you’re trying to access…?
Hey thanks, didn’t know that.
The movieclip is being brought on stage with addChild(myMovie_mc); in the main timeline.
Thanks everyone for the replies. This is what I came up with and please correct me if I’m wrong.
External swf
myButton_btn.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
function mouseDownHandler(event:MouseEvent):void
{
parent.parent.dispatchEvent(new Event("customEventTypeString", true));
}
Main document
addEventListener("customEventTypeString", customEventHandler);
function customEventHandler(evt:Event):void {
trace("i am a parent function called in child");
MovieClip(root).myMovie_mc.gotoAndStop(5);
}
var loader:Loader = new Loader();
loader.load(new URLRequest("mySWF.swf"));
addChild(loader);
The trace statement get hits, but I get an 1034 error. Here is the error log:
i am a parent function called in child
TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::Stage@94f5f99 to flash.display.MovieClip.
at youtubeArea/customEventHandler()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at YouTube_Panel_fla::MainTimeline/mouseDownHandler()
MSFX said
can you adjust the external swf code?
yup!
Hey thanks, but i’m gettting an error TypeError: Error #1009: Cannot access a property or method of a null object reference.
My favor error lol
Thanks
