A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: URL variables

  1. #1
    Member
    Join Date
    May 2004
    Posts
    47

    URL variables

    I want to load a movieclip into a movieclip the file is retrived from a URL variable

    eg.

    page.php?url=foo.swf

    and have this in my web document:
    <PARAM NAME=movie VALUE="index.swf?pg=<?php echo $_REQUEST["url"];?>">

    and in Flash

    loadMovie(pg)

    But I want to have a test where I test if pg is empty or not

    eg. something like:

    /*
    If not pg load default page
    /*
    if (!pg) {
    //Load default page(eg. default.swf)
    }
    else {
    //Load pg)
    }

    But I just can't get things to work, can anyone help

    regards T

  2. #2
    Re Member websam's Avatar
    Join Date
    Jul 2000
    Location
    Australia (VIC)
    Posts
    660
    One easy way to find out if the parameter is loaded into flash or not:

    put one dynamic textbox on your stage and name the "var" property of the textbox (not "instance name" of your textbox) to the name of your parameter's name. In your case "pg".

    Everytime you load your flash, the text box shall display the pg parameter. If not... soemthing wrong with your HTML code.

    If it displays the URL you want:

    if (pg.length<1) {
    //Load default page(eg. default.swf)
    }
    else {
    //Load pg)
    }
    Last edited by websam; 08-29-2004 at 11:51 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