TwelvestoneFlash

Passing variables thru URL


Sign in

  • Waiting for Godot ( 730 k posts )
    Just conversation.
  • Thunder Dome ( 23 k posts )
    Photoshop Tennis and Collabs.
  • Photography ( 5.1 k posts )
    For all you shutterbugs, sh...
  • Flash ( 18 k posts )
    ActionScripting to tweens, ...
  • Front End ( 5.9 k posts )
    general front end design an...
  • Back End ( 9.7 k posts )
    serverside scripting, progr...
  • Projects and Theory ( 12 k posts )
    This forum is for discussio...
  • FAQ ( 269 posts )
    All those nagging questions...
  • Design ( 17 k posts )
    graphics & all aspects of g...
  • Purgatory ( 3.6 k posts )
    12stone Jail, feel free to ...
The General
 
2011-08-17

So i have a function which works like this:

blabla.swf?directlink=blabla

My problem is that people see this link:

index.php

blabla.swf is in a subfolder

**So what i want to do is something like this:

index.php?directlink=blabla Well at least something where i can put it into the main URL.

**

Is this possible? Does it work with flashvars or query string or something?

DontBogartMe
 
2011-08-17

yeah, the PHP in your index.php script can read that "directlink" GET param, and then write it into the flashvars bit where it loads in the Flash blabla.swf.

You did something similar to make blabla turn straight to a page I think.

The General
 
2011-08-17

Originally posted by: DontBogartMe

You did something similar to make blabla turn straight to a page I think.

Well that's the thing right there.

I just copy blabla.swf in the root and it works like blabla.swf?directlink=blabla That's all fine but not when people have lightboxes and stuff like that in it, then it needs the javascript.

Wanted to find a solution for it.

The General
 
2011-08-17

Solved it. Was fairly easy with PHP

flashvars.directlink = "<?=$_GET["directlink"]?>";

Or even better with javascript so it also works in plain html:

if (swfobject.getQueryParamValue("directlink")) { flashvars.directlink = swfobject.getQueryParamValue("directlink");

}

baron ruhstoff
 
2011-08-19

You probably already know this, but SWFAddress works great for deep-linking in Flash.

Sorry, you must be a member to post to a conversation. Either log in or sign up to get involved.
TwelvestoneFlash

Passing variables thru URL