PDA

View Full Version : Loading mc's from the library



schling
May 27th, 2003, 10:24 AM
Hi

I want to load a mc's with a button click from the library.

Anyone know of a tutorial for it? Or know how how do it?

kode
May 27th, 2003, 10:30 AM
MovieClip.attachMovie (http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary508.html). ;)

schling
May 27th, 2003, 11:43 AM
hum....

Could you please show me an exampel of how that code works. The exampel in the help file wasn't that good.

nobody
May 27th, 2003, 11:48 AM
well first you have to go into your library and find the movie clip, select export for actionscript and give it a linkage name.

so then it will end up looking like this

linkageName.attachMovie
or

attachMovie("linkageName", linkageName1, 1)

I'm pretty sure that is how it should look

schling
May 27th, 2003, 12:49 PM
Yeah :-D Manged to get it to open it self.
But how do I deside the coordinates for it to open? And can I attach codes to it because I want a drag and drop function on it.

lostinbeta
May 27th, 2003, 12:51 PM
MovieClip.attachMovie in kax's post is a link ;)

nobody
May 27th, 2003, 12:52 PM
ohhhhhh

well now i feel dumb

schling
May 27th, 2003, 12:55 PM
lostinbeta. Yeah I did take a look at that link but that help file only helped me a bit. Didn't know I had to cross that export to actionscript thing. Didn't even know about it until today ;-)

schling
May 27th, 2003, 01:16 PM
If you take a look at

www.ide***.no/~djensen

Press "Who am I?" and the mc should attach itself. But places itself up the top left corner.

kode
May 27th, 2003, 01:41 PM
here you go. ;)

schling
May 27th, 2003, 01:52 PM
Nice ;-) Very nice Kax. I owe you again.
Were did you learn all this action script? And are you really from Mexico?

kode
May 27th, 2003, 01:58 PM
you're welcome. ;)

q: where did you learn all this actionscript?
a: mostly from here, kirupa.com. =)

q: and are you really from mexico?
a: yeah! why would i lie about that!? :P

schling
May 27th, 2003, 02:33 PM
That's strange....

I ran into a little problem here. You script works fine. I take parts of that into my own. Putting the code into the button and change it a bit. Everything worked expect the coordinates. So I tried useing your code, pasting the code into the timeline. But the coordinates still wouldn't work :-(

What could be wrong? Even with the same code it won't work.

kode
May 27th, 2003, 02:37 PM
:stunned:

no idea. :P
why don't you attach your .fla so i can check it out... ? :)

schling
May 27th, 2003, 02:41 PM
Here it is. Starts on frame 3

kode
May 27th, 2003, 02:45 PM
ehmm... where is it? :P

schling
May 27th, 2003, 02:49 PM
Let me try this again then :-\

schling
May 27th, 2003, 02:50 PM
Well, it seems like I can't attach files....
isn't 10Mb the limit here?

kode
May 27th, 2003, 02:55 PM
i don't know about the size limit...

i guess you could upload it to your server then... ;)

schling
May 27th, 2003, 03:02 PM
Okey. Apperently I'm only getting problems today.

The swf file get's the error message that it's to big to post (337kb). And the fla file won't be uploaded to the web.

But can't you download the swf file from my webpage and open it in flash?

kode
May 27th, 2003, 03:08 PM
But can't you download the swf file from my webpage and open it in flash?
nope... :-\

and...

And the fla file won't be uploaded to the web.
may i know why? :crazy:

schling
May 27th, 2003, 03:11 PM
Okey :-(
Well, I'll just try and build my flash file from scratch with your code. Maybe I will have better luck then. Sometimes it seems like flash just don't want that code to work in your file. Strange since it works without anyproblems in your file.....

Thanks anyway Kax :-) you are truly a nice guy (atleast I think you a are guy)

kode
May 27th, 2003, 03:17 PM
well, i'm sorry that i couldn't help you more. :-\

and yes, that's correct. i'm a nice, smart, handsome and helpful guy (oh! and modest too). :P ;)

schling
May 27th, 2003, 03:36 PM
I figured it out. You had your mc's as movieclips while I hade them as buttons. I belive some of the codes you used didn't work on buttons. But now everything works fine :-D Again, thanks.

kode
May 27th, 2003, 04:16 PM
ok... no problem. =)