A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: expressions on buttons

  1. #1
    I'm having some trouble with expressions on buttons.

    I need to Eval the name of a label and then Tell Target a movie clip to goto and play the label.

    Nothing is working. Can someone please shed some light?
    =====================
    [I'm setting the id var from a different movieclip.]

    set var: label = Eval ("loc"&id&"map")
    On (Release)
    Begin Tell Target ("/address")
    Go to and Play (label)
    End Tell Target
    End On
    =====================

  2. #2
    Senior Moderator
    Join Date
    Apr 2000
    Location
    Sheffield, UK
    Posts
    3,881
    Try this syntax:

    set variable: "/:label" = Eval ("loc"&id&"map")

    Then on your button put:

    On (Release)
    Begin Tell Target ("/address")
    Go to and Play (/:label)
    End Tell Target
    End On

    /: refers to the main timeline.

    Hope that helps!!
    Regards FlashGuru

  3. #3
    Thanks FlashGuru. Your help is always excellent.

    I've been playing around with this most of today. The solution I found was to tell "/address" to goto and play a set label and pass variables to "/address" to make that label behave dynamically, based on what button was pressed.

    Looks something like this:

    On (Release)
    Comment: load a map file (external)
    Load Movie ("../media/"&map, 9)
    Comment: display one address
    Set Variable: "/address/buttonsmap:id" = id
    Set Variable: "/address:id" = id
    Set Variable: "/address/buttonsmap:url" = url
    Set Variable: "/address/buttonsmap:map" = map
    Begin Tell Target ("/address")
    Go to and Play ("map")
    End Tell Target
    End On

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