Re: [Flashcoders] Loader Mouse Event
Maybe load the image into a empty MC and put the rollover on the MC? Best, Karl On Jun 11, 2012, at 12:32 PM, Kerry Thompson wrote: I've never tried to get a mouse event on a loader. Do you have a progress bar? I would add a MouseEvent listener to the progress bar, not the loader itself. If that doesn't work, add a movie clip with a 0 alpha on top of the loader, and attach the mouse listener to that. You could use a standard Flash shape like a rectangle, and lengthen it in sequence with the progress bar, You would want something like this to keep it in sequence: progBar.addEventListener(ProgressEvent.PROGRESS, progressHandler); and, in your progressHanler function, set its length and height to that of the progress bar. Cordially, Kerry Thompson On Mon, Jun 11, 2012 at 1:08 PM, Ted Lehr wrote: So I have a Loader that is loading an image: var Img:Loader = new Loader(); var urlReq:URLRequest = new URLRequest("http://www.someurl.com";); img.load(urlReq); and I am trying: img.addEventListener(MouseEvent.ROLL_OVER,x); this does not seem to work - does that make sense? and if so, how can I get a mouse event on the loader - do I need to load it in another mc? Thanks! ___ 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 Karl DeSaulniers Design Drumm http://designdrumm.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Loader Mouse Event
There must be something else going wrong with your code. This works fine for me, you can paste it straight into a new project and test it: import flash.net.URLRequest; import flash.display.Loader; import flash.events.MouseEvent; var url:String = "http://www.gogo-tennis.com/images/Tennis%20Balls_small.jpg";; var req:URLRequest = new URLRequest(url); var ldr:Loader = new Loader(); ldr.addEventListener(MouseEvent.ROLL_OVER, rollOverListener); ldr.load(req); addChild(ldr); function rollOverListener(e:MouseEvent):void { // trace("hit!"); } On 11 June 2012 23:40, Karl DeSaulniers wrote: > Maybe load the image into a empty MC and put the rollover on the MC? > > Best, > Karl > > > On Jun 11, 2012, at 12:32 PM, Kerry Thompson wrote: > >> I've never tried to get a mouse event on a loader. Do you have a >> progress bar? I would add a MouseEvent listener to the progress bar, >> not the loader itself. If that doesn't work, add a movie clip with a 0 >> alpha on top of the loader, and attach the mouse listener to that. You >> could use a standard Flash shape like a rectangle, and lengthen it in >> sequence with the progress bar, You would want something like this to >> keep it in sequence: >> >> progBar.addEventListener(ProgressEvent.PROGRESS, progressHandler); >> >> and, in your progressHanler function, set its length and height to >> that of the progress bar. >> >> Cordially, >> >> Kerry Thompson >> >> On Mon, Jun 11, 2012 at 1:08 PM, Ted Lehr wrote: >>> >>> So I have a Loader that is loading an image: >>> >>> var Img:Loader = new Loader(); >>> var urlReq:URLRequest = new URLRequest("http://www.someurl.com";); >>> >>> img.load(urlReq); >>> >>> >>> and I am trying: >>> >>> img.addEventListener(MouseEvent.ROLL_OVER,x); >>> >>> >>> >>> this does not seem to work - does that make sense? and if so, how can I >>> get a mouse event on the loader - do I need to load it in another mc? >>> >>> >>> Thanks! >>> >>> ___ >>> 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 > > > Karl DeSaulniers > Design Drumm > http://designdrumm.com > > > ___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders -- David Hunter www.davidhunterdesign.com +44 (0) 7869 104 906 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Loader Mouse Event
um, instead of putting things over, why not put your loader IN a sprite instead, or if you're loading an image make a bitmap and stick that in a sprite. seems odd to me to have mouse events on something placed over something else, what happens if you want to move the image? you have to move the thing over it too. ugh. On 11 June 2012 21:08, Ted Lehr wrote: > Thanks - I ended up putting a sprite over the image and giving that the > listener... > > Ted > > > -Original Message- > From: flashcoders-boun...@chattyfig.figleaf.com on behalf of Kerry > Thompson > Sent: Mon 6/11/2012 1:32 PM > To: Flash Coders List > Subject: Re: [Flashcoders] Loader Mouse Event > > I've never tried to get a mouse event on a loader. Do you have a > progress bar? I would add a MouseEvent listener to the progress bar, > not the loader itself. If that doesn't work, add a movie clip with a 0 > alpha on top of the loader, and attach the mouse listener to that. You > could use a standard Flash shape like a rectangle, and lengthen it in > sequence with the progress bar, You would want something like this to > keep it in sequence: > > progBar.addEventListener(ProgressEvent.PROGRESS, progressHandler); > > and, in your progressHanler function, set its length and height to > that of the progress bar. > > Cordially, > > Kerry Thompson > > On Mon, Jun 11, 2012 at 1:08 PM, Ted Lehr wrote: > > So I have a Loader that is loading an image: > > > > var Img:Loader = new Loader(); > > var urlReq:URLRequest = new URLRequest("http://www.someurl.com";); > > > > img.load(urlReq); > > > > > > and I am trying: > > > > img.addEventListener(MouseEvent.ROLL_OVER,x); > > > > > > > > this does not seem to work - does that make sense? and if so, how can I > get a mouse event on the loader - do I need to load it in another mc? > > > > > > Thanks! > > > > ___ > > 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 > > > ___ > 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
RE: [Flashcoders] Loader Mouse Event
Thanks - I ended up putting a sprite over the image and giving that the listener... Ted -Original Message- From: flashcoders-boun...@chattyfig.figleaf.com on behalf of Kerry Thompson Sent: Mon 6/11/2012 1:32 PM To: Flash Coders List Subject: Re: [Flashcoders] Loader Mouse Event I've never tried to get a mouse event on a loader. Do you have a progress bar? I would add a MouseEvent listener to the progress bar, not the loader itself. If that doesn't work, add a movie clip with a 0 alpha on top of the loader, and attach the mouse listener to that. You could use a standard Flash shape like a rectangle, and lengthen it in sequence with the progress bar, You would want something like this to keep it in sequence: progBar.addEventListener(ProgressEvent.PROGRESS, progressHandler); and, in your progressHanler function, set its length and height to that of the progress bar. Cordially, Kerry Thompson On Mon, Jun 11, 2012 at 1:08 PM, Ted Lehr wrote: > So I have a Loader that is loading an image: > > var Img:Loader = new Loader(); > var urlReq:URLRequest = new URLRequest("http://www.someurl.com";); > > img.load(urlReq); > > > and I am trying: > > img.addEventListener(MouseEvent.ROLL_OVER,x); > > > > this does not seem to work - does that make sense? and if so, how can I get a > mouse event on the loader - do I need to load it in another mc? > > > Thanks! > > ___ > 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 ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Loader Mouse Event
I've never tried to get a mouse event on a loader. Do you have a progress bar? I would add a MouseEvent listener to the progress bar, not the loader itself. If that doesn't work, add a movie clip with a 0 alpha on top of the loader, and attach the mouse listener to that. You could use a standard Flash shape like a rectangle, and lengthen it in sequence with the progress bar, You would want something like this to keep it in sequence: progBar.addEventListener(ProgressEvent.PROGRESS, progressHandler); and, in your progressHanler function, set its length and height to that of the progress bar. Cordially, Kerry Thompson On Mon, Jun 11, 2012 at 1:08 PM, Ted Lehr wrote: > So I have a Loader that is loading an image: > > var Img:Loader = new Loader(); > var urlReq:URLRequest = new URLRequest("http://www.someurl.com";); > > img.load(urlReq); > > > and I am trying: > > img.addEventListener(MouseEvent.ROLL_OVER,x); > > > > this does not seem to work - does that make sense? and if so, how can I get a > mouse event on the loader - do I need to load it in another mc? > > > Thanks! > > ___ > 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