SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Apr 2003
    Location
    UK
    Posts
    152
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Passing value from button.

    Hi all.

    This is what I'm trying to do. I've got a movie with which is a bout 150 frames in length which starts up, then stops at 105 with a stop(); action in one of the frames.

    Within the movie are four buttons with actions like this:

    on (release){
    gotoAndPlay(105);
    movie=services
    }

    ---- or -----------

    on (release){
    gotoAndPlay(105);
    movie=portfolio
    }

    .... (in other words, each button is creating a different value)

    At the end of the (current) movie is an action in the timeline:

    -----------------------------------------
    if
    (movie=services){
    loadMovieNum("services.swf",1);
    }
    if
    (movie=portfolio){
    loadMovieNum("portfolio.swf",1);
    }
    -------------------------------

    The buttons are triggering the goto and play part, but once it reaches the end of the timeline, the desired movie is not being loaded.

    What am I doing wrong?

    Any help would be appreciated.

    Thanks
    Matt

  2. #2
    Dumb PHP codin' cat
    Join Date
    Aug 2000
    Location
    San Diego, CA
    Posts
    5,460
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    = is an assignment operator and == is a comparison operator.
    You need to compare values not assign and you need use strings not variables for the value of movie

    Code:
     
    on (release){
    gotoAndPlay(105);
    movie="portfolio";
    }
    if
    (movie=="services"){
    loadMovieNum("services.swf",1);
    }
    if
    (movie=="portfolio"){
    loadMovieNum("portfolio.swf",1);
    }
    Please don't PM me with questions.
    Use the forums, that is what they are here for.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •