Hi,
I'm using the Flash IDE with a Main Class(CarouselNew) and for some reason, the objects that are on stage(given instance names) in the the Flash IDE are throwing errors when I try to run the swf. On the most basic level, I have a mc on the stage with an instance name of myContent and just tracing it throws an 1120 error--I added some ADDED_TO_STAGE event code in the initial declaration of the class to make sure that the mcs, like the myContent mc, are on the display list and yet it doesnt work---Also, if I have a mc within the myContent mc with an instance name of mycontainer would I access its properties like this:
That's how I've been doing it until now.Code:myContent.mycontainer.z = 100;
Can someone help?
I can bypass the first trace error if I explicitly declare the var by using this:but I don't understand why I would need to do that being its on the stage in the Flash IDE...and I still can't access the mc within that clip with an instance name of mycontainer...get a 1010 error--term is undefined...Code:public var myContent :MovieClip;
Here is some of the code and the code that throws the first error--
The trace statement throws that error...Code:public function CarouselNew() { addEventListener(Event.ADDED_TO_STAGE, onAddedToStage); function onAddedToStage(evt:Event):void { trace(myContent); removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage); } if (stage) { contextMenu = new ContextMenu(); contextMenu.hideBuiltInItems(); init(); loadXML(); //addChild(myContent); } else { addEventListener(Event.ADDED_TO_STAGE,init); } private function init():void { container = new Sprite(); container.x = 450; container.y = 450; container.z = 400; addChild(container); cloudBut.visible = false; cloudBut.buttonMode = true; cloudBut.mouseChildren = false; //cover.addEventListener(MouseEvent.CLICK, stageClick); removeEventListener(Event.ADDED_TO_STAGE, init); this.addEventListener(Event.ENTER_FRAME, loop); }
Thanks,
---Yvette




Reply With Quote