all groups > flash actionscript > january 2007 >
You're in the

flash actionscript

group:

should work?


should work? jonnybennett
1/1/2007 8:43:01 PM
flash actionscript:
Firtsly happy new year to all those helpful forum responders, you know who you
are.
Secondly can you help?

I have an m.c.onRelease that attachs a movie clip and one that removes that
movie clip. They work fine, however I want to be able to put all the actions
into the one onRelease... eg..

viewBtn.onRelease=function(){
removeMovieClip(_parent.slideshowAttach);
parentTimeline=_parent;

slideShowClip=_parent.attachMovie('slideshowAttach','slideshowAttach',_global.nI
ndex++);
parentTimeline["slideshowAttach"].slideName=slidename.text;
parentTimeline["slideshowAttach"].slideImageDetails=slideimages.text;
parentTimeline["slideshowAttach"].slideCaptionDetails=slidecaptions.text;
parentTimeline["slideshowAttach"].slideType=slidetype.text;}

removeBtn.onRelease=function(){
removeMovieClip(_parent.slideshowAttach);}

However when you add the removeMovieClip to the viewBtn thus not needing
removeBtn it causes errors doesn't work. However if it works with the two
buttons surely as long as as long as the previously attached m.c. is removed
before the new one is attached it should work. Anyway any ideas? I have tried
giving the attached m.c. diff names but this also does not work?
Re: should work? kglad
1/1/2007 11:49:00 PM
this should work as long as your not swapping depths to negative depth.



viewBtn.onRelease = function() {
_parent.slideshowAttach.removeMovieClip();
parentTimeline = _parent;
slideShowClip = _parent.attachMovie('slideshowAttach', 'slideshowAttach',
_global.nIndex++);
parentTimeline["slideshowAttach"].slideName = slidename.text;
parentTimeline["slideshowAttach"].slideImageDetails = slideimages.text;
parentTimeline["slideshowAttach"].slideCaptionDetails = slidecaptions.text;
parentTimeline["slideshowAttach"].slideType = slidetype.text;
};
Re: should work? jonnybennett
1/2/2007 12:28:20 AM
Thanks Kglad. I've tried your suggestion, but it is still causing this rather
random results of sometimes not attaching the clip being attached properly. I
would assume that it is something to do with the clips that are being attached
rather than the viewBtn.onRelease not executing properly, but that doesn't
explain why it works when you have a button that simply removes and another to
attach? bizzarre. Anyway I have decided to do the whole process in a different
very ugly way, but it apears to work, so thanks for your help. J
Re: should work? kglad
1/2/2007 1:47:18 AM
AddThis Social Bookmark Button