jeudi 28 mai 2015

Flash AS3 - 1046: Type was not found or was not a compile-time constant..how to add group of movie clips?

My old project is without an issue: I used a movie clip PaterMove with instance Box, Inside I have 8x the same movie clip Box3D I just change instance for each one, which is up, up2, till up8.

import flash.display.*;
import flash.events.*;
stop();

var box;

box.useHandCursor = true; // <---- doesn't work?
box.mouseChildren=false;
box.buttonMode = true;
addChild(box);

box.addEventListener(MouseEvent.CLICK, _click);
function _click(e:MouseEvent):void
{
trace('click');
box.play();
this.box.up.play();
this.box.up2.play();
this.box.up3.play();
this.box.up6.play();
this.box.up5.play();
this.box.up4.play();
this.box.up8.play();
this.box.up7.play();
}

I have this simple code to by able to click on each box and make them moving. but the issue is Box3D doesn’t move how I need. I made updated project where I don’t use the same movie clip, bot I have especial one for each position. Link to see old project: http://ift.tt/1J8goFw

Now I used movie clip PN with instance name pater, and I have inside 8 different movie clips call box1 till box8. with instance name box1 till box8 I believe that made the problem, but what should I add to the code ???

import flash.display.*;
import flash.events.*;
stop();


var pater;


pater.useHandCursor = true; // <---- doesn't work?
pater.mouseChildren=false;
pater.buttonMode = true;
addChild(pater);

pater.addEventListener(MouseEvent.CLICK, _click);
function _click(e:MouseEvent):void
{
trace('click');
pater.play();
this.pater.box1.play();
this.pater.box2.play();
this.pater.box3.play();
this.pater.box4.play();
this.pater.box5.play();
this.pater.box6.play();
this.pater.box7.play();
this.pater.box8.play();


}

Aucun commentaire:

Enregistrer un commentaire