Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




[F8]Attaching A Movie Using A Linkage From Another Swf



Hi, I have an swf file loaded into level3, it contains a global array that is a string list of linkage titles of assets in the file. I want the file in level0 to use attachMovie and the global array to attach the assets in level3 to a movieclip on level0. It does not appear to work, any ideas?



FlashKit > Flash Help > Flash ActionScript
Posted on: 10-29-2006, 06:15 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

[F8] Attaching + Linkage + Images XML?
Hi,

I'm making a Flash Cover Flow web page. What I do is use a for loop to set the linkage with my Mc [i] from the library, but somehow it doesn't get loaded in. I'm not sure if you can use linkage and XML to do this.

When I do get the images loaded in I lose the ability to import my reflection class and my rotation.

Can someone please explain or help me out. It would be greatly appreciated.

This is my XML and my for loop that attaches MovieClip.


Code:
var x:XML = new XML();
x.ignoreWhite = true;

var urls:Array = new Array();
var captions:Array = new Array();
var whoIsOn:Number = 0;

x.onLoad = function(success) {
var number:Array = this.firstChild.childNodes;
for(i=0;i<number.length;i++) {
urls.push(number[i].attributes.url);
captions.push(number[i].attributes.caption);
trace(urls[i]);
trace(captions[i]);
mc = this.createEmptyMovieClip("mc_"+i, i);

}

Download_On_Itunes.caption.text = captions[0];
mc.attachMovie("my_mc"+((i%12)+1),"urls"+([i]+1),1);
whoIsOn = 0;

}

x.load("gallery.xml");

//PRESET---------------------------------------
var home = this;
var refArray:Array = new Array();
var loopArray:Array = new Array();
//INIT-----------------------------------------
for (var i = 0; i<num; i++) {
mc = this.createEmptyMovieClip("mc_"+i, i); // THIS ONE I COMMENT OUT AND NOTHING WORKS

mc.attachMovie("my_mc"+((i%12)+1),"urls"+([i]+1),1);

Download_On_Itunes.author.text = linkArrayTitle[0];// Place text inside Download_On_Itunes.author.text for the first time only

mc.index = i;

//Numbering for debug
var ref:ReflectionFlipper = new ReflectionFlipper(mc, 3, backgroundColor);
refArray.push(ref);

// MC Fuse

if (mc.index<=lastP) {//set MCs position if they are allowed to show up. And Fuse them.
mc._x = this["guideLine"+i]._x;
loopArray.push(mc);

if (mc.index == centerP) {
mc._xscale = mc._yscale=0;
mc.scaleTo(scaleVal,.5,easingType,.5,{startfunc:'calcRotation', startargs:mc});
Download_On_Itunes.swapDepths(this.getNextHighestDepth());
Download_On_Itunes.captions.swapDepths(this.getNextHighestDepth());
} else {
mc.tintTo(backgroundColor,tintVal,0,easingType);
}
} else {
mc.tintTo(backgroundColor,tintVal,0,easingType);
mc._visible = false;

// set invisible MC in deeper Level.
mc.swapDepths(-1*mc.index);
}
//Y MC

mc._y = yLevel;//set all MC's _y position
// MC
//
calcRotation(mc);
mc.onPress = function() {
home.sequenceFlg = true;
sequenceSlide(this);
};
//
//MC in both sides are invisible
if (i<1 || i>=lastP) {
mc._alpha = 0;
mc._visible = 0;
}
}
for (var q = 0; q<num; q++) {

mc.attachBitmap("my_mc"+((q%12)+1),"urls"+([q]+1),1);
}

for (b=1; b<=12; b++) {
this["btn"+b].index = b;
this["btn"+b].onPress = function() {
home.sequenceFlg = true;
if (home["mc_"+(this.index-1)]._alpha == 100) {
sequenceSlide(home["mc_"+(this.index-1)]);
} else {
sequenceSlide(home["mc_"+(this.index+12-1)]);
}
};
}

I've also attached the files. Please Click Here

Attaching Dynamic Movie Clips On A Stage Movie Clip
Hi guys ,

I am calling more images in dynamic movieclip on the stage from XML file and show them on the stage after that evry movieclip is draggable and there is lots of labels (movieclips) on which i have to drag the images called from xml files and placed on that label , label is also draggable once when i placed object on the label moviecli then when i drag the label all images placed in side the label should also move with the label .

