OT - Actionscript difference when debugging
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Macromedia Flash Server > OT - Actionscript difference when debugging




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    OT - Actionscript difference when debugging  
Johnny Zen


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-03-05 01:45 AM

Hi all

I've come across a strange problem.

This code:

var cl_id =3D so.data.order[i];

var somevar =3D somefunction(cl_id)


function somefunction(id) {

returns answer(id)

}

When I run the code, the function returns undefined, but if I flag the
function in debugger, it works?

Any ideas?


Johnny

=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm






[ Post a follow-up to this message ]



    Re: OT - Actionscript difference when debugging  
John Grden


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-03-05 01:45 AM

I'm not sure what you're trying to do (what is answer? is it a method?).
Have you tried function.apply?

var answer:Array =3D new Array("john", "sally", "frank");
function somefunction(id)
{
return answer[id];
}

var somevar =3D function() { return somefunction.apply(this, arguments)
; }

trace(somevar(0));

Just a stab in the dark, but this code works.

Hth,

On 11/2/05, Johnny Zen <johnnyzen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> Hi all
>
> I've come across a strange problem.
>
> This code:
>
> var cl_id =3D so.data.order[i];
>
> var somevar =3D somefunction(cl_id)
>
>
> function somefunction(id) {
>
> returns answer(id)
>
> }
>
> When I run the code, the function returns undefined, but if I flag the
> function in debugger, it works?
>
> Any ideas?
>
>
> Johnny
>
> -----------------------------------------------------------
> Supported by Fig Leaf Software - http://www.figleaf.com
> -----------------------------------------------------------
>
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcomm
>



--
John Grden - Blitz

=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm






[ Post a follow-up to this message ]



    RE: OT - Actionscript difference when debugging  
Gerald (Woody) Chastain


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-03-05 10:45 PM

Do you have a missing semi-colon?

-----Original Message-----
From: flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.org
[mailto:flashcomm-bounces-1Ss2GqJETD3yZ38Mhd3e/9ZfFG6BLHNm@public.gmane.
org] On Behalf Of Johnny Zen
Sent: Wednesday, November 02, 2005 6:38 PM
To: FlashComm Mailing List
Subject: [FlashComm] OT - Actionscript difference when debugging

Hi all

I've come across a strange problem.

This code:

var cl_id = so.data.order[i];

var somevar = somefunction(cl_id)


function somefunction(id) {

returns answer(id)

}

When I run the code, the function returns undefined, but if I flag the
function in debugger, it works?

Any ideas?


Johnny

=---------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=---------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm


=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm






[ Post a follow-up to this message ]



    Re: OT - Actionscript difference when debugging  
Johnny Zen


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-03-05 10:45 PM

Resolved this problem.

The problem was due to onSync refreshing before function was executing.

so all fixed now 

Thanks for the help

=-----------------------------------------------------------
Supported by Fig Leaf Software - http://www.figleaf.com
=-----------------------------------------------------------

To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcomm






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 02:52 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register