A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: file.swf?variable=xyz || can this be done in FL1.1?

  1. #1
    Member
    Join Date
    Jan 2003
    Location
    Tokyo
    Posts
    78

    file.swf?variable=xyz || can this be done in FL1.1?

    Hi kids...
    um, passing a variable to Flash Lite? I get the feeling it can't be done as a Query String when accessing the SWF. I built something in FL and viewed it on the PC and it worked, but realised that the player is ver.9, not FL 1.1 like on the target phone/s (Japanese NTT Docomo /Softbank / KDDI:AU whatevers).

    The main reason is because I want to send the PHP Session ID to the flash, so the flash knows whose logged in from previous html/imode pages, so they can save scores etc without having to re-login

    Even if someone can just tell me "NO!", I'll at least be able to sleep at night.

    Thanks!

  2. #2
    Registered User
    Join Date
    Apr 2001
    Location
    Akron OH, USA
    Posts
    4,841
    it might work, have you tried it. This is a feature of Flash in web browser, so it might work. You might try a simple app that prints a variable in a text box, and simply create a url including the variable name and a value appended as the query string for the swf's url and load this into the browser.

    So in the browser you type:
    http://domain/my.swf?somevar=somevalue

    Also the browser may be sending session id for you. session id is a cookie, sent from browser, so the browser may just send the cookie to server for each transaction regardless of Flash or html page.

    PC based browsers will merge session id into any HTTP name/value pairs sent from Flash. You do not need to manually include the session id in the data that Flash sends. You might test your FL application in the browser to see if the browser adds the session id into the HTTP name/values sent from Flash.

  3. #3
    Member
    Join Date
    Jan 2003
    Location
    Tokyo
    Posts
    78
    hp3! so quick! so fine!
    I have given it a go on a 904 (some new Japanese phone), and tried the web style ...com/file.swf?foo=bar format with no luck, it worked fine on the PC browser, but not on the mobile's browser... I was also hoping that there might be some sort of Flash Vars type thing happening, but I can't seem to find any reference to it.

    (;_

    Mmmm.... Thanks! I'll keep pushing!

  4. #4
    Member
    Join Date
    Jan 2003
    Location
    Tokyo
    Posts
    78

    couldn't do it.. atleast, I couldn't.

    It looks like it can't be done. What we ended up doing was making a container swf, which would read in the main swf file and a text file.

    for every user session, we used PHP to create a new folder which copied the container SWF and generated a text file. The text file contained the user's session id. the user would end up downloading the container from their special folder, which would read the custom text file (giving the sessionID), and then read in the main SWF.

    Messy? Yeah... oh well...

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