User Tag List

Results 1 to 8 of 8

Thread: HELP!! Transfer Parameters

  1. #1
    No Products Registered

    Join Date
    Jan 2011
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    HELP!! Transfer Parameters

    Hi,

    I created a flash app for a client.

    Now the client needs the following:

    He gives me an URL like http://www.his-site.com/index.php?id1=XXX&m_id2=XXX

    If a user clicks on a button in the app, then parameters have to be transfered. So sometimes it can be http://www.his-site.com/index.php?id1=34453&m_id2=3453 and sometimes http://www.his-site.com/index.php?id1=43772&m_id2=364672 etc. ...

    Is it possible to transfer parameters to swf apps?

    I hope somebody can help me soon. :/

  2. #2
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: HELP!! Transfer Parameters

    Yes, you can either read the parameters in Javascript and have the application call functions on the page to get them (through the Flash Player object), or you can use PHP to pass them in when the application starts through the FlashVars - see the Flash section of the Help documentation in MMF.

  3. #3
    No Products Registered

    Join Date
    Jan 2011
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: HELP!! Transfer Parameters

    Thank you very much!

    php transmit would be perfect!
    Maybe somebody knows more details how I can implement this?

  4. #4
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: HELP!! Transfer Parameters

    How much PHP do you know? To give a basic example from one of my Flash applications, I use this at the top of the file to get the parameters:

    Code:
    <? $passedInStopId = $_GET['stopId']; ?>
    <? $passedInRouteId = $_GET['routeId']; ?>
    And then the object tag looks like this:

    Code:
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
    		id="mbta" width="640" height="256"
    		codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
    		<param name="movie" value="mbta.swf" />
    		<param name="quality" value="high" />
    		<param name="bgcolor" value="#ffffff" />
    		<param name="allowScriptAccess" value="sameDomain" />
    		<param name="FlashVars" value="param1=<? echo($passedInStopId) ?>&param2=<? echo($passedInRouteId) ?>">
    		<embed src="mbta.swf" quality="high" bgcolor="#ffffff"
    			width="640" height="256" name="mbta" align="middle"
    			FlashVars="param1=<? echo($passedInStopId) ?>&param2=<? echo($passedInRouteId) ?>"
    			play="true"
    			loop="false"
    			quality="high"
    			allowScriptAccess="sameDomain"
    			type="application/x-shockwave-flash"
    			pluginspage="http://www.adobe.com/go/getflashplayer">
    		</embed>
    </object>
    You can then get the values of the FlashVars through the Special object - the MMF2 Help shows exactly how.

  5. #5
    No Products Registered

    Join Date
    Jan 2011
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: HELP!! Transfer Parameters

    Thanks for your help!
    To be honest I don't know very much about php.

    So if a user goes to http://site.com/test.php?id1=238&id2=37483

    ... how exactly do I write a complete little php script that gets those ID-contents that I can use with mmf FlashVars?

    Could you help me?

    The FlashVars part I understood. I read the help and everything seems clear to me.

  6. #6
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: HELP!! Transfer Parameters

    You don't need much more than what I posted - if you're just getting the parameters "id1" and "id2" without modification, then just edit your object tag to look like:

    Code:
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
    		id="mbta" width="640" height="256"
    		codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
    		<param name="movie" value="yourflashfile.swf" />
    		<param name="quality" value="high" />
    		<param name="bgcolor" value="#ffffff" />
    		<param name="allowScriptAccess" value="sameDomain" />
    		<param name="FlashVars" value="param1=<? echo($_GET["id1"]) ?>&param2=<? echo($_GET["id2"]) ?>">
    		<embed src="yourflashfile.swf" quality="high" bgcolor="#ffffff"
    			width="640" height="256" name="mbta" align="middle"
    			FlashVars="param1=<? echo($_GET["id1"]) ?>&param2=<? echo($_GET["id2"]) ?>"
    			play="true"
    			loop="false"
    			quality="high"
    			allowScriptAccess="sameDomain"
    			type="application/x-shockwave-flash"
    			pluginspage="http://www.adobe.com/go/getflashplayer">
    		</embed>
    </object>
    Note that you also may have to change the filename of your .html so that it has a .php extension instead.

  7. #7
    No Products Registered

    Join Date
    Jan 2011
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: HELP!! Transfer Parameters

    Cool! I try it now.
    Thank you very much!

  8. #8
    No Products Registered

    Join Date
    Jan 2011
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: HELP!! Transfer Parameters

    Worked! Thanks!!

Similar Threads

  1. Expressions in expression parameters
    By Looki in forum Extension Developers Lobby
    Replies: 3
    Last Post: 15th December 2009, 12:00 PM
  2. Command line parameters
    By DistantJ in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 24th January 2008, 10:49 AM
  3. Bug Demonstration: Lua Plus can't do parameters
    By Code6 in forum File Archive
    Replies: 4
    Last Post: 1st January 2008, 08:34 PM
  4. Cursor Parameters
    By Morthian in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 4th January 2007, 07:01 PM

Posting Permissions

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