A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: setting levels as variables

  1. #1
    Member
    Join Date
    Apr 2000
    Posts
    45
    I am working on a website that is loading multiple external swf files into the base movie. I would like to keep all of my menus and controls on one level. My question is, can you direct levels with variables like you can with movieclips. I have set up actions that seta a variable "/:mc" equal to the instance name of the current movieclip and then use SetProperty and telltarget depending on what the user whats to do. Using the same framework, SetVariable "currentlevel" ="_levelX" and then TellTarget(currentlevel), but nothing happens. Any solutions?

  2. #2
    You should copy and paste your code for an accurate solution. For now lets assume you set a variable in a frame or a button action like this
    Code:
    Set Variable: "myLevel" = 2
    Now you can use this to target some thing on that level i.e
    Code:
    Begin Tell Target ("_level"&myLevel)
          Go to and Play (1)
    End Tell Target
    Hope it helps.
    Regards,
    [Edited by MuhammadZamir on 05-29-2001 at 12:32 PM]

  3. #3
    Member
    Join Date
    Apr 2000
    Posts
    45
    On the first frame of the swf loaded into level3 I have
    SetVariable "number"="3" both being strings


    On the button in level0, I have:
    On(Release)
    Begin TellTarget ("_level"&number) as an expression
    Goto Stop ("hold")
    End TellTarget
    EndOn

    The only difference in what I have and what you suggest is possibly the value of the variable in the loaded swf. It should be a string, correct?

  4. #4
    for the first bit do this...
    Code:
    Set Variable: "_level0/:number" = 3
    and for the second do this...
    Code:
    Begin Tell Target ("_level"&/:number)
          Go to and Stop("hold")
    End Tell Target
    and yes, it should be an expression.

  5. #5
    Member
    Join Date
    Apr 2000
    Posts
    45
    Muhammad,

    Thanks for the help. Worked like a charm. I ma just glad that there are still people that are working and helping out for Flash 4 people

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