dcsimg
A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Variables

  1. #1
    Junior Member
    Join Date
    Apr 2000
    Posts
    12

    Question

    Can anyone point me to a very good tutorial on using variables?
    Want I want to know is how to tell a movie clip to end when another movie clip is triggered.
    For instance, the viewer clicks on home button, homemovie is playing, viewer clicks on contact us button, home movie is still playing and contact us movie is playing as well.
    I know how to do this with tell targets ,but i know there is a faster way using variables.
    Any help would be wonderful. Thanks

  2. #2
    Senior Member
    Join Date
    Mar 2000
    Posts
    597

    Post

    Use "tell target". It's by far the easiest method.

    Let me know if there is some reason why you need to use a variable and I'll try to help.

    Hope this helps,

    Rich


  3. #3
    Junior Member
    Join Date
    Apr 2000
    Posts
    12

    Post

    I am using tell target now, the reason I want to use variables is because I have to put in a tell target for everysingle button
    in other words,
    I start with a tell target (movie1)
    I have to put end a command to end all the other movies as well ,oterwise the movie will just play on top of each other
    therefore for each movie i want to start i also have to put in a tell target , telling it to end all of the other movies.
    since this is a menu with 7 buttons each being a link to a movie this becomes a long task. any advice?

  4. #4
    Senior Member
    Join Date
    Mar 2000
    Posts
    597

    Post

    A few of ways:

    Put all the tell targets in a frame and "call" it. This will stop all the movies with one reused piece of code.

    Or you could use a Loop around a tell target

    eg

    Set Variable: "loop" = 1
    Loop While (loop<=7)
    Begin Tell Target ("mymovie"&loop)
    whatever you need...
    End Tell Target
    Set Variable: "loop" = loop+1
    End Loop

    The movies need to be named "mymovie1" "mymovie2" etc.

    Or you could set all the movie names up in pseudo array and loop around as above but have the target as the array element.

    Hope this helps,

    Rich.

  5. #5
    Senior Member Mad-Sci's Avatar
    Join Date
    Mar 2000
    Posts
    2,756

    Post

    Ok here is another one. Each of your buttons will have a variable flag which will have a value of 1. ( when the button is clicked the flag goes up ) in your main time line use
    if flag=1
    telltarget
    play

    end telltarget
    flag=0 ( down )
    end if
    and so on. this is the way of using variables
    Mad-Sci

  6. #6
    Junior Member
    Join Date
    Apr 2000
    Posts
    12

    Post

    thank both of you ,but I guess I just don't kow enough on variables to do either thing you said,but they sound exactly like what I need,So I will study up .If by chance you could be more in depth I would gladly repay you somehow, I do sound loops and custom recordings ,so perhaps I could repay with some music,sound fx etc..
    Thanks

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