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 ca
>
> 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
February 23, 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 m
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];
}
___
F
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();
loader.unloadAnd
On Tue, Feb 23, 2010 at 1:27 PM, Keith Reinfeld
wrote:
> > 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 onMouseOver, hence the valu
> 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
'myBeve
On Tue, Feb 23, 2010 at 11:04 AM, Keith Reinfeld
wrote:
> > 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.hasEvent
> 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 valu
On Mon, Feb 22, 2010 at 2:27 PM, Keith Reinfeld
wrote:
> > Thanks for the clarification, but that ain't doing it either.
>
> // LoaderInfo
> e.currentTarget
>
> // Bitmap
> e.currentTarget.loader.content
>
Perhaps, but if I trace(displayObject) it traces as the bitmap, so I can use
that. Such bei
> 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 deriv
> 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.currentTarget.l
On Mon, Feb 22, 2010 at 9:33 AM, Gregory Boland
wrote:
> 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 what
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 wro
On Mon, Feb 22, 2010 at 8:31 AM, Steven Sacks wrote:
> 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 = loaderInfo.loader.content;
dis
Update this line:
var displayObject:DisplayObject = loaderInfo.loader.content;
___
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
On Sat, Feb 20, 2010 at 2:58 PM, Keith Reinfeld
wrote:
> 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].contentLoaderInf
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 Loade
18 matches
Mail list logo