1 Reply Latest reply on Aug 19, 2009 10:40 PM by Flex harUI

    Problem w/ migration to AS3 Flex

    bendayan

      Hi there. Some time ago I made a small project for Flash 8 in AS3 without any problem. Problem is now that I want to migrate my AS2 code to AS3 in a Flex new project. Is there anyone who can help me to accomplish this task? Please. I'll be very thankfull.

       

      The AS2 code for Flash:

       

      onClipEvent (load) {

                      _root.line._visible = 0;

                      number_lines = 0;

                      line_active = 0;

      }

      onClipEvent (mouseUp) {

                      origin_x = _xmouse;

                      origin_y = _ymouse;

                      number_lines++;

                      name = "line"+number_lines;

                      _root.line.duplicateMovieClip(name,number_lines);

                      _root[name]._x = origin_x;

                      _root[name]._y = origin_y;

                      _root[name]._xscale = _root._xmouse - origin_x;

                      _root[name]._yscale = _root._ymouse - origin_y;

                      if (!line_active)

                      {

                                      line_active = 1;

                                      start_x = origin_x;

                                      start_y = origin_y;

                      }

      }

      onClipEvent (mouseMove) {

                      if (line_active)

                      {

                                      _root[name]._xscale = _root._xmouse - origin_x;

                                      _root[name]._yscale = _root._ymouse - origin_y;

                                      updateAfterEvent();

                      }

      }

      onClipEvent (keyUp) {

                      if (Key.getAscii() == 13)

                      {

                                      _root[name]._xscale = start_x - origin_x;

                                      _root[name]._yscale = start_y - origin_y;

                                      line_active = 0;

                      }

      }