NumberEvent.getNumber() always returns undefined

View: New views
4 Messages — Rating Filter:   Alert me  

NumberEvent.getNumber() always returns undefined

by Marcelo de Moraes Serpa :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Helo,

Has anybody ever had issues with the getNumber() method of the NumberEvent class? Mine always returns "undefined" even though the _n private var has the actual value I entered in when I dispatched the event. This is very weird.

PixLib rev. 44, mtasc 1.13 and FDT 1.5 (Flash 8 for the asset's FLA).

Thanks in advance,

Marcelo.

_______________________________________________
Pixlib mailing list
Pixlib@...
http://osflash.org/mailman/listinfo/pixlib_osflash.org

Re: NumberEvent.getNumber() always returns undefined

by Xavier MARTIN-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Used the NumberEvent already with no pb
Can we see your code???
++

On Jan 17, 2008 10:49 AM, Marcelo de Moraes Serpa <celoserpa@...> wrote:
Helo,

Has anybody ever had issues with the getNumber() method of the NumberEvent class? Mine always returns "undefined" even though the _n private var has the actual value I entered in when I dispatched the event. This is very weird.

PixLib rev. 44, mtasc 1.13 and FDT 1.5 (Flash 8 for the asset's FLA).

Thanks in advance,

Marcelo.

_______________________________________________
Pixlib mailing list
Pixlib@...
http://osflash.org/mailman/listinfo/pixlib_osflash.org




--
----------------------------------------------------------------------
Xavier MARTIN aka zeflasher or xxlm
Visit my website if you love flash:
http://www.webbymx.net
http://dev.webbymx.net
----------------------------------------------------------------------
_______________________________________________
Pixlib mailing list
Pixlib@...
http://osflash.org/mailman/listinfo/pixlib_osflash.org

Re: NumberEvent.getNumber() always returns undefined

by Pedro Taranto :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Marcelo, are you passing any number to your event constructor???

var n : Number = 10;
_oEB.broadcastEvent(new NumberEvent("onNumberEvent", n));

----------------------------------

probably you should cast your event inside the listener function or set
type the event parameter you are receiving by the listener

function onNumberEvent ( e : Event ) {
    trace(NumberEvent(e).getNumber);
}

or

function onNumberEvent ( e: NumberEvent ) {
    trace(e.getNumber());
}


--
Pedro Taranto


_______________________________________________
Pixlib mailing list
Pixlib@...
http://osflash.org/mailman/listinfo/pixlib_osflash.org

Re: NumberEvent.getNumber() always returns undefined

by Marcelo de Moraes Serpa :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hey folks, thank you for the replies.

Weird, I still can't get the data via the getNumber() getter method. The solution was to make the _n attribute public. I will try to isolate the problem and keep you informed.

Regards,

Marcelo.

On Jan 16, 2008 8:29 PM, Pedro Taranto <ptaranto@...> wrote:
Marcelo, are you passing any number to your event constructor???

var n : Number = 10;
_oEB.broadcastEvent(new NumberEvent("onNumberEvent", n));

----------------------------------

probably you should cast your event inside the listener function or set
type the event parameter you are receiving by the listener

function onNumberEvent ( e : Event ) {
   trace(NumberEvent(e).getNumber);
}

or

function onNumberEvent ( e: NumberEvent ) {
   trace(e.getNumber());
}


--
Pedro Taranto


_______________________________________________
Pixlib mailing list
Pixlib@...
http://osflash.org/mailman/listinfo/pixlib_osflash.org


_______________________________________________
Pixlib mailing list
Pixlib@...
http://osflash.org/mailman/listinfo/pixlib_osflash.org