I presume my removeEventListener works.
You should be sure. So check it:
trace(e.currentTarget.hasEventListener(Event.COMPLETE)); //true
e.currentTarget.removeEventListener(Event.COMPLETE, loaded);
trace(e.currentTarget.hasEventListener(Event.COMPLETE)); //false
So, how do I pass new
On Tue, Feb 23, 2010 at 11:04 AM, Keith Reinfeld
keithreinf...@comcast.netwrote:
I presume my removeEventListener works.
You should be sure. So check it:
trace(e.currentTarget.hasEventListener(Event.COMPLETE)); //true
e.currentTarget.removeEventListener(Event.COMPLETE, loaded);
How is that? I'm not iterating over that function, I call it as needed,
so
myX, myY would be reset every time.
Uses the addition assignment (+=) operator.
No:
displayObject.filters = [createBevel()];
You are missing the point. Why run this function repeatedly when you can set
'myBevel'
On Tue, Feb 23, 2010 at 1:27 PM, Keith Reinfeld
keithreinf...@comcast.netwrote:
How is that? I'm not iterating over that function, I call it as needed,
so
myX, myY would be reset every time.
Uses the addition assignment (+=) operator.
My bad. It is not iteration. It is called
When loading bitmaps, your loader will NEVER be eligible for cleanup by the
Garbage Collector unless you do ALL of the following in this order:
var bitmap:Bitmap = new Bitmap(Bitmap(loader.content).bitmapData.clone(),
auto, true);
Bitmap(loader.content).bitmapData.dispose();
You should only create the bevel filter ONCE. Filters are _expensive_ and
can/should be shared. Make your bevel an instance variable
private var myBevel:BevelFilter = new BevelFilter();
public function foo()
{
myClip.filters = [myBevel];
}
___
, 2010 2:52 PM
To: Flash Coders List
Subject: Re: [Flashcoders] Event.COMPLETE Question
You should only create the bevel filter ONCE. Filters are _expensive_
and
can/should be shared. Make your bevel an instance variable
private var myBevel:BevelFilter = new BevelFilter();
public function
var bitmap:Bitmap = new
Bitmap(Bitmap(loader.content).bitmapData.clone(),auto, true);
Bitmap(loader.content).bitmapData.dispose();
loader.unloadAndStop(true);
try {
loader.close();
} catch (e:Error) {}
// remove all event listeners from loader
Steven,
I'm curious about the
If you call close() on a Loader and it fails for any reason, it will throw a
runtime error that you can do nothing about. To avoid this, you should wrap it
in a try catch.
The code block comes straight from Flex and it works. If you test it a bunch and
close() never fires an error, then you
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
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
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);
loaderArray[counter].contentLoaderInfo.addEventListener(Event.COMPLETE,loade
d);
This way each
17 matches
Mail list logo