Skip to main content
juresti
Known Participant
February 8, 2011
Answered

Button is not working on 2nd load

  • February 8, 2011
  • 1 reply
  • 1127 views

I have a main swf that loads movies into a clip movieHolder. It loads one movie initially and a button is selected then plays to a frame which loads another movie once a button is pressed in this movie it plays to a frame and at this point / frame I have this code:

stop();
_parent.movieHolder.loadMovie("Q_1.swf");
_parent.attachMovie("title_foundational", "ttl_foundational", 1, {_x: 217, _y: 5});
_parent.attachMovie("buttonblank", "butt_blank", 2, {_x: 22, _y: 5});
    _parent.butt_blank.gotoAndStop (1);
    _parent.butt_blank._alpha = 100;
    _parent.butt_blank.onRelease = function() {
    _parent.gotoAndStop ("secondframe");
    }

The butt_blank is what I am having trouble with. The first time it returns the user to the right place back to the first loaded movie, subsequently when the buttons are clicked the movies again load properly and the code does load the butt_blank, but the code does NOTHING. The user stays on the same frame.

This is the code that runds when the user returns to "secondframe"

movieHolder.loadMovie("ShopOutsideAnim01.swf", "ShopOutside");
ttl_foundational.removeMovieClip();
butt_blank.removeMovieClip();

Any help is greatly appreciated!

This topic has been closed for replies.
Correct answer kglad

I do see the trace yes I guess it is not loading the movie then when I click the button the first time it goes back to parent and loads movie, cecond time I see trace my movie does not load into movieHolder or not on top of current movie. Am I missing something???

movieHolder.loadMovie("ShopOutsideAnim01.swf", "ShopOutside");
ttl_foundational.removeMovieClip();
butt_blank.removeMovieClip();


yes, you're missing something.  you are probably confused about what you expect _parent to be.  use:

trace(_parent)

just before that _parent.goto

and if you have more than one _parent.goto which is, i suspect, causing your confusion, trace them all.

1 reply

kglad
Community Expert
Community Expert
February 8, 2011

butt_blank needs to be removed before another butt_blank is added.

juresti
jurestiAuthor
Known Participant
February 8, 2011

I'll be back Monday to work on this and mark correct!

I thought I removed it here once it went to this frame:

This is the code that runds when the user returns to "secondframe"

movieHolder.loadMovie("ShopOutsideAnim01.swf", "ShopOutside");
ttl_foundational.removeMovieClip();
butt_blank.removeMovieClip();

maybe it's not the right path.

MAybe I need to remove it here:

stop();
_parent.movieHolder.loadMovie("Q_1.swf");
_parent.attachMovie("title_foundational", "ttl_foundational", 1, {_x: 217, _y: 5});
_parent.attachMovie("buttonblank", "butt_blank", 2, {_x: 22, _y: 5});
    _parent.butt_blank.gotoAndStop (1);
    _parent.butt_blank._alpha = 100;
    _parent.butt_blank.onRelease = function() {
    _parent.gotoAndStop ("secondframe");

butt_blank.removeMovieClip();
    }

Ok Ill see what I can do.

juresti
jurestiAuthor
Known Participant
February 16, 2011

_parent.attachMovie("buttonblank", "butt_blank", 2, {_x: 22, _y: 5});
_parent.butt_blank._alpha = 100;

_parent.butt_blank.onRelease = function() {
    _parent.gotoAndStop (2);
    trace("ahahhhhhahhahahahahahahahah");
    }

Frame 2 of parent:

movieHolder.loadMovie("ShopOutsideAnim01.swf", "ShopOutside");
butt_blank.removeMovieClip();

when it goes back to above code it does not perform gotoAnStop (2) again