Flash 8 passing vars
Results 1 to 6 of 6

Thread: Flash 8 passing vars

  1. #1
    Senior Member
    Join Date
    Jul 2003
    Posts
    166

    Flash 8 passing vars

    Hello,
    First I want to say that I am not a flash/action script expert and my question could be stupid, but I cannot launch my site without solve this problem.
    I have a flash movie that loads external swf in the window component using the function:

    var my_win:MovieClip = mx.managers.PopUpManager.createPopUp(_root, Window, false, {title:caption, contentPath:contentpath, closeButton:true});

    All is working well, but now I have a problem - I need to pass variables to the external movie (contentPath is the path to the swf). I googled fot the answer and I found this:

    example.swf?var=alabala&var2=sometext

    but this works only when I use it in HTML page. I found the documentation for FlashVar, but it works only in HTML page.

    Can anyone help me with some solution, code, docs ...

    Best regards!
    BGDevS
    [gloworange]www.peaksoft.info [/gloworange]

  2. #2
    Not sure if it'll work in the Popup Manager, but I tested it using "loadMovie()"

    In the "child" movie i.e the popup, you should just be able to go ->

    _parent.myVariableName

    I've attached 2 .fla files which show it working through trace() in a movie loaded into the main movie. The same sort of thing should work in a popup I'm guessing.

    Cheers,
    Niggle
    Attached Files Attached Files

  3. #3
    Senior Member
    Join Date
    Jul 2003
    Posts
    166

    Unhappy

    Yep, I do it
    _global.var1;
    _global.var2;

    Ye, ye, I know - Sometimes the big problem have very simple solution

    10x to niggles

    Edit: Now I have another problem
    The content of some movieclips is larger than the windows and I need to dynamically attach scrollbar to the window, but I only found how to attach scroll bar to text field.

    Best regards!
    Last edited by Barov4e; March 6th, 2007 at 09:10 AM. Reason: Forgot something :)
    BGDevS
    [gloworange]www.peaksoft.info [/gloworange]

  4. #4
    Senior Member
    Join Date
    Jul 2003
    Posts
    166
    Hello,
    I have a problem ... again. I am opening the main swf in an ASP .NET page, but the child movies wont open. Everything is working well in flash only, but when I do it through my page. I changed the paths from absolute to relative, but it didn't work
    BGDevS
    [gloworange]www.peaksoft.info [/gloworange]

  5. #5
    Flash takes it's path from the HTML/ASP page it's embedded in - which can cause issues once on an actual server as opposed to a folder on your hard drive.

    Not sure why the absolute links don't work - they should. Try using a full URL including the http:// and see if that fixes it.

    What I do is set a variable for the path so I can test it locally and on the server-

    pathToFiles = "/some-file-path/";

    getURL(pathToFiles + "myMovie.swf");

    -----

    When testing on your hard-drive, set pathToFile = ""; so it doesn't append anything, when testing on the actual server, put in the whole address.

    Hope this helps.

    Cheers,
    Nigel

  6. #6
    Senior Member
    Join Date
    Jul 2003
    Posts
    166
    Ok, I did it, but it's not working well. In the main movie I have declared some _global variables, but the movie that I am loading is not able to read them. But when I start it from Flash (Test movie) it's working ?!
    BGDevS
    [gloworange]www.peaksoft.info [/gloworange]

Similar Threads

  1. Turns .Net to Flash
    By SDK in forum General Programming Questions
    Replies: 0
    Last Post: March 30th, 2005, 11:19 PM
  2. flash for website !!!!!!!!!!!!!!
    By thuongtamnhan in forum AntiOnline's General Chit Chat
    Replies: 3
    Last Post: November 1st, 2003, 02:45 PM
  3. Make your own MP3 player (flash)
    By black_death in forum Other Tutorials Forum
    Replies: 0
    Last Post: September 28th, 2002, 11:57 AM
  4. FLASH HACKING And the real world:
    By black_death in forum The Security Tutorials Forum
    Replies: 0
    Last Post: September 17th, 2002, 12:40 PM
  5. Flash Tutorial: The Basics
    By morfius in forum Other Tutorials Forum
    Replies: 8
    Last Post: June 7th, 2002, 01:48 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
  •