dcsimg
A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: Url Encoded(Query Strings) whatever you call them..

  1. #1
    Senior Member
    Join Date
    Aug 2008
    Posts
    137

    Question Url Encoded(Query Strings) whatever you call them..

    hey FK!

    question, i am trying to figure out how to do this or explain it for that matter.

    http://www.mysite.com/myVDS.html?item=1911 (this is the link to my as3 app)

    i want to bring in the item and its value to flash. and just simply trace it or display it in a textbox. (for the time being.)

    I have tried external interface, swfobject 2.0 and a bunch of other methods to accomplish this. the thing is i am trying to make this dynamic so that no matter the value of item , it can be displayed.

    can anyone help me?? any source snippet that can help me to accomplish this?
    NO *****ASSNESS AROUND ME!!!!

  2. #2
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    If you have access to php or other server side scripting, the easiest way would be to put the query string on the swf url as well. Then you could get it with loaderInfo.parameters.

    If you don't have access to server side scripting, you may be able to slice the queryString part of the page url out with javascript and combine that with SWFObject to do the same thing.

  3. #3
    Senior Member
    Join Date
    Aug 2008
    Posts
    137
    5tonsOfFlax, thanks for the response. I have access to the php which is how i got the ?item=12345 added to the link for the swf. now i am off to find info on how to properly set up loaderInfo.parameters.
    NO *****ASSNESS AROUND ME!!!!

  4. #4
    Senior Member
    Join Date
    Aug 2008
    Posts
    137
    if the id value always changes how will loaderInfo help me?
    NO *****ASSNESS AROUND ME!!!!

  5. #5
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    You should set it up so that the parameters passed to the swf url match those passed to the page. Then no matter what is passed to the page, the swf will also have that value.

  6. #6
    Senior Member
    Join Date
    Aug 2008
    Posts
    137
    k so, that only worked when i manually entered this in the html.
    Code:
    'flashvars', 'item_id=9232'
    is there a way that i can put a variable in the item_id value? like a <php echo something?>
    Last edited by maximillion; 10-23-2008 at 02:41 PM.
    NO *****ASSNESS AROUND ME!!!!

  7. #7
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    ... yes? That's what I've been trying to tell you to do all along. I do not know php, so I can't tell you the exact syntax. I CAN tell you that I know it's possible to get all the GET parameters passed to the page, and do stuff with them. Stuff like echo them out somewhere on the page.

    Also, you don't technically need flashvars to get it into flash, but that is the better way so good job there.

  8. #8
    Senior Member
    Join Date
    Aug 2008
    Posts
    137
    thanks 5tonsOfFlax, i wish i knew php too to figure this one out. i thought that since the variable was in the html for the swf that i would have to declare the variable there to replace the item_id value with?? ok i wonder where i can find a php person to help with this section?
    NO *****ASSNESS AROUND ME!!!!

  9. #9
    Senior Member
    Join Date
    Aug 2008
    Posts
    137
    after a little while...

    can i put the swf on a php page?

    cause then i could use the global variable in my app?? is my thinking right?
    NO *****ASSNESS AROUND ME!!!!

  10. #10
    Will moderate for beer
    Join Date
    Apr 2007
    Location
    Austin, TX
    Posts
    6,801
    You said it was already on a php page. I'm really confused by your confusion.

    Since I don't know php, this is pseudocode. Show it to someone that does know php and ask them how to do it:
    PHP Code:
    swfObject.addParam('flashvars''<%for all param in GET_PARAMS{  echo param.name + "=" + param.value +'&'} %>'); 

  11. #11
    Senior Member
    Join Date
    Aug 2008
    Posts
    137
    LOL w/5tons... naw i never said that. i said the info i was bring to flash was on a php page. thanks for the snippet. i am gonna see who i know that knows PHP. you have been a great help tho...
    NO *****ASSNESS AROUND ME!!!!

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