A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: send one php variable to flash5

  1. #1
    Senior Member
    Join Date
    May 2001
    Posts
    225

    send one php variable to flash5

    i used to know flash reasonably well but then got sidetracked by php/SQL, and now i'm trying to get them to play together. unfortunately i am still on flash5, but i need some advice please...

    using php to generate a url like this:
    whatever.php?page=1

    i then use _GET to capture page=1 in my php

    i then put an .swf in the same php page and use <embed src="delete.swf<?php echo ("?page_id=$page_id"); ?>" ...etc to append the variable to flash. then in flash if i put a dynamic text field with the variable name 'page_id' it will correctly display as '1'

    however, despite the variable being recognised in the dynamic text field, i cannot seem to use it in actionscript. any ideas?

    thanks in advance and i apologise if this is really simple only i cannot find anyone doing it this way.
    [swf width="300" height="40" background="#ffffff"]http://www.julian.livsey.btinternet.co.uk/banner4flashkit.swf[/swf]

  2. #2
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    What is the script you are trying to use it?

    Try declaring it as a number.

    Number(page_id)

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  3. #3
    Senior Member
    Join Date
    Jul 2004
    Posts
    107
    eh..

    Looking at your example, I'd write;
    <embed src="delete.swf?page_id=<?php echo $page_id; ?>" ...etc>

    Then I'd use "page_id" inside of the movie clip. Not 100% sure that would work. (I'm new to flash!)

    Alternatively, you can use loadVariablesNum (works in flash 4+)

  4. #4
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    RaidenMagmus

    The problem is not to get the variable inside Flash but for Flash to use the variable. It does not seem to recognize the value as a number.

    julianthomas

    Ive had some troubles with something like this before ( using textfiles ) and one solution was to terminate the last variable with a & character at the end.

    Worth a try.

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

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