Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

How do you dynamically attach an external movie clip?

Posted on 2008-06-11
5
184 Views
Last Modified: 2010-04-03
Is this possible?

1. Create an empty movie clip called clip_1
2. Load an external movie into clip_1
3. Create another empty movie clip called clip_2
4. Use attachMovie to attach clip1 to clip_2

I don't get any errors, but it doesn't seem to work.

_root.createEmptyMovieClip("clip_1",_root.getNextHighestDepth());
_root.loadMovie("whatever.swf",_root.clip_1);
_root.createEmptyMovieClip("clip_2",_root.getNextHighestDepth());
_root.clip_2.attachMovie(clip_1,"new_clip",_root.getNextHighestDepth());

Since clip_1 was created at runtime, is there anyway to dynamically assign it the "Export for Actionscript" property and give it a linkage identifier?
0
Comment
Question by:section25
  • 3
  • 2
5 Comments
 
LVL 12

Expert Comment

by:SamuelRostol
ID: 21761387
I'm in a hurry, so this is a quick responce, but try this:


_root.createEmptyMovieClip("clip_1",_root.getNextHighestDepth());
_root.clip_1.loadMovie("whatever.swf",_root.clip_1.getNextHighestDepth());
_root.clip_1.createEmptyMovieClip("clip_2",_root.clip_1.getNextHighestDepth());

Open in new window

0
 
LVL 8

Author Comment

by:section25
ID: 21761492
Thanks, but no. That doesn't really work. That just creates an empty clip named clip_2 inside of clip_1. I need to actually attach clip_1 to clip_2.
0
 
LVL 12

Expert Comment

by:SamuelRostol
ID: 21766743
What do you mean by "attach"?

The following code should create 'clip_2', and then add 'clip_1' within it, and attach the "whatever.swf" clip to clip_1. Is this what you mean?
_root.createEmptyMovieClip("clip_2",_root.getNextHighestDepth());
_root.clip_2.createEmptyMovieClip("clip_1",_root.clip_2.getNextHighestDepth());
_root.clip_2.clip_1.loadMovie("whatever.swf",_root.clip_2.clip_1.getNextHighestDepth());

Open in new window

0
 
LVL 8

Accepted Solution

by:
section25 earned 0 total points
ID: 21768491
When you use attachMovie(), it gives the attached movie an identifier that is set in the linkage properties of the library. I need to use this identifier when referring to the movie. Therefore, just creating one clip inside another, does not give the same results as using the attachMovie() command.

From what I have read on the internet since I have posted this question, it does not look like it is going to be possible. Apparently, the attachMovie() command only works with assets that are stored in the library.

So unless someone has actually accomplished this, I'll probably just have to admit defeat.

Thanks.
0
 
LVL 12

Expert Comment

by:SamuelRostol
ID: 21768557
The attachMovie command only works with library-content, that's true - but why are you trying to accomplish this? What is the effect you are trying to get out of this?
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
The goal of the tutorial is to teach the user how to how to load their YouTube profile onto Flash Media Live Encoder.
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question