Jump to content

Passing the variables fails me completely ! desperately need help!


Recommended Posts

Hi guys and let me say this that i desperately need help on this seemingly no problem at all !!


Ya so I am back again with another head swirler, at least for me. Needless to say I have been trying to figure it out for 2 days now and I was sure I cud do it without help but guess it was I was totally wrong & this is proving to be a most sly problem, one that refused to budge. 


So i have a Flash layer called TIMER where I have the code to display the timer and this layer also processes the time code where it uses variables like myMinute and mySeconds to hold minutes and seconds. It uses these two to store the time and then uses these to find the time elased till a BUTTON is pressed. 


This BUTTON triggers the handler (onPress()) which has a function say send_values() to create a set of values to send to the php. The function send_values() is described / written in the Actions Layer. Inside this layer, the two variables mySeconds and myMinutes are used to send the time to php using a variable lv1.time_in_seconds = myMinites*60+mySeconds; like this lv1.send(path+"data.php", "_blank", POST" ).



======= DEFINED IN FLASH========
var mysec:Number=mySeconds;            // 20
var mymin:Number=myMinute;               // 2
var vTimNsec=mymin*60+mysec;           // 140
========= SENT TO PHP ===========
lv1.v_time_in_seconds = mysec;
lv1.v_sums_correct = mymin;
lv1.v_delay_digit_ms = vTimNsec;


If I run this in the Flash (2.0) IDE and trace the values (DEFINED IN FLASH) OR display the values in a dynamic text box, I am shown the correct values. 


Then I send these values to PHP thru the array lv1 using the command lv1.send(path+"data.php", "_blank", POST" );

Now if i run this from a localhost with the flash embedded in the HTML file I get values 


vis_sum_corr = undefined         // This is mymin
vis_sum_tme = undefined         // This is mysec
vis_dig_dely = NaN                 // This is (mymin*60+mysec)


Ok another thing that I did was that i checked the values of the variables in Flash with isNaN function and it gave me FALSE !!

So the values displayed in Flash are displayed absolutely correct and the moment I send them to PHP they are changed to undefined and NaN. Has me totally zapped. 


Ok another thing that i checked. If i replace the variable values by numeric constants as below,

======= DEFINED IN FLASH========
var mysec:Number=    20;
var mymin:Number=      2;             
var vTimNsec=          140;          
and send these to PHP, IT DISPLAYS THE CORRECT VALUES !!!!!!!!!!

Can someone please guide me what is going on here and what could be going wrong.  I have gone nuts trying. Desperately need some gurus to sort this out. Please help !!!


Thanks all.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.