PDA

View Full Version : Loop arrows on path


CienieSushi
01-26-2012, 12:00 PM
Hi. My first post here :)

First of all, sorry about my english.

I know its very noob question, but i spend half a day on google and i cant find solution (or i just dont understand it). I want to loop several, infinite arrows that goes on some path.

I've made classic motion with one arrow on path, and its my movieclip1.
I was trying to copy that movieclip but then, all arrows go to the end, without loop repeat.

Have no idea how to solve my problem.
Some files that might help in attach.
GIF alone and SWF and FLA in zip.

EDIT: I have made what i want BUT its complicated way. Is there some simply way?

[afz]snickelfitz
01-26-2012, 12:26 PM
You forgot to upload the zip, I think.

CienieSushi
01-26-2012, 12:30 PM
I just upoad new files after edit :)

Prid
01-26-2012, 12:49 PM
Would you mind uploading in a lower version, CS4 or something :)?

[afz]snickelfitz
01-26-2012, 12:51 PM
Save your project in CS4 or CS5 format; many members do not upgrade to CS5.5

[afz]snickelfitz
01-26-2012, 12:57 PM
You want to create a long bent path with arrows that infinitely scroll along it?
Will this path have a beginning and end, or will it ultimately form a closed loop?

Not sure I understand why you don't just build the whole thing in a single MovieClip.

CienieSushi
01-26-2012, 12:57 PM
file .FLA in cs4 version as attachment.
Also, my work mate just tell me that maybe we could determinate speed od moving arrows in sec. not as frames. (there wil be more "pipes" with arrows, with different length and we will like to have same speed of all arrows)

'Pipes" have begin and end.

Prid
01-26-2012, 11:20 PM
Remove all the other arrows, and just have one full arrow motion in that movieclip, give that Movieclip an instance name of mc, then locate it in your Library, right-click it, press Properties, click Advanced to show more properties, tick/check Export for Actionscript, and in the identifier field, type, pipe, and press OK

Then use this code on your Frame (and cut down frames to only one):

pipeX = mc._x;
pipeY = mc._y;
i = 0;

function createPipe(){
attachMovie("pipe", "pipe"+i, i, {_x:pipeX, _y:pipeY});
i++;
}

setInterval(createPipe, 500);

and then use this code on the last frame of the movieclip:

stop();
unloadMovie(this);

Hope it works ;)

CienieSushi
01-27-2012, 10:17 AM
I will try it. Thanks for advice :)

EDIT: It works perfectly :) Thanks very much again, if u come to Poland u have big beer from me :) Thanks to everyone who replay my posts also.

PS. u know some nice and easy ActionScript courses? I know HTML, CSS a little jQuerry but i have no idea about AC

CienieSushi
01-27-2012, 01:28 PM
Uh... next problem... :(

Everything works alomst perfectly, but new movieclips that are created by ActionScript from Prid are creating at the top of all layers. How can i determinate that they will be created at the same layer what first movieclip?

Prid
01-28-2012, 10:03 AM
oh, that's because all the new movieclips are created in a new "layer" at the top (actually, there are no layers in the compiled SWF file, they're converted to depths, but I used the word layer to simplify it to you), so to prevent them, simply create an empty movieclip on the Stage, in a layer of your choice (simply draw a shape, convert it to a Movieclip, enter that movieclip, and delete the shape to create an empty movieclip), give it an instance name of, mc_container, and change the code on the Frame on the Main Stage to this:

mc_container._x = 0;
mc_container._y = 0;
pipeX = mc._x;
pipeY = mc._y;
i = 0;

function createPipe(){
mc_container.attachMovie("pipe", "pipe"+i, i, {_x:pipeX, _y:pipeY});
i++;
}

setInterval(createPipe, 500);

CienieSushi
01-31-2012, 11:03 AM
Works perfectly :) Another beer fo u :)