A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: Hyperlink set XY position

  1. #1
    Junior Member
    Join Date
    Dec 2006
    Posts
    28
    ..
    Last edited by CarlT2007; 02-02-2007 at 09:13 PM.

  2. #2
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    hi,

    All you have to do is grab use the variables that are present in the url. For example:
    code:

    my_mc._x = x;
    my_mc._y = y;


    And don't forget that those parameters in the url have to be a query string, of variable value / name pairs.
    Something like:
    Code:
    http://www.mydomain.com/flash.swf?x=100&y=200
    Attached Files Attached Files

  3. #3
    Junior Member
    Join Date
    Dec 2006
    Posts
    28
    ..
    Last edited by CarlT2007; 02-02-2007 at 09:13 PM.

  4. #4
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    hi,

    That's exactly the logic explained here, but instead of a variable frame you'll be passing two variables: x and y.

    It doesn't matter if you've got an .html or .php file.
    Last edited by nunomira; 02-02-2007 at 07:24 PM.

  5. #5
    Junior Member
    Join Date
    Dec 2006
    Posts
    28
    ..
    Last edited by CarlT2007; 02-02-2007 at 09:14 PM.

  6. #6
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    Not exactly.

    You are at carltaylor.eu/map.php?x=100&y=200 just like you want.

    The 'correct' way to pass variables into Flash is via FlashVars.

    The wonderful SWFObject allows you to do it very easily, as it can automatically fetch your variables from the url, - like shown on the other post and its links - and pass them into Flash.

  7. #7
    Junior Member
    Join Date
    Dec 2006
    Posts
    28
    So, if i have read it correctly I should enter the following into the html for the swf to work.
    Code:
    <script type="text/javascript">
       var so = new SWFObject("ex.swf", "map", "200", "100", "7", "#336699");
       so.addVariable("x", getQueryParamValue("x"));
       so.addVariable("y", getQueryParamValue("y"));
       so.write("flashcontent");
    </script>
    Thanks for being so patient
    Last edited by nunomira; 02-02-2007 at 07:53 PM. Reason: code tags added

  8. #8
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    Yes. That's it!
    You may adjust the background color and the Flash Player version you're targeting.


    You're welcome.

    If you aren't familiar already with it already, take some time to read the article on SWFObject as it's very useful.
    It does simplify things and solves some 'problems'.

    Added code tags to your post as it makes code more readable.

  9. #9
    Junior Member
    Join Date
    Dec 2006
    Posts
    28
    No luck :-(. Iv'e entered the code into http://www.carltaylor.eu/map.php?x=100&y=200

    But the swf doesn't display and inserts the following"This text is replaced by the Flash movie."
    Any ideas *sorry*

  10. #10
    Registered User nunomira's Avatar
    Join Date
    May 2002
    Location
    portugal
    Posts
    7,003
    The swfobject.js file doesn't exist.
    At least, where it should be, which, according to the code you have, is the same folder as the .php file is.
    Code:
    <script type="text/javascript" src="swfobject.js"></script>
    carltaylor.eu/swfobject.js

  11. #11
    Junior Member
    Join Date
    Dec 2006
    Posts
    28
    ..
    Last edited by CarlT2007; 02-02-2007 at 09:14 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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center