dcsimg
A Flash Developer Resource Site

Results 1 to 15 of 15

Thread: passing a variable in flash to another flash file

  1. #1
    Junior Member
    Join Date
    Jun 2004
    Posts
    12

    passing a variable in flash to another flash file

    Hello,
    I am very new to flash and would like to know how to pass a variable in one flash file to another flash file. The variable cannot have a hardcoded name. It must be a variable that will call for any file within the flash file it needs to be directed to.

    Please help. Thank you in advance.

  2. #2
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    You can pass vars i many ways. It will depend however if they are on separate html pages or loaded into eachother.

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  3. #3
    Junior Member
    Join Date
    Jun 2004
    Posts
    12

    passing a variable in flash to another flash file

    Thank you Pellepiano.

    Let me give a more clearer explaination.

    1. I have an asp file that includes the redirect script to a blank flash file.

    2. The blank flash file is redirected to the intro.swf file.

    3. Once the intro.swf file is visible, I need to have a way for our customers to select any .swf WBT Course that will be links on the intro.swf file.

    So the variable cannot be hardcoded because need to be able to select any Online course they would like to take.

  4. #4
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    Its important to know if you change html, load swf into another to know what method of passing variables.

    Does not the asp output the proper variables and values...? And then you use them in the button or text actions?

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  5. #5
    Junior Member
    Join Date
    Jun 2004
    Posts
    12

    passing a variable in flash to another flash file

    I'm not quite sure I understand the question. Below is the script that will go into the .asp file that will call for the blank flash file which is called: wrapper.swf.

    Wrapper.swf needs to call for the intro.swf.
    Once the intro.swf is called, it then needs to call for the actual flash file with the WBT Course links on it.

    OBJECT classid="clsid27CDB6E-AE6D-11cf-96B8-444553540000" '
    +'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" '
    +'WIDTH=750 HEIGHT=500

    PARAM NAME=movie VALUE="wrapper.swf'+document.location.search+'"
    +'PARAM NAME=quality VALUE=high>'
    +'EMBED src="wrapper.swf' +document.location.search+'" '
    +'quality=high WIDTH=750 HEIGHT=500 '
    +'TYPE="application/x-shockwave-flash"



    Thank you
    Last edited by haegrrl; 06-08-2004 at 03:02 PM.

  6. #6
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    I can not see the code. You should put it between [code ] tags or php tags. I can only see that you are including variables in the embed code for the swf to read.

    You can "call" swf 's in different ways. Are you having all swf files on separate html pages? In that case there will be a diferent method to pass variables between swf files than if you use for instance loadMovi to load a swf into another one?

    Or are you just wondering how the action will look that loads another swf dynamically?

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  7. #7
    Junior Member
    Join Date
    Jun 2004
    Posts
    12
    I placed the html in a text file. New to the forum and don't quite know how to do the PHP tags just yet.

    The html page calls for flash file number 1 (which is wrapper.swf).
    This file in return calls for intro.swf, which is flash file number 2.

    intro.swf flash file number 2 will call for flash file number 3 which will have the different links to the different WBT courses which are all separate .swf files.

    So I need to know how to set up the .swf files on flash file number 2 to redirect to flash file number 3. Then I would like to know how to have flash file number 3 call for any of the WBT course links the customer wants.

    So I think variables are needed for flash number 2 and 3 correct?

    I am so sorry I am not explaining this correctly for you. Does this one make sense?
    Attached Files Attached Files
    Last edited by haegrrl; 06-08-2004 at 03:58 PM.

  8. #8
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    I see that the wrapper swf is embedded in java script that transfers variables from the url string into Flash.

    But as I have no idea what kind of variables you are passing ( urls to the courses that are separate swf files linked from file 3? ).

    Lets see, you want variables transferred from file 1 to file 3 where they will be used as links?

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  9. #9
    Junior Member
    Join Date
    Jun 2004
    Posts
    12

    passing a variable in flash to another flash file

    My co-workers have decided to set up the WBT Course directory structures differently. I think this may be easier.

    The html page I sent calls for the wrapper.swf. I need to set up the wrapper.swf or wrapper.html (I don't know which one needs the variable) file to call different WBT Courses that are in different directories.

    Does that make sense?

  10. #10
    Junior Member
    Join Date
    Jun 2004
    Posts
    12

    passing a variable in flash to another flash file

    I forgot to mention that the wrapper.swf is at the root directory of the WBT directory then it needs to call for courses that are in each Course directory depending on what the link the customer clicks on from an .html page.

  11. #11
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    The html page with links should hav a variable appended to it with the full url to the correct course.

    PHP Code:
    <a href="www.mySite.com?course_url_12=someFolder/theCourse.html&course_name_12=PotteryCourse" 
    This is recieved by the Flash and on a button in Flash you could have...

    on(release){
    getURL(course_url_12);
    }

    ..and it will get the correct html.
    Last edited by pellepiano; 06-08-2004 at 05:18 PM.

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  12. #12
    Junior Member
    Join Date
    Jun 2004
    Posts
    12

    passing a variable in flash to another flash file

    Okay, I do have a button on the .swf file but the .swf is an object so I can't upgroup it. Do you know how to ungroup an .swf file?

    Thanx

  13. #13
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    swf files can not be grouped or ungrouped.
    You also can not have a button ON a swf file. Only in it.

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

  14. #14
    Junior Member
    Join Date
    Jun 2004
    Posts
    12

    passing a variable in flash to another flash file

    Your are correct regarding the button not on but in. Sorry for the incorrect lingo.

    Okay, let me get his straight. Since I cannot ungroup a .swf file, do I need to edit the .fla file instead? If so, how do I set up this button in the .fla to call for different variables? The variables will change depending on the course link the customer has selected?

    Also, is there something more I need to include in the .asp file that will direct you to the intro.swf for these variables? I only have what was sent to you in the zip file.
    If so can you please send me a code example? I only know how to set up the .asp file to call for a certain variable.

    Thank you so much Pellepiano. I have learned so much from just this thread.

  15. #15
    Senior Member pellepiano's Avatar
    Join Date
    Feb 2000
    Location
    Stockholm, Sweden
    Posts
    15,151
    Its only the .fla files that can be edited ( unless you are a hacker =) ).

    You must know the names of the variables that are coming in, as you wont be able to target them otherwise.

    -Pelle Piano
    // Image Gallery
    www.studiobild.com
    // Photo Blog
    http://talesofthepixel.blogspot.com

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