Forum Topic: What's all this about attach movie?

(102 views • 10 replies)

This topic is 1 page long.

<< < > >>
None

4urentertainment

Reply To Post Reply & Quote

Posted at: 12/10/08 07:01 AM

4urentertainment NEUTRAL LEVEL 13

Sign-Up: 08/01/08

Posts: 1,634

So I've been hearing about this for some time, Also when I download free source .FLA's some just don't have anything on screen, yet the game is all there when you export.

So what is all this, how do you do it, and what are its advantages?

"When you look at yourself from a universal standpoint, something inside always reminds or informs you that there are bigger and better things to worry about. "- Einstein


None

OctoFlash

Reply To Post Reply & Quote

Posted at: 12/10/08 07:26 AM

OctoFlash DARK LEVEL 17

Sign-Up: 12/02/06

Posts: 839

easy. just say:

attachMovie ("whatever", 1);

that means that you import a movieclip from the library to the stage. BUT: you need to make the MC (movieclip) exportable for AS (actionscript).

how to? just right-click the symbol in the library and select linkage. then export for actionscript. then you need to name it (standard: the real MC name)

in this case i have a MC called "whatever".

so when you attach the movieclip to the stage it's coordinates will be 0, 0.

now you can set the coordinates as you want. i hope you know how this works.

the good thing on importing the MC to the stage: you can say:

whatever.removeMovieClip();

and it disappears! :D

got it?

BLAM DAMN SPAM. That rhymes! So what do we learn?
the right answer for the most bbs-posts: THE FREAKIN' COLLAB RULES!!!

BBS Signature

None

OctoFlash

Reply To Post Reply & Quote

Posted at: 12/10/08 07:30 AM

OctoFlash DARK LEVEL 17

Sign-Up: 12/02/06

Posts: 839

whoops sorry for the doublepost but i made a mistake:

attachMovie("whatever", "whatever-new", 1);

okay. this one is right. so what did i do here?

attachMovie - imported the movie to the stage.
"whatever" - the name you gave the MC to be exportable
"whatever-new" - you need to define a instance name for the MC
1 - the depth

BLAM DAMN SPAM. That rhymes! So what do we learn?
the right answer for the most bbs-posts: THE FREAKIN' COLLAB RULES!!!

BBS Signature

None

WolfAkela

Reply To Post Reply & Quote

Posted at: 12/10/08 07:54 AM

WolfAkela LIGHT LEVEL 08

Sign-Up: 12/19/05

Posts: 2,327

and what are its advantages?

You reduce the amount of things you'd have to put manually onscreen. Random fireworks is one example, and it's much easier to script it than to manually animate a million possibilities.


None

4urentertainment

Reply To Post Reply & Quote

Posted at: 12/10/08 08:54 AM

4urentertainment NEUTRAL LEVEL 13

Sign-Up: 08/01/08

Posts: 1,634

At 12/10/08 07:54 AM, WolfAkela wrote:
and what are its advantages?
You reduce the amount of things you'd have to put manually onscreen. Random fireworks is one example, and it's much easier to script it than to manually animate a million possibilities.

So basically...If my player is fighting an army of identical soldiers, and if I do one soldier and attach him like that a million times, the movie would be faster right?

"When you look at yourself from a universal standpoint, something inside always reminds or informs you that there are bigger and better things to worry about. "- Einstein


None

WolfAkela

Reply To Post Reply & Quote

Posted at: 12/10/08 08:58 AM

WolfAkela LIGHT LEVEL 08

Sign-Up: 12/19/05

Posts: 2,327

Well, no, if you still have the same amount of soldiers on-screen there's no difference.

The thing is that with attachMovie(), you can have dynamic displays of MCs on the stage. Lots of things are just easier to code than to have to animate.


None

4urentertainment

Reply To Post Reply & Quote

Posted at: 12/10/08 09:08 AM

4urentertainment NEUTRAL LEVEL 13

Sign-Up: 08/01/08

Posts: 1,634

At 12/10/08 08:58 AM, WolfAkela wrote: Well, no, if you still have the same amount of soldiers on-screen there's no difference.

The thing is that with attachMovie(), you can have dynamic displays of MCs on the stage. Lots of things are just easier to code than to have to animate.

So I should just go ahead, and start using this method then?

Also, where do I add it's x and y? Is that the depth?

"When you look at yourself from a universal standpoint, something inside always reminds or informs you that there are bigger and better things to worry about. "- Einstein


None

WolfAkela

Reply To Post Reply & Quote

Posted at: 12/10/08 09:11 AM

WolfAkela LIGHT LEVEL 08

Sign-Up: 12/19/05

Posts: 2,327

attachMovie(libName, stageName, depth, {values});

Like

_root.attachMovie("libEnemy", "mcEnemy", _root.getNextHighestDepth, {_x: 100, _y: 100, _rotation: 100});

None

4urentertainment

Reply To Post Reply & Quote

Posted at: 12/10/08 09:13 AM

4urentertainment NEUTRAL LEVEL 13

Sign-Up: 08/01/08

Posts: 1,634

At 12/10/08 09:11 AM, WolfAkela wrote: attachMovie(libName, stageName, depth, {values});

Like

_root.attachMovie("libEnemy", "mcEnemy", _root.getNextHighestDepth, {_x: 100, _y: 100, _rotation: 100});

Hey it works! Thanks!

"When you look at yourself from a universal standpoint, something inside always reminds or informs you that there are bigger and better things to worry about. "- Einstein


None

4urentertainment

Reply To Post Reply & Quote

Posted at: 12/10/08 09:36 AM

4urentertainment NEUTRAL LEVEL 13

Sign-Up: 08/01/08

Posts: 1,634

Stupid question.....What's the depth? There only is X and Y in flash, left and right.....right?

"When you look at yourself from a universal standpoint, something inside always reminds or informs you that there are bigger and better things to worry about. "- Einstein


None

WolfAkela

Reply To Post Reply & Quote

Posted at: 12/10/08 09:46 AM

WolfAkela LIGHT LEVEL 08

Sign-Up: 12/19/05

Posts: 2,327

There IS depth.

It's like the order of how your MCs "stack" on top of each other. The higher the depth value, the "higher" it is placed. So if Object A has a depth of 500 and Object B has a depth of 1000, B is placed above A.

Only one MC can be placed in a a depth level. Depth ranges from -16536 something to some million values I forgot. _root.getNextHighestDepth() automatically retrieves the higehest positive depth for you.


All times are Eastern Standard Time (GMT -5) | Current Time: 01:29 AM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!