And there might be more labels and more images , i can place any images in a label or more images on different label but will work siimilarly described above .

So please suggest me and help me out ASAP.

Help With Movie Clips Linkage
Hi - I'm relatively new to Flash but love it!! I would REALLY appreciate any help with this problem. I have a movie with the main menu system on the left containing 4 buttons. This menu is a movie clip placed onto the main stage. The main viewing area is in the centre where the info is displayed.
When the user rolls over one of the menu buttons the menu drops down with more buttons appearing in the menu, basically tweening to another point in the movie clip. I'm trying to get the buttons to link to other scenes but when clicked they just start the movie clip playing again!!
The web address is dizzy-heights.fsnet.co.uk so you can see what I mean. The buttons aren't "wired up" as such at the moment, but you'll see the drop down effect. The effect I'm after is for the text in the main viewing area to change when a menu button is clicked.
Hope you understand what I'm on about.
Cheers,
Si.

Flash Movie Linkage
Hey.

When you publish a new Flash .swf and .html file, the format expects both the Flash file and the HTML file to be together.

I need to save bandwidth on my webserver, so I was wondering. Is there a way to load Flash movies into an HTML file from an external server and play them from there? I'm just thinking of using my free, unlimited bandwidth server for hosting them, and then using my low-bandwidth dot com for viewing them. (If there is a way, would it also use up bandwidth on my dot com?)

If you could get back to me, it'd be appreciated.

>> Help Me << Linkage In Movie Clips
Hello, I've made a movie clip as a navigator inside the flash doc, but Im trying to link scenes and its not working.. Anyone know how too?

--james.

Movie Linkage For A Beginner...
Whereabouts do I put the movie label so that it can be referred to in actionscript?

For example I have a main page with actions on it and a library that contains a movie called: mymovie

How do I put the following without getting a '1120: access of undefined property mymovie' error?

Thanks







Attach Code

mymovie.stop();

How To Linkage Movie Clips?
hello,

I wanna know how to lingage moviclips. I attache some example.

you have in same layer three different movie clips, but they have to have a same color of background. The color of background is change with color picker.
What color is first movie clip, all movie clips in same layer has to have that color.

bye,
kicho

Movie Clip Linkage
Hi

I not sure if I'm doing this right. I have a holder movie on my timeline called "background".
When entering a certain frame I want this background movie clip to be replaced with one linked in the library. This is what I have in the frame but its not working.

this.background.attachMovie("shop_bg", "deafwife_bg", 1);

deafwife_bg is the linkage name.

Am I doing something wrong? Cheers in advance

Preloading A Movie That Uses Linkage
Hi there all you guys!
I have this movie in which I load from the library 20 mp3s using Linkage. Everything works fine. If I add the preloader these mp3s will load on the first frame so normally that my preloader won't start from the begining it actually starts from 47%.

I did another movie that has a blank container that loads that big swf into and I use this movie as preloader...clasic solve to the linkage things preloding.

But now I have another problem...my sounds don't start. So if I won't use this new movie as preloader all the sound work just fine but the preloader doesn't . If I use the new movie to preload the preloader is just fine but the sound won't start.

Code used to add a sound object (in the main movie):

Scene5_sound = new Sound();
if (Scene5snd_playing!=true) {
    Scene5snd_playing=true;
    Scene5_sound.attachSound("Scene5Snd");    
    Scene5_sound.start(0,1);
    if(_global.audio=="on"){
        Scene5_sound.setVolume(70);                    
    }
    else{
        Scene5_sound.setVolume(0);
    }
    }

1. Movie (in which I have the sounds) structure:
_root.main_mc so all the content is in a movie that is on the first frame.

2. Preloader movie has a container_mc (instance name) with this clasic code:

total=_root.container_mc.getBytesTotal();
loaded=_root.container_mc.getBytesLoaded();
kbloaded=int(loaded/total*100);
if(kbloaded==100){
    gotoAndPlay(22);    
}

percentage=Math.round(_root.container_mc.getBytesLoaded()/_root.container_mc.getBytesTotal()*100);

So basicaly my question is why all the sound are not working when using the new movie as preloader...to solve the linkage preload case.

Thanks a lot!
Dragos.


 

Regards,
Dragos.




