Comunidad de diseño web y desarrollo en internet online

convertir un as2... en as3

Citar            
MensajeEscrito el 04 Jun 2009 08:03 pm
hola a todos... espero alguien me pueda ayudar con esto del cambio de as2 a as3... como diseñadora, la verdad es que se me hace un poco mas complejo, pero bueno pretendo entenderle. como convierto este as2 en... as3?????

Código ActionScript :

stop();
menu_item_group.menu_item._visible = false;
var xml:XML = new XML();
var total:Number;
var i:Number = 0;
var total:Number;

xml.onLoad = function()
{
   var nodes = this.firstChild.childNodes;
   total = nodes.length;
   
   for (; i < total; i++)
   {
      menu_item_group.menu_item.duplicateMovieClip("menu_item" + i, i);
      menu_item_group["menu_item" + i].over = true;
      menu_item_group["menu_item" + i].item_label = nodes[i].attributes.item_label;
      menu_item_group["menu_item" + i].item_no = i;
      menu_item_group["menu_item"+i]._y = i*20;
      menu_item_group["menu_item" + i].flashmo_button._visible = true;
      menu_item_group["menu_item" + i].over = true;
      menu_item_group["menu_item" + i].flashmo_button.onRollOver = function()
{
         this._parent.over = false;
      };
      menu_item_group["menu_item" + i].flashmo_button.onRollOut = 
      menu_item_group["menu_item" + i].flashmo_button.onDragOut = function ()
      {
         this._parent.over = true;
      };
      menu_item_group["menu_item" + i].onEnterFrame = function()
      {
         if (this.over == true)
         {
            this.prevFrame();
         }
         else
         {
            this.nextFrame();
         }
      };
   }
};
xml.load("servicios_menu.xml");
xml.ignoreWhite = true;

Por leanan81

15 de clabLevel



 

firefox
Citar            
MensajeEscrito el 16 Jun 2009 05:16 am
Eso de que es? que intentaste Armar con eso?

Por venecia

Claber

134 de clabLevel



 

2007

safari
Citar            
MensajeEscrito el 10 Jun 2010 03:37 pm
Hola yo tambien quisiera pasar el siguiente codigo AS2 a AS3. este codigo esta dentro de una instancia.La instancia se mueve dentro del escenario hasta que se le da clic sobre ella, luego despliega un menu y tiene opciones para arrastrar la instancia a un lugar del escenario y para cerrar el menu

El ejemplo me lo baje del siguiente link: http://flash.astalaweb.net/Plantillas/1_Plantillas.asp
El codigo es el siguiente para la instancia "nav":

onClipEvent (load) {
leftedge = 0+this._width/2;
rightedge = 650-this._width/2;
topedge = 0+this._height/2;
bottomedge = 350-this._height/2;

frX = 1;
frXcn = 0;
frY = 5/4;
frYcn = 1;
freqX = 1/3;
freqXcn = 0;
freqY = 1/2;
freqYcn = 0;
ampx = 0;
ampy = 0;
step = Math.PI/100;
oppRand = 2;
randX = Math.random()*oppRand;
randY = Math.random()*oppRand;
keepX = 12;
keepY = 12;
dx = 0;
dy = 0;
maxx = 650;
maxy = 350;
minx = 0;
miny = 0;
maxspeed = 5;
maxdx = maxspeed;
mindx = maxspeed*(-1);
maxdy = maxspeed;
mindy = maxspeed*(-1);
dropx = this._x;
dropy = this._y;
acccn = 50;
allowx = 100;
allowy = 100;
square();
move = false;
n = 0;
tx = 0;
ty = 0;
x = this._x;
y = this._y;
mouseclose = false;
function square() {
minx = dropx-allowx;
maxx = dropx+allowx;
miny = dropy-allowy;
maxy = dropy+allowy;
if (minx<leftedge) {
minx = leftedge;
maxx = minx+2*allowx;
}
if (maxx>rightedge) {
maxx = rightedge;
minx = maxx-2*allowx;
}
if (miny<topedge) {
miny = topedge;
maxy = miny+2*allowy;
}
if (maxy>bottomedge) {
maxy = bottomedge;
miny = maxy-2*allowy;
}
}
function drag() {
move = false;
this.startDrag();
}
function drop() {
this.stopDrag();
dropx = this._x;
dropy = this._y;
x = dropx;
y = dropy;
dx = 0;
dy = 0;
n = 0;
tx = 0;
ty = 0;
square();
move = true;
}
}
onClipEvent (enterFrame) {
if (this._xmouse>-100 and this._xmouse<100 and this._ymouse>-100 and this._ymouse<100) {
mouseclose = true;
} else {
mouseclose = false;
}
if (move and not mouseclose) {
n += step;
tx += 1;
ty += 1;
fx = Math.sin(frX*n+frXcn);
fy = Math.sin(frY*n+frYcn);
ffreqX = (Math.sin(freqX*n+freqXcn))*ampx;
ffreqY = (Math.sin(freqY*n+freqYcn))*ampy;
if (tx>=keepX) {
randX = Math.random()*oppRand;
tx = 0;
}
if (ty>=keepY) {
randY = Math.random()*oppRand;
ty = 0;
}
dx += randX*fx+ffreqX;
dy += randY*fy+ffreqY;
if (dx>maxdx) {
dx = maxdx;
}
if (dx<mindx) {
dx = mindx;
}
if (dy>maxdy) {
dy = maxdy;
}
if (dy<mindy) {
dy = mindy;
}
x += dx;
y += dy;
if (x<=minx+acccn) {
dx += oppRand;
}
if (x>=maxx-acccn) {
dx -= oppRand;
}
if (y<=miny+acccn) {
dy += oppRand;
}
if (y>=maxy-acccn) {
dy -= oppRand;
}
this._x = x;
this._y = y;
}
}

Por eglita

0 de clabLevel



 

msie7

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.