1 Reply Latest reply on Feb 13, 2008 10:10 AM by C-Rock

    ActionScript 2.0

    peor
      Can anyone to solve this for me:
      My description of the code is I want to part one button (onPress) inside of one button for that button is nested. How can I make that?
      How can I lock the attachMovie so can't touch this when I press moviclip button and tween motion.
      I have create a simple foto album when I click a one picture so come the up and now can I touch the background (with another photos and the slider) of the bigger picture.
      How can I close background so if I don't touch this.
      I hope you understand me.
      Here are the code:

      a1c_mc.onPress = function () {
      var a11:MovieClip = _root.attachMovie("bg_album", "a11a", 20, {_x:0, _y:0})
      new Tween(a11, "_alpha", Strong.easeIn, 0, 25, 3, true);
      var a21:MovieClip = _root.attachMovie("ab1_mc", "a41b", 40, {_x:40, _y:2.5});
      new Tween(a21, "_alpha", Strong.easeOut, 0, 100, 3, true);
      a21.onPress = function () {
      var myTween1:Tween = new Tween(a11, "_alpha", Strong.easeIn, 25, 0, 3, true);
      var myTween2:Tween = new Tween(a21, "_alpha", Strong.easeOut, 100, 0, 3, true);
      myTween1.onMotionStopped = function() {
      var myFinish1:Number = myTween1.finish;
      if (myFinish1){
      a11._visible = true;
      } else {
      a11._visible = false;
      };
      };
      myTween2.onMotionStopped = function() {
      var myFinish2:Number = myTween2.finish;
      if (myFinish2){
      a21._visible = true;
      } else {
      a21._visible = false;
      };
      };
      };
      };

      Here I have part the code but this don't works.

      a1c_mc.onPress = function () {
      var a11:MovieClip = _root.attachMovie("bg_album", "a11a", 20, {_x:0, _y:0})
      new Tween(a11, "_alpha", Strong.easeIn, 0, 25, 3, true);
      var a21:MovieClip = _root.attachMovie("ab1_mc", "a41b", 40, {_x:40, _y:2.5});
      new Tween(a21, "_alpha", Strong.easeOut, 0, 100, 3, true);
      };
      a1c_mc.onPress = function () {
      var a11:MovieClip = _root.attachMovie("bg_album", "a11a", 20, {_x:0, _y:0})
      new Tween(a11, "_alpha", Strong.easeIn, 0, 25, 3, true);
      var a21:MovieClip = _root.attachMovie("ab1_mc", "a41b", 40, {_x:40, _y:2.5});
      new Tween(a21, "_alpha", Strong.easeOut, 0, 100, 3, true);
      };

      Can you help me too solve this: http://www.kirupa.com/developer/actionscript/ascript_text_animation.htm
      I want use this in whole actionscript like this:

      _root.createEmptyMovieClip("start1", this.getNextHighestDepth());
      _root.start1.createEmptyMovieClip("start2", this.getNextHighestDepth());
      var text06:MovieClip = _root.start2.createTextField("text06_txt", this.getNextHighestDepth(), 775, 650, 150, 100);
      var endtext06:Tween = new Tween(text06, "_x", None.easeNone, 0-150, 800, 6, true);
      var my_fmt:TextFormat = new TextFormat();
      my_fmt.font = "_serif";
      my_fmt.size = 18;
      _root.start2.text06_txt.text = "Bildspelet är slut.\nTryck på knappen för att starta om bildspelet.";
      _root.start2.text06_txt.setTextFormat(my_fmt);
      _root.start2.text06_txt.setTextFormat(my_fmt);
      _root.start2.text06_txt.selectable = false;
      var myDropFilter = new DropShadowFilter();
      myDropFilter.blurX = 25;
      myDropFilter.blurY = 10;
      myDropFilter.angle = 180;
      myDropFilter.inner = true;
      myDropFilter.alpha = 100;
      myDropFilter.color = 0x0FFF80;
      var myFilters:Array = _root.start2.text06_txt.filters;
      myFilters.push(myDropFilter);
      _root.start2.text06_txt.filters = myFilters;

      nXstart = 1
      nYstart = 15
      _root.start1._visible = false
      nLength = length(_root.start2.text06_txt.text)
      nKerning = 12
      nLLength = 24
      nChars = 0
      nLNumber = 1
      nLSpace = 20
      ii = 0
      nChars++
      if(nChars >= nLLength){
      nReturn = text.substr(ii,1)
      if(nReturn == " "){
      nLNumber = nLNumber + 1
      nChars = 0
      }
      }
      ii++
      _root.start1.duplicateMovieClip ("start1"+ii, ii);
      _root["start1"+ii]._root.start2.text06_txt.text=text.substr(ii-1, 1);
      _root["start1"+ii]._x = nXstart + nChars * nKerning
      _root["start1"+ii]._y = nXstart + nLNumber * nLSpace

      This code don't works can you correct this code.
      And finally how can I change mouse pointer if I use tools.setCursor()
      function setCursor() {
      fl.tools.setCursor( 1 );
      }

      in this actionscript code:

      _root.createEmptyMovieClip("begin06", this.getNextHighestDepth());
      var text06:MovieClip = _root.begin06.createTextField("text06_txt", this.getNextHighestDepth(), 775, 650, 150, 100);
      var endtext06:Tween = new Tween(text06, "_x", Strong.easeOut, Stage.width+150, 775, 6, true);
      endtext06.onMotionFinished = function() {
      _root.begin06.onPress = function () {
      getURL(" http://www.google.com", "_blank");
      };
      };
      var my_fmt:TextFormat = new TextFormat();
      my_fmt.font = "_serif";
      my_fmt.size = 18;
      _root.begin06.text06_txt.text = "google.com";
      _root.begin06.text06_txt.setTextFormat(my_fmt);
      _root.begin06.text06_txt.setTextFormat(my_fmt);
      _root.begin06.text06_txt.selectable = false;
      var myDropFilter = new DropShadowFilter();
      myDropFilter.blurX = 25;
      myDropFilter.blurY = 10;
      myDropFilter.angle = 180;
      myDropFilter.inner = true;
      myDropFilter.alpha = 100;
      myDropFilter.color = 0x0FFF80;
      var myFilters:Array = _root.begin06.text06_txt.filters;
      myFilters.push(myDropFilter);
      _root.begin06.text06_txt.filters = myFilters;
        • 1. Re: ActionScript 2.0
          C-Rock Level 2
          actionscript 2 can't do nested rollovers. you'll have to make a movie clip and make sort of a submenu type thing. email my personal address and i can send you a movie clip example if you'd like. or did i just totally miss what you wanted?