View Full Version : movie stopping at random frame (not on purpose)
shaftbond
05-26-2003, 08:16 PM
OK. I have a slider MC moving across the x axis as per buttons clicked by the user. When it gets to certain places, I want a short movie clip to play (called "bar_links"). And then, when the user pushes on another button, moving the slider out, I want that movie to stop playing. On the MC "bar_links" I have this code:
onClipEvent (enterFrame) {
var sliderX = getProperty ("_root.slider", _x);
var barframe = getProperty ("_root.bar_links", _currentFrame);
if (((sliderX > 600) && (sliderX < 650)) && (barframe == 1)) {
gotoAndPlay ("bar_links", 2);
}
if (((sliderX > 650) || (sliderX < 600)) && (barframe == 20)) {
gotoAndPlay ("bar_links", 21);
}
}
when i go from one button to the next, the code works. but if the user jumps over one or more buttons, all the buttons in between go to frame 21 and stop. Any ideas?
subquark
05-27-2003, 06:44 PM
can you post your fla?
onClipEvent (enterFrame) {
var sliderX = getProperty ("_root.slider", _x);
var barframe = getProperty ("_root.bar_links", _currentFrame);
if (((sliderX > 600) && (sliderX < 650)) && (barframe == 1)) {
gotoAndPlay ("bar_links", 2);
}
if (((sliderX > 650) || (sliderX < 600)) && (barframe == 20)) {
gotoAndPlay ("bar_links", 21);
}
}
use the square brackets and "as" and "/as" to show your code, makes it easire to read
and
Welcome to the forum! Lots of great people to help you here.
shaftbond
05-28-2003, 02:27 AM
Thanks for the welcome. I tried to upload the .fla, but it's too big. I'll try and recreate it in a smaller file.
subquark
05-28-2003, 12:06 PM
maybe you can put the fla on your server and that way we can all download it. just put the "raw" fla in a work folder and put up the link, it will automatically download
like this:
http://www.subquark.com/footer/bounce4.fla
good luck! :)
shaftbond
05-28-2003, 07:11 PM
OK, here it is. Watch the bars under the buttons, they should fade in and out according to there the slider is. But if you move the slider too fast, they get stuck. Thanks for the help.
subquark
05-28-2003, 07:29 PM
where? :confused:
shaftbond
05-28-2003, 07:37 PM
let me try again...
shaftbond
06-02-2003, 01:29 AM
could anyone figure out an easier way (or at least a way that works) of doing this?
shaftbond
06-02-2003, 03:14 AM
I'm freaking pathetic, I know. I'm trying a different way to acheive a similar result. Instead of having the MC continually check to see where the slider is and adjust to that, I just want the bar to raise when the button is pushed and have the code checked to see if any other bars are raised (on frame 20) and send them back to frame 1 (via frame 21). I'm not getting any errors when I run this, but the "bar_contact" movie is staying on frame 1. Am I doing something wrong? Here is the code:
on (press) {
var contactplay = getProperty("_root.bar_contact", _currentframe);
if(contactplay == 1) {
gotoAndPlay("_root.bar_contact", 2);
}
var homeplay = getProperty("bar_home", _currentframe);
if (homeplay != 1) {
gotoAndPlay("bar_home", 21);
}
var aboutplay = getProperty("bar_about", _currentframe);
if (aboutplay != 1) {
gotoAndPlay("bar_about", 21);
}
var portplay = getProperty("bar_portfolio", _currentframe);
if (portplay != 1) {
gotoAndPlay("bar_portfolio", 21);
}
var linksplay = getProperty("bar_links", _currentframe);
if (linksplay != 1) {
gotoAndPlay("bar_links", 21);
}
}
Thanks
shaftbond
06-16-2003, 12:33 PM
Well, I found a tutorial that should get me where I want to go.
http://www.flashkit.com/tutorials/Actionscripting/Using_va-Bryan_Ga-770/index.php
I haven't tried it yet, but it looks good. The only thing bothering me now though is that I still can't figure out why my code didn't work...
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.