|
-
loadmovie on variable targets?
Hi Guys,
I'm using the following code to load a variable target into a variable movieclip.
targetClip = "center"
targetSWF = "myimage.jpg"
_root[targetClip].loadMovie(targetSWF);
This works fine but I want to be able to load into childs of
movieClips like this
targetClip = "center.image"
targetSWF = "myimage.jpg"
_root[targetClip].loadMovie(targetSWF);
however that doesn't work!
Any good ideas for a solution?
//poden
-
Resident Shostakovich Scholar
This might work- I think it's just a question of collective synatx when all the expressions are put together:
path = eval("_root." + targetClip + "." + image);
//I assume 'image' is another var?
loadMovie(targetSWF, path);
..the point being that evaluating all the expressions into one, compact var, might help the targeting. Just a thought.
-
... that doesn't do the trick.
As far as I known the [] i used for concatenating strings/variables instead of using eval.
'Image' is a child clip to 'center'.
The problem is that I can't refer to child clips based on a variable.
targetClip = "center" // this works
targetClip = "center.image" // this doesn't work
//poden
-
targetClip = "center"
childClip = "image"
targetSWF = "myimage.jpg"
_root[targetClip][childClip].loadMovie(targetSWF);
have you tried that?
gparis
Last edited by gparis; 09-01-2003 at 12:05 PM.
-
Hi G,
well ... that should work!
The path to differnet clips is called defined from a VB application. So for architectural reasons I'd prefer if the path could be defined as 'simple' as absolutely possible.
I imagine that I perhaps could split the targetpath with "." as delimiter and then concatenate the path ... hmmm might work
thanks for the input
//poden
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|