Help with loadMovie

  • jtp8806
  • Born
  • Born
  • jtp8806
  • Posts: 1

Post 3+ Months Ago

I have a main swf file that loads in other swfs into a content frame when you drop a draggable movie clip-button into a certain place. When I preview it in flash, the first dropped movie clip works fine, but if you drop another button it doesn't always work right or load the right swf.

Code: [ Select ]
//load first
content_mc.loadMovie("contentfirst.swf");


///ball button
origX1 = ballbtn_mc._x;
origY1 = ballbtn_mc._y;

ballbtn_mc.onPress = function(){
    this.startDrag();
    this.gotoAndPlay("shrink");
};

ballbtn_mc.onRelease = function(){
    this.stopDrag();
    this.gotoAndPlay("grow");
    if (eval(this._droptarget) == catload_mc) {
        catload_mc.hit = true;
        this.gotoAndPlay("flash");
        content_mc.unloadMovie();
        catload_mc.unloadMovie();
        catload_mc.loadMovie("ball.swf");
        this._x = origX1;
        this._y = origY1;
    } else {
        catload_mc.hit = false;
        catload_mc.gotoAndStop(2)
        this._x = origX1;
        this._y = origY1;
    }
};


///yarn button
origX2 = yarnbtn_mc._x;
origY2 = yarnbtn_mc._y;

yarnbtn_mc.onPress = function(){
    this.startDrag();
    this.gotoAndPlay("shrink");
};

yarnbtn_mc.onRelease = function(){
    this.stopDrag();
    this.gotoAndPlay("grow");
    if (eval(this._droptarget) == catload_mc) {
        catload_mc.hit = true;
        this.gotoAndPlay("flash");
        content_mc.unloadMovie();
        catload_mc.unloadMovie();
        catload_mc.loadMovie("yarn.swf");
        this._x = origX2;
        this._y = origY2;
    } else {
        catload_mc.hit = false;
        catload_mc.gotoAndStop(2)
        this._x = origX2;
        this._y = origY2;
    }
};
  1. //load first
  2. content_mc.loadMovie("contentfirst.swf");
  3. ///ball button
  4. origX1 = ballbtn_mc._x;
  5. origY1 = ballbtn_mc._y;
  6. ballbtn_mc.onPress = function(){
  7.     this.startDrag();
  8.     this.gotoAndPlay("shrink");
  9. };
  10. ballbtn_mc.onRelease = function(){
  11.     this.stopDrag();
  12.     this.gotoAndPlay("grow");
  13.     if (eval(this._droptarget) == catload_mc) {
  14.         catload_mc.hit = true;
  15.         this.gotoAndPlay("flash");
  16.         content_mc.unloadMovie();
  17.         catload_mc.unloadMovie();
  18.         catload_mc.loadMovie("ball.swf");
  19.         this._x = origX1;
  20.         this._y = origY1;
  21.     } else {
  22.         catload_mc.hit = false;
  23.         catload_mc.gotoAndStop(2)
  24.         this._x = origX1;
  25.         this._y = origY1;
  26.     }
  27. };
  28. ///yarn button
  29. origX2 = yarnbtn_mc._x;
  30. origY2 = yarnbtn_mc._y;
  31. yarnbtn_mc.onPress = function(){
  32.     this.startDrag();
  33.     this.gotoAndPlay("shrink");
  34. };
  35. yarnbtn_mc.onRelease = function(){
  36.     this.stopDrag();
  37.     this.gotoAndPlay("grow");
  38.     if (eval(this._droptarget) == catload_mc) {
  39.         catload_mc.hit = true;
  40.         this.gotoAndPlay("flash");
  41.         content_mc.unloadMovie();
  42.         catload_mc.unloadMovie();
  43.         catload_mc.loadMovie("yarn.swf");
  44.         this._x = origX2;
  45.         this._y = origY2;
  46.     } else {
  47.         catload_mc.hit = false;
  48.         catload_mc.gotoAndStop(2)
  49.         this._x = origX2;
  50.         this._y = origY2;
  51.     }
  52. };


After the "yarn.swf" has been played by the yarnbtn_mc, when you drop ballbtn_mc into the frame, yarn.swf plays again instead of ball.swf.

Why is that happening? How can I fix it?
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

can you post a link to the swf file so i can see what's all about?

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 8 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.