Preloader For A Movie With Linkage
Hello,

I understand that the best way to create a preloader for a movie that uses linkage is to load this movie through another movie that will contain the preloader..

Does anyone have a link to an example of that?

Thanks,
Y.

Attaching Several Movie Clips Into A Movie Clip...
Hi;

I'm trying to attach several movie clips into another movie clip. I can add the movie clips successfully . However, the movie clips start from the middle of the main movie clip that I used as the background layer for the other movie clips. Is there any way to make it located to the top left? Here is the code I used:


Code:
Layer_Movie.attachMovie("NumberTop","num",depth,{ _x: scol + (col * 32), _y: scol - 32 });
scol and srow are the attributes that represents the starting locations from the left and top. (I used 10 for the variables scol and srow the movie should be located 10 pixels away from the top and left) 32 is the height and also width of the movie clip to be added.

Is it hopeless? (I know sometimes actionscript is not so powerful to implement such kind of processes. Since I have not time to wait for the another version of actionscript, I must find a solution for that problem)

Please help...

Attaching Several Movie Clips Into A Movie Clip...
Hi;

I'm trying to attach several movie clips into another movie clip. I can add the movie clips successfully . However, the movie clips start from the middle of the main movie clip that I used as the background layer for the other movie clips. Is there any way to make it located to the top left? Here is the code I used:


Code:
Layer_Movie.attachMovie("NumberTop","num",depth,{ _x: scol + (col * 32), _y: scol - 32 });
scol and srow are the attributes that represents the starting locations from the left and top. (I used 10 for the variables scol and srow the movie should be located 10 pixels away from the top and left) 32 is the height and also width of the movie clip to be added.

Is it hopeless? (I know sometimes actionscript is not so powerful to implement such kind of processes. Since I have not time to wait for the another version of actionscript, I must find a solution for that problem)

Please help...

Attaching Movie Clips To Another Movie Clip
I'm attaching (and then removing) relevant movie clips to an empty movie clip that is shown in a scrollpane. It all works fine when triggered from buttons, but when the flash file is first loaded no clip is attached and thus nothing is displayed in the scrollpane. What am I doing wrong?

This is the function I trigger through the buttons and when the file is first loaded:
function loadScroll(the_page)
{
//create delay for component to initialize
i = 1;
this.onEnterFrame = function()
{
i++;

if (i>5)
{
switch (the_page)
{
case "xmlGallery.html":
empty_mc.testreal_mc.removeMovieClip();
empty_mc.attachMovie("gallery", "galleryreal_mc", empty_mc.getNextHighestDepth());
scrollpane.invalidate();
break;
default:
empty_mc.galleryreal_mc.removeMovieClip();
empty_mc.attachMovie("test_mc", "testreal_mc", empty_mc.getNextHighestDepth());
empty_mc.testreal_mc.myTable.createTable(the_page) ;
scrollpane.invalidate();
}
delete this.onEnterFrame;
}
};
test_mc.myTable.onTableRendered = function()
{
scrollpane.hScrollPolicy = "false";
};

loadPicture();
}

Linkage And Movie Load Issues
I have a movie with a basic "loading..." animation at the beginning. However, I also have linked audio files (I have linked them in order to control them - start, stop, volume).

The problem is, with those sounds linked, the "loading" animation doesn't show up on the screen until the 80-90% of the entire movie is loaded.

If I unlink them and drag them to the stage (which diminishes the level of control I have over their playback), the "loading" animation pops up immediately.

Is this a known problem? Is there a workaround? Any help is greatly appreciated!!!

Load Movie With Linkage Movies
this is my problem:

I want to load an external swf that contains several movieclips with linkage, export on first frame.
that works, and I can also use attachMovie in the main swf, but only on the movie where the external swf was loaded in.
question: how can I display those movies (with the linkage) in an other movie in the main swf??

(hope you can picture what I mean)

thnx?!

mark

Attach Movie Linkage Problem
I've got a movie clip with a nav bar and the idea is that two of the buttons are supposed to attach a movie at level 1. So one should cancel the other load when loaded. Right. Problem is that for some reason, the first button is fine but the second one is loading the same linked mc as the first even though the linkage is different and never calls that movie clip. Actually the first time the second button is clicked, nothing happens at all. Only after I click the first button and THEN the second button does anything happen.

Here's my code:

stop();
cd_btn.onRelease = function(){
attachMovie("cdsub_mc", "sub_mc", 1);
sub_mc._x = 0;
sub_mc._y = 0;
}
downloads_btn.onRelease = function(){
attachMovie("dsub_mc", "sub_mc", 1);
sub_mc._x = 0;
sub_mc._y = 50;
}

Target Linkage Movie Clip
Hi guys,

Does anyone know how to target the linkage movie clips?
For instance, I have a component that has three children. Each children is associated with a linkage movie clip. And I have a button (named btn) in that linkage movie clip.

Then the component is loaded to level 10.

I used (for example):

_level10.child1.btn._visible=true;

but it didn't work, does anyone have a clue?

Attaching A Movie
Hey guys, i've got a prob and i'm totally stumped
instead of trying to confuse everyone with a long winded description, i'll just poste the code and my prob.


Code:
onClipEvent(load){
max=4
i=0
px =260
py =0
}
onClipEvent(enterFrame){
if(i < max){
j="jeep"+ i
jimg =j+".jpg"
jlnk = "jeeppics/" + jimg
attachMovie("Misc","misc"+i,10+i)
mov="misc"+i
mov._x= px+10
mov._y = py
px += 100
i ++

}
}
ok basically, it loops throu 4 at a time, and should place the mc's 10 px apart, but when i "trace(mov._x)" i get undefined. Now if i change "Mov._x.." to read "misc0._x=..." it sticks it in its place. Otherwise, it seems like the mc's just pile up on eachother. any help would be great!
thanks a bunch

Attaching Movie
Hi,

I want to Attach lots of movie clips, to another movie clip. But I only want them to be attached to the 2nd frame of the parent clip, if that makes any sense, so I can jump to the 1st frame of the parent clip, which will be blank to turn them off, how would you do that?

I've tried putting another clip on the 2nd frame of the parent clip, and then attaching them all to that clip on the 2nd frame, but it doesn't work.

thanks

phil.

Attaching A Movie
hello, i'm a begginer in flash and would like to know how to attach a movie clip like that "grass fiel" thing into a regular 800x600 page and placing wherever you want. please help me out with it. thank you!

Can I Open A Movie Symbol Using The Linkage Properites?
Is there a way to open a movie symbol with a button using the linkage properties in the library? Is that the reason for the linkage so you don't have to load a swf? I just have a movie that is not showing but then want to load it on screen. I'd rather not use the alpha to show it as not visible either. My main concern is seeing what you can do with the whole linkage thing. Thanks

Removing Attached (linkage) Movie Clip
hi, need a help
i have attached my work file

actully i am trying to draw continues line one point to another by mouse click , and each points there will be a round shape(using linkage library method) with the mouse click .

the lines all are removed by this (_root.newgrid1.clear()) method.

the problem is that i was only able to remove one round shape from the stage using remove movie clip method,

how can i remove all the attached movie by the reset button from newgrid2?

-----------------------------------------------------------------------


This is the method i used to attach movie from library

var _loc3 = _root.newgrid2.attachMovie(color, "obj" + objCountx, objCountx);
--------------------------------------------------------------------------


################################################## ##
this is the method i used to remove the clip

_root.reset.onRelease = function () {

_root.newgrid1.clear();
_root.newgrid2.clear();

removeMovieClip(newgrid1);
removeMovieClip(newgrid2);

for (n in _root)
{

removeMovieClip (_root[n]);

}

}
################################################

[CS3] Linkage Identifier And Embedded Movie Clips
I would appreciate if anyone could help with the problem I am having referencing a linked movieclip.

I have a scroll pane with the instance name menuScroll. The scrollPane loads a linked movie clip called menuDropMC with the same instance name. MenuDropMC also loads several instances of a linked movie clip called moduleNameMC with the same instance name. The moduleNameMC contains a button called moduleBtn. I am trying to disable this button from root.

The moduleNameMCs are generated dynamically and are followed by a number using a for loop.("moduleNameMC"+i)

e.g. moduleNameMC0, moduleNameMC1, moduleNameMC2, etc.

I have tried the following:

_root.menuScroll.menuDropMC.moduleNameMC0.moduleBt n.enabled = false;
menuScroll.menuDropMC.moduleNameMC0.moduleBtn.enab led = false;
menuDropMC.moduleNameMC0.moduleBtn.enabled = false;
moduleNameMC0.moduleBtn.enabled = false;

Thanks in advance.

Loading Image And Creating Movie With Linkage
Hey,

I'm kind of new to flash.
I would like to know how I can load image from either library or exterenal directory and then create a movie with linkage identifier. Everythig of course in actionscript.

Thanks.

Removing Attached (linkage) Movie Clip
hi, need a help

i am trying to draw continues line one point to another by mouse click , and each points there will be a round shape(using linkage library method) with the mouse click .

the lines all are removed by this (_root.newgrid1.clear()) method.

the problem is that i was only able to remove one round shape from the stage using remove movie clip method,

how can i remove all the attached movie by the reset button from newgrid2?

-----------------------------------------------------------------------


This is the method i used to attach movie from library

var _loc3 = _root.newgrid2.attachMovie(color, "obj" + objCountx, objCountx);
--------------------------------------------------------------------------


################################################## ##
this is the method i used to remove the clip

_root.reset.onRelease = function () {

_root.newgrid1.clear();
_root.newgrid2.clear();

removeMovieClip(newgrid1);
removeMovieClip(newgrid2);

for (n in _root)
{

removeMovieClip (_root[n]);

}

}
################################################

Error Message On Linkage Of Quicktime Movie
when i try publishing my flash file into a quicktime .mov (i have a quicktime movie in my flash file that is LINKED not embedded) i get an error saying :
"The installed verision of QuickTime does not have a handler for this type of Macromedia Flash movie. Please consult the documentation for further information"
what does this mean and how do i fix it?
I could embedd the movie but, my file size becomes prohibitively large (12.3 mbs) can anyone help?

Linkage Identifier And Embedded Movie Clips
I would appreciate if anyone could help with the problem I am having referencing a linked movieclip.

I have a scroll pane with the instance name menuScroll. The scrollPane loads a linked movie clip called menuDropMC with the same instance name. MenuDropMC also loads several instances of a linked movie clip called moduleNameMC with the same instance name. The moduleNameMC contains a button called moduleBtn. I am trying to disable this button from root.

The moduleNameMCs are generated dynamically and are followed by a number using a for loop.("moduleNameMC"+i)

e.g. moduleNameMC0, moduleNameMC1, moduleNameMC2, etc.

I have tried the following:

_root.menuScroll.menuDropMC.moduleNameMC0.moduleBt n.enabled = false;
menuScroll.menuDropMC.moduleNameMC0.moduleBtn.enab led = false;
menuDropMC.moduleNameMC0.moduleBtn.enabled = false;
moduleNameMC0.moduleBtn.enabled = false;

Thanks in advance.

Error Message On Linkage Of Quicktime Movie
when i try publishing my flash file into a quicktime .mov (i have a quicktime movie in my flash file that is LINKED not embedded) i get an error saying :
"The installed verision of QuickTime does not have a handler for this type of Macromedia Flash movie. Please consult the documentation for further information"
what does this mean and how do i fix it?
I could embedd the movie but, my file size becomes prohibitively large (12.3 mbs) can anyone help?

HELP NEEDED ON ATTACHING MOVIE
I just started to build a flash site and used swish program for typing effects on the site but when I import long paragraphs into the symbol library with the effect "typewriting" from swish there seems to be no problem but when I try to drag the symbol into the movie it says flash is out of memory ...I am not good at actions but I think there is a way to insert a swf file "into" the movie so that I can put the movie clip wherever I wanted in the main movie so my question is "is there a way to put a swf file in a movie without turning it into frames/fla file?"
my e-mail: baykush@turk.net

Attaching A Movie Hell
I have a MC which is my Navagation bar. The buttons use actionscript to attach one MC to another MC in my main time line. Can this be done? this is the code I have so far.

The code belongs to a button in my navagation MC called "screen1"
"TheClip" is an empty MC - located on the main time line.
"Design" is the MC I want to attach to "TheClip"

on (release) {
_root.TheClip.attachMovie( "Design","Design1", 1);
_root.TheClip.Design1._x = -275;
_root.TheClip.Design1._y = -15;
}

The code works fine if the button it is attached to is on the main timeline.

Attaching Preloader To Movie
I've created a separate movie called preloader.

How do I attach this to the movie that I want to preload???

Thanks,

ww

Attaching Flash Movie
How do I attach my Flash movie to my post?

I want to put my first Flash movie as a link in my post to have you all give me input, but don't know how to attach it to my post.


Any help will be appreciated.
Thanks

Attaching Mc's From A Loaded Movie?
If I load a movie into my main movie. Can I then use attachMovie from my main movie to dynamically add movie clips from symbols in the loaded movie.

In other words I have main.swf which loads child.swf into mc holder, using loadMovie(). Child.swf contains symbol xyz with linkage abc.

Later can I then use attachMovie to pull xyz into a clip in main.swf, like this, display is a clip on the _root of main.swf

display.attachMovie("abc", 500);

I've tried this but it didn't seem to work. And, yes child.swf had loaded previously in a prior statement block.

I read that movies cannot access symbols from other movies libraries, does that prevent this from working?

Thanks,
Doug

Attaching A Movie Clip
To make it plain and simple this is what I want to do...
I want to click on a button, and a movie clip called CONTACT will play...
Then have an X in the movie clip to unattach itself..

Any advice or help please...

Attaching A Movie...and Instances
When I attach a movie using a loop,that has another movieclip under it testing for on press and trace(this); after the name is instance 1,the next time it is instance 34,instance 67 etc..how do I get rid of that ?
I'm testing for information using this.something and assign it when the movie is attached, that is why I want to get rid of it...

Thanks

Attaching Movie To Email
you know when you get an email, in outlook express, and the .swf is playing in the body of the mail......... how do you do this?

Attaching External Movie
I want to attach an external .swf file to my main movie. How can I do it. I want to load the movie and then attatch it at a specific point on the page. I have been using the following script to attatch movie clips but they are internal, not external.


Quote:




on (rollOver) {
_root.content.attachMovie("portfolio", "work", 1);
}




Thanks.

Attaching 2nd Movie To Start After The 1st?
I've attached a movie and would like to attach a 2nd after the 1st ends.
as i'm simple the only way i thought of doing it was to start the 2nd movie on the same number of frames as are in the 1st one. however i want it to continue playing without a big pause.

thanks

Attaching Movie Clip
_parent.picture.attachMovie(newsIll, "illustration", place);

buttonClip.newsIll is a variable with a value of familyPic.... familyPic is the identifier for a clip in the library....

newsIll's value changes to different values in an array as a button is duplicated, so the picture can change with diffent buttons pressed.... what's wrong with my syntax? its got to be something simple because if I change that line of script where is says newsIll to just say "familyPic" it attaches the movie just fine... can anyone help?

Attaching A Movie To A Button
I am working on a RPG game for my final project. I have all of the coding done for the buttons, but I can not figure out how to have the mc animations to play when you press the button. The project is due Monday and it is a pass or fail for my graduation. If you feel you have the solution, please post it or email me directly. Thanks in advance!!!

Olyx

[F8] Help With Attaching A Movie Clip
I can't figure out how to attach a movie clip. Could someone please help explain this/show me how to? I looked in the help files but that didn't help at all.

Could someone show me with this fla how to attach a movie clip in the library on the screen somewhere please?

Attaching Movie Clip?
Hi,

Many internet games have this effect:

When you walk near someone, a box comes up and something inside that box is written (static text box). There is no motion tween, just appears and dissapears.
Would you use the attachMovieClip function and if there is one, the remove moviclip function???

Thanks,
grimreaper

Attaching Two Movie Clips?
Effect trying to attempt: a spillage of different types of objects falling and bouncing around

Issue: I can only get one movie clip (object) to show up in the scene. For example in the coding shown below, only 'a' will appear...

_root.total=50;

for (i=1;i<_root.total;i++){
_root.attachMovie("a","a"+i,i+1); // 'a' is the linkage name for object 1
_root.attachMovie("b","b"+i,i+1); // 'b' is the linkage name object 2
}

Please let me know if you need more information....thanks.

Attaching Movie Clips
Heres my code that creates a movie clip then attaches a movieclip to this.

Code:
this.createEmptyMovieClip("bg", 1)
block1 = bg.attachMovie("block", "block1", _root.getNextHighestDepth());
block1._x = Stage.width/2

this works fine.
But when I try to attach another one to this movieClip it destroys the last one:

