You'll want to learn how to create custom events and pass data with those. With a custom event, you can have it contain any amount and form of data. The custom events we use in our internal development framework all have a public "data" property with a type wildcard *, but you can specify more specific typecast properties than that of course.
Don't feel bad about your questions, I disagree with Taka I suppose, that's the point of this list and the best way to learn. If you were constantly bombarding us with newbie questions, I would probably refer you elsewhere as he did, but you aren't. If you aren't using FlashDevelop or a similar tool of equivalent power, I would recommend it. You'll know right away if you're missing an import for example, and it also will clean up your imports, removing the unused ones. 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: Tuesday, July 27, 2010 8:45 AM To: Flash Coders List Subject: Re: [Flashcoders] Listeners (was no subject) ----- Original Message ---- > From: Taka Kojima <t...@gigafied.com> > To: Flash Coders List <flashcoders@chattyfig.figleaf.com> > Sent: Mon, July 26, 2010 1:33:43 PM > Subject: Re: [Flashcoders] Listeners (was no subject) > > John, > > This is going to come across as harsh, however you really should > maybe go and get a book on AS3. > > These problems, forgetting an import, trying to pass arguments to a > listener, etc. are pretty rudimentary, and not really the purpose of > this list. Yep, a little rough. Got a good book. My question isn't how to pass arguments. I know how to do that. My question is far more specific. It's why don't I have to pass the e:Event argument? Why does the compiler complain that I only pass one argument when I try to pass the other since apparently the first argument is passed automatically? How can I pass that first argument manually when I can't even see what it is? Didn't notice that Moock addressed those questions, so I thought I'd ask here. Would you be so kind as to address those questions, not how to "pass arguments"? TIA, John > > Taka > > On Mon, Jul 26, 2010 at 10:58 AM, John Singleton > <johnsingleton...@yahoo.com > > wrote: > > > > > > > ---- Original Message ---- > > > > > From: Henrik Andersson <he...@henke37.cjb.net> > > > To: Flash Coders List <flashcoders@chattyfig.figleaf.com> > > > Sent: Mon, July 26, 2010 12:06:55 PM > > > Subject: Re: [Flashcoders] (no subject) > > > > > > John Singleton wrote: > > > > function RotateGearsLoaded(e:Event):void > > > Why is that? I tried to pass that var like this: > > > > > > > > > > > > >>loader.contentLoaderInfo.addEventListener(Event.COMPLETE,RotateGearsLo >>aded(displayGearsCounter)); > > > > > > > > > > > > > > RotateGearsLoaded returns void, not Function. The return value is not a > > > legal listener. Yet you are calling it here to get the listener to add. > > > > > > Remember, you are not the one calling the listener, thusly, you > > > can't decide the arguments. > > > > That makes sense. Unfortunately, it's not clear to me how I should proceed. > > Could you either recommend a tutorial or give an example? > > TIA, > > John > > PS. Original code for those who skipped this message because it had > > no > > subject: > > > > 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,RotateGearsLoad ed); > > } > > > > function RotateGearsLoaded(e:Event):void > > { > > var loaderInfo:LoaderInfo = e.target as LoaderInfo; > > var displayObject:DisplayObject = loaderInfo.content; > > displayObject.width = gearWidths[displayGearsCounter]; > > displayObject.height = gearHeights[displayGearsCounter]; > > // displayObject.x = - gearWidths[displayGearsCounter]; > > // displayObject.y = - gearWidths[displayGearsCounter]; > > displayObject.x = 0; > > displayObject.y = 0; > > trace(displayGearsCounter); > > parent_container.addChild(displayObject); > > parent_container.x = 0; > > parent_container.y = 0; > > parent_container.alpha = 1; > > addChild(parent_container); > > var myTimeline:TimelineLite = new > > TimelineLite({useFrames:true}); > > myTimeline.append(new TweenMax(parent_container, 1, > > {shortRotation:{rotation:gearAngles[displayGearsCounter]}})); > > } > > } > > > > > > > > > > _______________________________________________ > > Flashcoders mailing list > > Flashcoders@chattyfig.figleaf.com > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > _______________________________________________ > Flashcoders s 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 _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders