Re: [Flashcoders] Event.COMPLETE Question

2010-02-22 Thread Susan Day
On Sat, Feb 20, 2010 at 2:58 PM, Keith Reinfeld keithreinf...@comcast.netwrote: All but the last Loader is being over written. Put each Loader into an array. var req:URLRequest = new URLRequest(path); loaderArray[counter] = new Loader(); loaderArray[counter].load(req);

Re: [Flashcoders] Event.COMPLETE Question

2010-02-22 Thread Steven Sacks
Update this line: var displayObject:DisplayObject = loaderInfo.loader.content; ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Re: [Flashcoders] Event.COMPLETE Question

2010-02-22 Thread Susan Day
On Mon, Feb 22, 2010 at 8:31 AM, Steven Sacks flash...@stevensacks.netwrote: Update this line: var displayObject:DisplayObject = loaderInfo.loader.content; Updated: function loaded(e:Event):void { var loaderInfo:LoaderInfo = e.target as LoaderInfo; var displayObject:DisplayObject =

Re: [Flashcoders] Event.COMPLETE Question

2010-02-22 Thread Gregory Boland
e.target isn't your loader info, its most likely the Loader itself. the target is where the event bubbles from, and the currentTarget is what was applied the listener so what you are looking for is e.target.content and that is whatever you loaded in On Mon, Feb 22, 2010 at 4:57 AM, Susan Day

Re: [Flashcoders] Event.COMPLETE Question

2010-02-22 Thread Susan Day
On Mon, Feb 22, 2010 at 9:33 AM, Gregory Boland breakfastcof...@gmail.comwrote: e.target isn't your loader info, its most likely the Loader itself. the target is where the event bubbles from, and the currentTarget is what was applied the listener so what you are looking for is

[Flashcoders] 2.0 = 3.0

2010-02-22 Thread Lehr, Theodore
how would I translate: _root[but_+pArray[i]].gotoAndStop(1); from 2.0 to 3.0? The error I am getting is Access of undefined property _root. TIA! Ted ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com

Re: [Flashcoders] 2.0 = 3.0

2010-02-22 Thread Henrik Andersson
Lehr, Theodore wrote: The error I am getting is Access of undefined property _root. did you try simply dropping the underscore? The api isn't THAT much different. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com

RE: [Flashcoders] 2.0 = 3.0

2010-02-22 Thread Merrill, Jason
Well, using root is just bad practice anyway - there's no need for it in anything you do. Jason Merrill Bank of America Global Learning Learning Performance Solutions Join the Bank of America Flash Platform Community and visit our Instructional Technology Design Blog (note: these are for

Re: [Flashcoders] 2.0 = 3.0

2010-02-22 Thread Henrik Andersson
Merrill, Jason wrote: Well, using root is just bad practice anyway - there's no need for it in anything you do. That is an elitist view on the matter. I say, think, then code. If you mean the main timeline, use root. I am more concerned with people who insist on dynamic instance names

RE: [Flashcoders] 2.0 = 3.0

2010-02-22 Thread Merrill, Jason
I don't think its elitist at all - I think using root is only asking for trouble. I think it's poor practice, plain and simple, and there is NO reason for it. There are much better ways of doing things. Jason Merrill Bank of America Global Learning Learning Performance Solutions Join

Re: [Flashcoders] 2.0 = 3.0

2010-02-22 Thread Glen Pike
Surely using dynamic instance names can be faster than using array lookup in some instances? For example, I have a number of movieclip classes, I don't want to extend their functionality by subclassing, so instead of adding an id property, I derive the id from the instance name - btn_0,

RE: [Flashcoders] 2.0 = 3.0

2010-02-22 Thread Lehr, Theodore
Sorry - I am way new to 3.0 - this is code I am trying to convert to help me learn why would this not work: var pArray = new Array(); pArray[0].gotoAndStop(2); or is there a better way to do it in 3 Thanks From:

Re: [Flashcoders] 2.0 = 3.0

2010-02-22 Thread Henrik Andersson
Merrill, Jason wrote: No - I mean just broadcasting events instead of coupling code across timelines. Even if you're not using design patterns or even coding outside the IDE, you don't need to use root. For events you still need an object to dispatch them on. And it really is just used as

RE: [Flashcoders] 2.0 = 3.0

2010-02-22 Thread Merrill, Jason
Event listeners also can not return any value. Ha. That isn't true at all, you can send data with events. I do it all the time, and it's not bad practice. Events are worse than just calling the right method to begin with. Events are too loosely coupled if you ask me. Well, you use event

Re: [Flashcoders] 2.0 = 3.0

2010-02-22 Thread tom rhodes
Lehr, try this... var pArray:Array = new Array(); var mc:MovieClip = pArray[0] as MovieClip; mc.gotoAndStop(2); or... var pArray:Array = new Array(); MovieClip(pArray[0]).gotoAndStop(2); which is closer to your original AS2. On 22 February 2010 17:48, Henrik Andersson

RE: [Flashcoders] 2.0 = 3.0

2010-02-22 Thread Merrill, Jason
Well, you use event listeners to call the right event. I meant to type,you use event listeners to call the right method. Jason Merrill Bank of America Global Learning Learning Performance Solutions Join the Bank of America Flash Platform Community and visit our Instructional

RE: [Flashcoders] 2.0 = 3.0

2010-02-22 Thread Merrill, Jason
No - I mean just broadcasting events instead of coupling code across timelines. Even if you're not using design patterns or even coding outside the IDE, you don't need to use root. Jason Merrill Bank of America Global Learning Learning Performance Solutions Join the Bank of America Flash

RE: [Flashcoders] Event.COMPLETE Question

2010-02-22 Thread Keith Reinfeld
Thanks for the clarification, but that ain't doing it either. // LoaderInfo e.currentTarget // Bitmap e.currentTarget.loader.content // Remove listener e.currentTarget.removeEventListener(Event.COMPLETE, loaded); // Get current jpg var displayObject:DisplayObject =

Re: [Flashcoders] Event.COMPLETE Question

2010-02-22 Thread Steven Sacks
e.target isn't your loader info, its most likely the Loader itself. loader.contentLoaderInfo.addEventListener() The LoaderInfo is the target of the event - that's what you added the event listener to. trace(event.target); [LoaderInfo] Proof that the LoaderInfo is the target is easily