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);
Update this line:
var displayObject:DisplayObject = loaderInfo.loader.content;
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
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 =
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
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
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
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
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
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
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
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,
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:
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
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
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
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
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
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 =
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
19 matches
Mail list logo