-
ReferenceError: Error #1069: ???
what is error 1069?, the line in red drops error, any clue?.....
Code:
myloader.contentLoaderInfo.addEventListener(Event.COMPLETE, loaderFunction);
//event listener sub buttons control loaded movie
function loaderFunction(evt:Event):void {
menu.historia.addEventListener(MouseEvent.CLICK, clickSub);
function clickSub(evt:MouseEvent):void {
trace("subClick")
var mycontent:MovieClip=evt.currentTarget.content;
gotoAndStop("historia");
}
}
additional info about the error:
Property content not found on flash.display.SimpleButton and there is no default value.
at MethodInfo-2()
thanks for watching....
-
Originally Posted by Jimpaez
Property content not found on flash.display.SimpleButton and there is no default value.
The compiler is looking at a SimpleButton object - and it's unabled to find the property "content"
So you're trying to access menu.historia.content -- that may exist already, but when you get into the eventHandler function, all the compiler knows for sure is that it's got a MouseEvent. MouseEvent extends Event, which is where the .target property is defined - and at that level, the .target is typed as an Object - so you need to manually tell the compiler that whatever you clicked on will specifically have this extra property on it:
PHP Code:
mycontent = DisplayObjectContainer(evt.currentTarget).getChildByName('content');
Please use [php] or [code] tags, and mark your threads resolved 8)
-
Thanks for your answer, what i want is navigate in multiple timelines of multiple flash movies:
this is the entire code:
Code:
stop();
var myrequest:URLRequest=new
URLRequest("HomeSonny.swf");
var myloader:Loader=new Loader
myloader.load(myrequest);
stage.addChild(myloader);
//main buttons
menu.nosotros.addEventListener(MouseEvent.CLICK, clickmouse);
//menu.islas.addEventListener(MouseEvent.CLICK, clickmouse);
//event listener main buttons
function clickmouse(evt:MouseEvent):void {
trace("click")
myloader.load(new URLRequest("swf/"+evt.target.name+".swf"));
}
//listener loaded movie
myloader.contentLoaderInfo.addEventListener(Event.COMPLETE, loaderFunction);
//event listener sub buttons control loaded movie
function loaderFunction(evt:Event):void {
menu.historia.addEventListener(MouseEvent.CLICK, clickSub);
function clickSub(evt:MouseEvent):void {
trace("subClick")
var mycontent:MovieClip=evt.currentTarget.content;
gotoAndStop("historia");
}
}
where can i find a tutorial or recommend me a book where can i found this?
Last edited by Jimpaez; 09-30-2009 at 06:39 PM.
-
thank's for your help, I isolated the problem and found this
[code]
stop();
var myrequest:URLRequest=new URLRequest("swf/nosotros.swf");
var myloader:Loader=new Loader();
myloader.load(myrequest);
myloader.contentLoaderInfo.addEventListener(Event. COMPLETE, swfLoaded);
function swfLoaded(e:Event):void{
stage.addChild(myloader);
var mycontent:MovieClip=e.target.content;
mycontent.gotoAndStop("historia");
}
and it works, can you tell how can I change this script to a mouse event,
sample into the file
Link:
http://www.megaupload.com/?d=QZ302VNC
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|