A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: sending variable "mypage.php?var_id=var" FROM PHP TO FLASH

  1. #1
    Junior Member
    Join Date
    Sep 2007
    Posts
    2

    sending variable "mypage.php?var_id=var" FROM PHP TO FLASH

    I am capable of getting data displayed from my database using php. The variables though travel from FLASH to PHP then back to FLASH using loadvars as follows:

    loadVariablesNum ("log_id.php?name_id="+name_id+"&R="+random(999 ), "0");

    However, what I need to have is sending "VARIABLE" data to flash directly from php. So the direction would be PHP to FLASH then to PHP. So that the variable from the php like http://localhost/mysite/log_id.php?name_id=1000 so that the variable name_id=1000 will be received by FLASH and process it accordingly. HOW CAN I DO IT?

  2. #2
    Flashmatics silentweed's Avatar
    Join Date
    Mar 2005
    Location
    London, UK
    Posts
    4,876
    use http://blog.deconcept.com/swfobject/ for passing in values to flash from the url.. and in fact you should use this object for embedding your flash movie anyway..
    Flashmatics | Flashmatics Library (free downloads)
    -----------------------------------------------------
    Latest Projects:
    The Dead Room | Are You Smarter | Prison Break (Frame A Friend) | Beck's Fusions | The 24 Experience

    -----------------------------------------------------
    Flash Certified Developer

  3. #3
    Official FK nice guy and MOD 3PRIMATES's Avatar
    Join Date
    Apr 2002
    Location
    Portland Oregon
    Posts
    1,645
    Here there.
    If you must use loadVariables, use loadVariables NOT loadVariablesNum.

    Like silentweed has said, its best to use SWFOBJECT for passing varialbes, but if you are passing the variables to PHP it can be done with with the loadVars OBJECT or the loadVariables (Not the same thing)

    The oldSchool way would be:

    myvar1 = 'some data';
    myvar2 = 'someOtherData';
    loadVariables ("log_id.php", "_self', "POST");

    Or a simplier way:

    myLoadVars .sendAndLoad('log_id.php', 'myTarget' ,'POST')

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center