Code:
block2 = bg.attachMovie("block", "block2", _root.getNextHighestDepth());
block2._x = Stage.width/3

How do I create a movieclip and put both of these movieclips in them?

Loading / Attaching Movie
hi guys,

I am trying to load a movie at a particular level .. using the following script, but it is not working.


Code:
loadMovieNum("a.swf", 2);
I tried hard to make this code working but failed, then i though may be i should use "loadMovie" to load "a.swf" at the target DUMMY movie. for this i did this...

at the first frame of my movie i wrote


Code:
_root.attachMovie("bg", "bg", 2);
the code worked fine and the movieClip "bg" was loaded from library to the stage, but it was loaded at level0 ... instead of level2.

and then when i used loadMovie for this target movie ... it occupied the "root" which it should be.

can you people help me to load the movie at some other level ... i am sucked by AS-2 to load a movie.

HELP Attaching Movie Clips
Hi,

I'm trying to use the attachMovie command, I've been playing with the tutorial here on it but I'm stumped at this point.

1: If you look at this tutorial and download the FLA you will see every time you click one of the buttons an instance of a MC will appear on stage.
Then if you click it again the old one disappears and the new instance appears. I want the old instance to stay on screen and add another instance on top.
http://www.actionscript.org/tutorial...ie/index.shtml

2: Is it possible to attach actionscript to these instances when t hey appear on stage. I would, for example like them to be draggable and attach this code.

ActionScript Code:
onClipEvent (mouseDown) {
    if (this.hitTest(_root._xmouse, _root._ymouse)) {
        this.startDrag();
}}

onClipEvent (mouseUp) {
    if (this.hitTest(_root._xmouse, _root._ymouse)) {
        this.stopDrag();
}}
any help???
Thanks Thanks Thanks.

Attaching Movie Clips
Hi,

I have this code I want to modify so that I can attach different movie clips in my library to appear randomly on the stage (right now this attaches words created in the actionscript... I tried a few things and they didn't work):

// register root as environment
Object.environment = this;

// create camera object
this.cam = {x:0, y:0, z:900, dx:0, dy:0, dz:90};

// set environmental constants
this.fl = 800;

// create 'space' to which all words will be attached
this.createEmptyMovieClip("space", 1);
// center 'space' on the stage
space._x=500;
space._y=300;

// a string of words related to the wind
this.somewords = "wind breeze storm stormy blah blah test";
// convert the string of words into an array of words
this.wordList = new Array();
this.wordList = this.somewords.split(" ");

// create one instance for each word in the list
for (n=0;n<this.wordList.length;n++) {
// pick a word from the list
var word = Object.environment.wordList[n];
var x = random(1000)-100;
var y = random(400)-169;
var z = random(Object.environment.fl*2)-Object.environment.fl;

// create an instance of the SpaceWord object
nombre = "word"+String(depth++);
initialization = {txtword: word, x: x, y: y, z: z};
space.attachMovie("movie1", nombre, depth, initialization);
}

this.onEnterFrame = function() {
this.cam.dz+=.5;
// move the camera to its destination
this.cam.x+=(this.cam.dx-this.cam.x)/5;
this.cam.y+=(this.cam.dy-this.cam.y)/5;
this.cam.z+=(this.cam.dz-this.cam.z)/10;
}

stop();

Attaching Movie Clips
Hey dose anybody know how to do it so that you have one movie clips which stays with another one but has its own action, (eg. when you shoot a gun and the bullet comes out the bullet dose not move with the guy) i want to do the on a frame eg.

if (_root.rand=1) {
if (Key.isDown(Key.SPACE)) {
gotoAndStop("bulletframe")
}
}

i have tried the aligning way with the _x and _y axes, but the wont work because the bullet needs to come out were the car is facing.

Thanks for the help

Tom

Attaching Movie Clip
Hai
I am arul new to forum. i need a little help

I want to attach a movieclip into the scene. so i made a movieclip called ball.
and added the linkage as 'ball' and also checked the option 'export in firstframe'. It is working fine.

But i want to attach a moviclip without making it to export in firstframe since it take a lots of time to proceed since movieclip is so big. so i want to attach movie without making it to export in firstframe

Thank U
arul

Copyright © 2005-08 www.BigResource.com, All rights reserved