Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Flash if Bar
Index -> Graphics and Design, Web Design -> Flash MX Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Balmung




PostPosted: Mon Oct 01, 2007 8:18 am   Post subject: Flash if Bar

Ok, I have a bar that changes size when it Moves with this:

code:
// Moves Bar up to Start//
on (keyPress "<Up>") {
        bar._y = 396.9;
        bar._x = 320.6;
        bar._width = 111.3;
}

// Moves Bar down to Continue //
on (keyPress "<Down>") {
        bar._y = 432.9;
        bar._x = 298.9;
        bar._width = 155.5;
}


which works fine but when i go to do an if statement on another button for it, it doesn't work it only does the first if statement and doesn't test the rest.

code:
on (keyPress "<Enter>") {
        if (bar_.width=111.3) {
                gotoAndStop(2);
        } else {
                gotoAndStop(1);
        }
}
Sponsor
Sponsor
Sponsor
sponsor
Steven Toews




PostPosted: Sun May 04, 2008 10:44 am   Post subject: Re: Flash if Bar

Well this is one hell of a late reply but just incase people out there have the same question sometime... you should put it in a function that is constantly being repeated, if you want your if statements to be cycled through...
Balmung wrote:

Ok, I have a bar that changes size when it Moves with this:

code:
// Moves Bar up to Start//
on (keyPress "<Up>") {
        bar._y = 396.9;
        bar._x = 320.6;
        bar._width = 111.3;
}

// Moves Bar down to Continue //
on (keyPress "<Down>") {
        bar._y = 432.9;
        bar._x = 298.9;
        bar._width = 155.5;
}


which works fine but when i go to do an if statement on another button for it, it doesn't work it only does the first if statement and doesn't test the rest.

code:
on (keyPress "<Enter>") {
        if (bar_.width=111.3) {
                gotoAndStop(2);
        } else {
                gotoAndStop(1);
        }
}



You should try...
code:


bar.onEnterFrame = function() {

// Moves Bar up to Start//
on (keyPress "<Up>") {
        bar._y = 396.9;
        bar._x = 320.6;
        bar._width = 111.3;
}

// Moves Bar down to Continue //
on (keyPress "<Down>") {
        bar._y = 432.9;
        bar._x = 298.9;
        bar._width = 155.5;
}

on (keyPress "<Enter>") {
        if (bar._width=111.3) {
                gotoAndStop(2);
        } else {
                gotoAndStop(1);
        }
}
}



Display posts from previous:   
   Index -> Graphics and Design, Web Design -> Flash MX Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: