Where is your import flash.events.Event; statement?
Jason Merrill Instructional Technology Architect Bank of America Global Learning Join the Bank of America Flash Platform Community and visit our Instructional Technology Design Blog (Note: these resources are only available for Bank of America associates) -----Original Message----- From: flashcoders-boun...@chattyfig.figleaf.com [mailto:flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of John Singleton Sent: Monday, July 26, 2010 10:21 AM To: flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] 1046 Error Hi; I have this code which works elsewhere: public class Main extends MovieClip { var parent_container:Sprite = new Sprite(); private var displayGearsCounter:int = 0; var gearsPaths:Array = new Array("images/watch/watch-movements/back-center.png", "images/watch/watch-movements/back.png", "images/watch/watch-movements/middle-center.png", "images/watch/watch-movements/middle.png", "images/watch/watch-movements/left-center.png", "images/watch/watch-movements/left.png", "images/watch/watch-movements/top-center.png", "images/watch/watch-movements/top.png"); var angles:Array = new Array(10, 10, 10, 10, 10, 10, 10, 10); function Main() { InitRotateGears(); } function InitRotateGears() { for (var i = 0; i < gearsPaths.length; i++) { RotateGears(); displayGearsCounter += 1; } function RotateGears() { var path:String = new String(); path = gearsPaths[displayGearsCounter]; var req:URLRequest = new URLRequest(path); var loader:Loader = new Loader(); loader.load(req); loader.contentLoaderInfo.addEventListener(Event.COMPLETE,RotateGearsLoaded); } function RotateGearsLoaded(e:Event):void { trace('hi'); } /* function RotateGearsLoaded(e:Event):void { var loaderInfo:LoaderInfo = e.target as LoaderInfo; var displayObject:DisplayObject = loaderInfo.content; displayObject.width = 150; displayObject.height = 150; displayObject.x = -150; displayObject.y = -150; TweenMax.to(displayObject, 0, {shortRotation:{rotation:60}}); parent_container.addChild(displayObject); parent_container.x = 820; parent_container.y = 537; parent_container.alpha = 1; addChild(parent_container); var myTimeline:TimelineLite = new TimelineLite({useFrames:true}); myTimeline.append(new TweenLite(parent_container, 1, {shortRotation:{rotation:angles[displayGearsCounter]}})); myTimeline.append(new TweenLite(parent_container, 1, {alpha:0})); } */ Now I deliberately commented out that code that worked to test with a simple trace and nada. I get a 1046 error: 1046: Type was not found or was not a compile-time constant: Event. [for RotateGearsLoaded(e:Event)] Why? What do? TIA, John _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders