SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Threaded View

  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2001
    Location
    Luton, UK
    Posts
    57
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Variables I just can't get right!!

    Hi All
    I figured this would be easy but for some reason I can't get it right.

    I have a movie clip that loads a video and streams it. But what I want to do is have the video stream first time but second time it is loaded to go to a stop position.

    I have defined a variable x=1; in a movie clip called movieVar - and on the button that calls the video.swf I have put

    on(release)
    {
    _root.movieVar.x=x++;
    }


    Now in the video .swf on frame 1 I have put:

    if(_root.movieVar.x >= 2){
    gotoAndPlay(2);
    }else{
    gotoAndStop("videoStop" );
    }


    When I first load the video.swf the x variable in movieVar says 'undefined' but when I click the button again to load it it does give it a value of 1 - and then I press again and it goes to 2.

    So why is it saying undefined when the button is pressed for the first time?

    Any ideas where I am going wrong?

    All help much appreciated.

    Drew
    Last edited by drewcoster; Mar 12, 2003 at 12:33.
    'As a computer, I find your faith in technology amusing'


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
  •