AttachMovie Problem
I've tried to make this MC reproduce itself, but all that happens is the very first & the very last new_menu items get attached & I'm stuck without 3 of the five array Items. This is holding me up. I need help.
onClipEvent(load) { new_menu = new Array(); new_menu = ["a","b","c","d","e"]; for(var clp = 0; clp < this.new_menu.length; clp++) { new_clip = this.new_menu[clp]; attachMovie("mid_hex", new_clip, 6000 + clp); eval(new_clip)._x = this._x; eval(new_clip)._x += currX; eval(new_clip)._y = 0; currX = 250; } this._x= -200; }
FlashKit > Flash Help > Flash MX
Posted on: 07-11-2002, 08:07 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
AttachMovie() Within Another AttachMovie() Created Instance?
I'm still struggling away on my web site, but I've made quite a bit of progress and I think my code has cleaned up quite a bit. I still have the issue of not being able to attach my new content box movie clip when the button is pressed. I am successfully able to load the data for that instance of the tab, and can access the variables. It also is able to run the newContentBox() function inside it with success, but when it tries to run attachMovie(), nothing happens. Could this be a problem with my depth? Or is it my nesting?
I have been thinking about making a global variable for depth that will increment each time anything is created, so every movie clip is guaranteed to be on its own depth. Would this be a solution?
The site can be viewed here.
The source can be viewed here.
All the data files are located in that directory as well.
This is really driving me nuts, and I want to get something solved so I can move onto the submenu creation.
AttachMovie Inside Another AttachMovie
is it possible to attach a movieclip, and then attach another inside of it? i'm trying to load in images via using loadMovie and XML (a little background) i want the image to be dropped in to have a mask applied to it so that the image appears as a rounded rectangle... here's my code for the for loop that attaches the movie clips...
PHP Code:
for (i=1; i<=totalImages; i++) {
attachMovie("multiplebox", "box_"+i, i);
movieNamer=_root["box_"+i];
}
is it possible to attach a movie inside of 'box_"+i'?
AttachMovie Within An AttachMovie? Not Working
So I've finished a project (let's call it Project Blue) where I use attachMovie which references a folder (of swf's) to place each page of the swf. It worked fine. Next, I made a master 'shell' to place this project (among others) into. To do that I used attachMovie again to place Project Blue in the shell.
But now my attachMovie pages for Project Blue won't show up. Does Flash have a problem with using an attachMovie within an attachMovie?
Thanks for any insight on this....
AttachMovie Nested AttachMovie...
I have in the root timeline an empty movie clip that loads other movies inside of it. Using the attachMovie function.
Inside one of these attachMovie clips I have a nest "attachMovie" clip as well but for some odd reason it's not working. Is there anything I should be aware of when nesting an attached movie?
AttachMovie
I’m using the attachMovie command and I need to remove the attached movie. I’ve tried unloadMovie, removeMovieClip, delete, and unloadMovie. I can get the clip to do anything else. A friend suggested I try to delete a layer but I don’t know how. Oh this is the important part I need the script to be in the Movie Clip.
Thanks in advance,
Slow21969
AttachMovie HELP
Okay guys, I've been trying this code for literally 18 hours, with no luck at all. I know for some of you this is going to be a walk in the park, so please help me out.
All I want to do is have a blank stage. On frame 1 of this main stage, I want some sort of code that will attachMovie. I can get through there just fine. My problem is this. I to dynamically generate different pics.
I really don't care HOW you get the different pics in there, but I want my stage to start out blank, so I think the only way to do it is with attachMovie. I have a zip file at: http://www.skycastleprod.com/demo/help.zip where you can see something I made. In that file, I generated a button with different url links that it will call when it is clicked, and it also has a textbox that displays different words for each box. The thing is, that file used ONE smartclip, and that's it. With one smartclip I was able to generate buttons with different URLs, and a textbox that has different sayings. WHY CAN'T I GENERATE DIFFERENT PICTURES?!?!?!?!?!? this is driving me insane. I've lost so much sleep coz of this, and it's not even part of a project. It's become more of a personal thing now #$%#$%@$. PLEASE HELP
Riki
AttachMovie
How come when using a attachmovie action, it works fine and the attached MC loads, but doesn't when I save the file and publish the settings.
.attachMovie=help
i'm trying to make an image slider, first i duplicate and move the movie clip by getting coordinates form a dragged empty mc, setting an inverse motion, so if the mouse goes up the mc and duplicated mcs go down. It all works very well, until i try to attach movies to the duplicated movie clips. Is this possible to do? can i attach movie clips(in this case each containing a picture) to duplicated ones??
thanks in advance.
supakoma
AttachMovie
I've got a little problem because i don't know the exact syntax for adressing targets in "attachMovie" or in general.
The problem is in these lines:
Code:
if (k<20) {
star1.attachMovie(star_mother, _root.anfang_ani["star"+k], k );
_root.anfang_ani["star"+k].speed = 15;
for (i=2; i<k; i++){
if(_root.anfang_ani[star1].diffy >= 1500 && _root.anfang_ani["star"+i].diffy >= 1000){
setProperty (_root.anfang_ani[star1], _visible, 0 );
setProperty (_root.anfang_ani["star"+i], _visible, 0 );
gotoAndPlay("start");
}
}
}
else{
gotoAndPlay("start");
}
It'd be extremely nice if somebody could take a look and remind me of the correct syntax or paths.
Thanks in advance
Using Mc.attachMovie() Without The Mc. -Don't Do It
I just spent a lot of time debugging a game for something really stupid I did and I learned something new about mc.attachMovie().
You can do this: attachMovie()
instead of
_root.attachMovie
Don't do it. Always include specifically the movie this new attached movie is attaching to, even if it is only the original root movie you are working within.
If you don't specify the MC parent that will own it, Flash 5 (I don't know about other versions) will assume the parent for you. You would think it would be what ever _root movie the script lies in but it is not always true. If you have attached other movies on the fly, it can pick up on another attached movie that is currently recieving events.
-Wade
AttachMovie
I have a movie clip called Circle_01 its placed on the main timeline.
I want to keep creating new instances of this but cant seem to even get one to work.
Here is the code im using???????????
_root.attachMovie("_root.Circle_01", "_root.Circle_2", 1);
_root.Circle_2._x = 150;
_root.Circle_2._y = 150;
_root.Circle_2._alpha = 1;
_root.Circle_2.play();
XML - AttachMovie - ._X
Hello, the code benith means: taking from an XML file information to present buttons on the stage:
the XML loads good and the information comes ok, and every thing works well till the part where i'm trying to place them on the screen (inside the loop "for" inside the "if" part).
this code should draw 2 lines of buttons - if for example there r 3 buttons, it will draw 2 one next to the other, and the third will be benith them.
The code does the attach movie but does not react to the commands mc._x , also inside the mc taken from the library by the attach command there are var which suppose to get thier values from the xml file - the values from the xml are loaded ok but i didn't manage to pass the values into this vars.
so it's 2 problems i'm dealing with.
(i can send the fla - it's light)
-----------------------------------------------------------
QuickSurfMenu = new XML();
QuickSurfMenu.load("QuickSurf.xml");
QuickSurfMenu.onLoad = DrawQuickSurf;
function DrawQuickSurf () {
QuickSurfMainMenu = new Array();
QuickSurfMainMenu = QuickSurfMenu.firstChild.childNodes; //The array QuickSurfMainMenu holds in it the "children"=firstLevel
var numOfChild = QuickSurfMainMenu.length;
var topButtons = Math.ceil(numOfChild/2); //upperButtons = the num of buttons at the top
var topButtonXlocation = 35; //this are the coordinates for the buttons at the top
var topButtonYlocation = 100;
var bottomButtonXlocation = 68; //this are the coordinates for the buttons at the bottom
var bottomButtonYlocation = 113;
for (var i=0; i < numOfChild; i++){
var ButtonInstName = "QS" + (i+1);
attachMovie("BackButton", ButtonInstName, i+1); //BackButton= BackButton from the library
this.ButtonInstName.caption = QuickSurfMenu.firstChild.childNodes[i].attributes.caption;
this.ButtonInstName.url = QuickSurfMenu.firstChild.childNodes[i].attributes.url;
if (i < topButtons){ //location of top button
topButtonXlocation = topButtonXlocation + 65;
this.ButtonInstName._x = 100; //topButtonXlocation;
this.ButtonInstName._y = topButtonYlocation;
} else { //location of bottom button
bottomButtonXlocation = bottomButtonXlocation + 65;
this.ButtonInstName._x = bottomButtonXlocation;
this.ButtonInstName._y = bottomButtonYlocation;
}
}
}
-----------------------------------------------------------
Thanks in advance,
Maya.
AttachMovie
Problem:
When I drag a movie clip onto _root and give it an instance name, the movieclip has no problem functioning when running the movie.
But if I attachMovie the same movie clip from the library and give it the same instance name as above, it no longer works. (this is what I want it to do). I am swapping in and out movie clips using the attachMovie function.
Why does it work when it is on _root from the start, and not when it is attached? The actionscript inside the movie clip is exactly the same.
AttachMovie()
Hi!
I have a problem attaching a Movie to a nested clip.
The clip's position( that i want to attach the movie to) is inside a clip that is masked.
If I try this in the main timline with the main movie : no problem.
inside this clip(name= _root.egg_movie.subnavigation) nothing is attached. I call the function from a previous attached movie(=Item) button.
the script:
snip:
xxxx
function ShowSubMenu () {
XPosition = eval("_root.Menu" add CurrentMenu)._x+56;
for (Counter=0; Counter<_root.Sub[0].Items.Length; Counter++) {
XPosition = XPosition;
attachMovie("Item", "Subs" add Counter, 300+Counter);
eval("Subs" add Counter).Name = _root.Sub[0].Items[Counter];
eval("Subs" add Counter)._x = 50;
eval("Subs" add Counter)._y = 50;
XPosition = XPosition+60;
}
}
xxxx
snip end
thankyou for your help! be m
AttachMovie()
Is it possible to attach a movie to another attached movie? like this:
myMovie.attachMovie("attach", "attme", 1);
attme.attachMovie("attach", "attme1", 2);
??
AttachMovie
ive tried this so many times but I can't seem to get it right. First i tried attaching a movie with a button
Code:
on (release) {
_root.target.attachMovie("a", "line", 5 );
}
that is the code i put but it doesn't work. iv'e tried this without the quotes too."a" is the MC in the library and "line" is what i want theinstance to be, target is an empty MC on the movie..i don't know why this won't woirk...can anyone help me please?¿?¿
AttachMovie
Hi guys,
I'm using attach movie like this:
_level0.attachMovie("exportName", "instanceName", 1);
however, the MC is visible throughout the movie, and I want it to only be visible on the frame that I create it on. Is there an easy way (without explicitly using unloadMovie when I leave the frame) to make it only appear on that frame?
cheers,
Darkwhiteorange
Help With Attachmovie
If I ma using attachmovie, i need 3 bits of info, the oldname, the new name and the level. With the new ID, can I reference it as an instance?
And If attach command was in a movieclip with instance name of nav would i refence the attached movies as _root.nav.newid ?
If any can help, I would really appreciate it.
AttachMovie Help?
Hey, all, hope somebody can help!
I'm using the code below to try and add a pic from the library with the linkage name "key". I want it to appear on the stage, and then pull out another 4, side-by-side. Unfortunately, this code doesn't seem to do anything...and I don't know why or what I should be doing!
Thanks in advance!
for(i=0; i<5; i++){
xStart = 100;
yStart = 100;
keyName = "key" + i;
_root.attachMovie("key", "key"+i, i);
_root[keyName]._x = xStart + 50;
_root[keyName]._y = yStart;
}
AttachMovie
can you attach a MC in an other MC from another MC?
i.e.
Code:
this[someMC].otherMC.attachMovie("Name",newName,1);
I can not get it to work, so either it's not possible,
or I'm doing something wrong.
BTW this.attachMovie(newName,1) works, so it isn't a error in the linkage part.
I also tried it with a function placed in 'otherMC '
Like...
Code:
function makeNewMC(newName,i) {
this.attachMovie("Name",newName,i);
}
I tried to call it from the root Like..
Like...
Code:
this[someMC].otherMC.makeNewMC("aName",1);
, but that also didn't work.
I realy need to attach a movieclip in 'otherMC' from outside 'otherMC' How can I do that?
Any help would be greatly appreciated,
[Edited by biker66 on 07-05-2002 at 07:30 PM]
How To... AttachMovie()?
Hi all!
Have a little problem. Trying to create a checkbox function of my own, and wanna use diffrent gfx in them.
The code looks something like this:
Code:
...
multiCheck = function() {
this.drawGfx();
this.setChecked(this._checked);
this.setChangeHandler(this._handler);
}
Object.registerClass("multiCheck", multiCheck);
multiCheck.prototype.drawGfx = function() {
attachMovie('markerBody','body',100);
}
...
The problem is that i can't get the attachMovie() to work, if i read the man, it says that this is how to do it to get the movesymbol 'markerBody' to be attached to my checkboxclip, or have i missed something?
-- Mike
AttachMovie
I have a movieclip symbol im trying to launch from the timeline using actionscript in a frame. Linkage is done.
problem is that the clip will not play in the stage where i want it to, its way off the stage and out of view. Im sure im doing something really stupid, or maybe i need to specify the x,y to place the clip to??
Current actionscript is like this:
_root.attachMovie ( "example", "example_1", 1 );
Also, is there a way to make the movie play in reverse?
Not just prev frame , 1 @ a time but play??
AttachMovie()
hey all,
i'm trying to attach clips to another clip in my scene to create a menu list.
The list items (exported as 'myListItems')have a button and a dynamic textfield called 'trackName'.
This is what i have for attaching it to the root and it works fine.
for (var i = 1; i<=Number(numberOfTracks); i++) {
attachMovie("myListItem", "currItem"+i, i);
eval("currItem"+i).trackName.text = eval("track"+i);
eval("currItem"+i)._x= 0;
eval("currItem"+i)._y= i*25;
}
variables 'numberOfTracks' and 'track1' to 'track12' are loaded from a text file.
The thing is i don't want the clips to be attached to the root, but to a clip 'deeper' inside being _root.myPlayer.myScroller.myScrollPage.myContent
I can't get it to work, i've tried a lot of things.
Can someone help me ??
Thanks !!
Attachmovie
Hi..
Please can somebody help. ?
I have a MC called openseeds
I can open this with attachmovie using a button. on(release)
I am using a nextframe button to step through a series of
frames and want to attach the appropriate movie as I enter each frame.
I am just not sure of the correct syntax for the action
script.
AttachMovie
hello
why can't i get the _width of the attachMovie
here is my code :
_root.attachMovie("but", "mybutton", 1);
mybutton.my_but_text.htmlText = "Bla bla bla";
trace(mybutton.my_but_text._width);
// it doesn't give me the correct width
AttachMovie
I am using attachMovie to insert several movie clips into frame 1 of a movie, then at the end of frame 2 I use removeMovieClip to get rid of the clips. This works great.
At frame 4 I use the same code used in frame 1 to attach the same movie clips into the same levels used in frame 1; but the movie clips don't appear. In the linkage I have export in first frame checked. Any thoughts?
AttachMovie?
ok this should be simple I followed the definitive guide and still cant get it to work simple attache movie I have set the linkage in the library then this code on frame 1 attachMovie(m1,m2,10); I have tried it on a button to attach it to a mc just cant make it work I am sure its some thing really simple and stupid that I am over looking here is a fla I have been trying this out with http://necrum.com/flash/attach.fla
thanx
AttachMovie
I'm using the command attachMovie for the first time on MX, connected to a button like so:
Code:
on (release) {
_root.attachMovie("myMovie","myInstance",0);
}
This works fine, BUT does anyone know how to make it so the movie instance is BEHIND everything on the main time line? Seems like no matter what I do the instance is always on top of everything, whether it is placed in the button or root, or whether the button is on top or bottom layer.
AttachMovie
Hello,
I'm using attachMovie and I was wondering if there's a way of loading the linked MC's in another frame rather than in frame 1.
Cheers
mark
AttachMovie()
is it all possible to use attachMovie on an imported movie from a shared library? MCs seem to work fine if they are explicitly dragged onto the stage, but they are not included if they are just imported and not used except in the scripts.
thanks.
AttachMovie
I can't find attachMovie in the pre set actionscript codes, can someone tell me where to find it (I'm using MX)
Thanks...
AttachMovie
Can anyone tell me where to find the 'attachMovie' preset code in Flash MX?
Thanks...
AttachMovie
Hi,
I am trying to use the attachMovie function. The code I am using is:
on (release) {
_root.attachMovie("working2","navi",2);
}
(Although the depth seems to work at whatever value I use - please advise)
The code works, but it doesn't know where to put the mc, so it is positioning it to the top right of the stage. How can I make it sit where I want?
Thanks
S
Xml And AttachMovie
I am trying to build a navigation menu from an XML file using attachMovie. You can see the source here:
http://www.juniperinteractive.com/ggp/debug.zip
So far, I have two major problems that have me stumped.
1) I can't set the height and position of the attached movies for some reason.
2) Not all of the sub nav buttons are getting attached, even though those nodes are getting processed.
Maybe there is something obvious that I am missing, since I am new to AS. I've been looking at this for several days and can't figure it out.
Please Help Me With .attachmovie
i am trying to attach a mc with my sound in it but i isnt playing could somebody please help me out? I want to be able to stop and start the mc with a button. Thanks in advance.
AttachMovie In MX
Hi,
I've just started with MX, and I have a basic knowledge in Flash (yea only basic).
I want to make a movie that with a button click it'll create a number of movies from the library (attachMovie).
and by other button set the movie's _alpha to 40%... sound like it's easy... well it's no working!
what I did is a short movie that create a moving box movie (called "box") with a function to set the _alpha to 40%
so by a button click it'll attach this movie, and by other button click it'll set the last box that was created to _alpha to 40%.
the problem is that when I set the _alpha to 40% the movie stops!!!!!!! why ???
what don't I understand in ActionScript? what section "in the book" did I miss?
I have attached a demo of what I want to do.
Any help will be appreciated!
Thanks
Gil Amran
AttachMovie
Hi,
- i made a small dynamic mp3 loader to import into another movie in order to reduce the download time one the front end for the user.
To show the status of the download, i have a preload bar, which works. Beneath that, i have an empty movie clip. When the file is still loading, i attach an MC to the empty one that says "Loading Sounds". It displays when it shoud.. When the file is done loading, i attach another MC which says "Ready..." When the music is playing, it displays "Now Playing.." you get the idea.
now, onto my problem..
the MC's that attach are animated, kinda.. They are each 20 frames long, the first 10 frames with thext displayed, the last 10 without, to give the text a blinking effect.
If i place these MC's onstage, they blink, but if i use the attachMovie method, they dont..
help?
FLA is attached for your review.
thanks,
-myk
AttachMovie
When you use loadMovie, you use unloadMovie to remove the movieClip.
How about attachMovie ?. I am trying to remove an attached movieClip and replace with another one using buttons. So far I am not able to do it. Any suggestions ?.
AttachMovie
I am using the script:
yellow.attachMovie()
to attach a movie to the movieclip/instance 'yellow' on the scene.
How do I attach the movie to my curer instead??
Many Thanks!
AttachMovie
Why does the attachment fla not copy the square movie clip into the circle's movie clip?
AttachMovie
ok, this is the script
code:
_root.onMouseDown = function() {
var newDepth = ++depth;
var name = "smoke"+newDepth;
var clip = _root.train.tube.attachMovie("smoke", name, newDepth);
clip.onEnterFrame = function() {
this._y += move;
};
};
move = -10;
depth = 0;
This is the movie
what happens is, when u click the mouse a poof of smoke rises from the funnel, but it follows the trains movement , what i need it to do is be created and rise on the X axis it appeared.
can someone help?
AttachMovie...
Hi there,
I'm pretty new to Flash actionscript, more into graphics then coding but I need to be able 2 when a button inside a movie clip is pressed to open a new movie clip on the main timeline (_root). I think the attachmovie is the right script to do so, but I dont know how to use it. How can I set where the movie appears by X and Y on the main timeline also?
The code the MX presents is:
on (press) {
mc.attachMovie(idname,newname, depth [, initObject]);
}
Thanks in advance for any help!
AttachMovie And For
simple function i first frame of main timeline
function menuobject() {
var i;
i = 4;
for(var a=0; a<=i; a++){
_parent.attachMovie("buttom", "buttom"+a, 1100+a);
_parent["buttom"+a]._y = _parent["buttom"+(a+1)]._y+40;
_parent["buttom"+a]._x = _parent["buttom"+(a+1)]._y+40;
trace(a);
}
}
and next I call mentioned function in mc
onClipEvent (enterFrame) {
this.onRollOver = function() {
_parent.menuobject();
}
result:
when I roll over the mc only one button shows up but sholud 5
when I roll out and roll over again second shows up
why? but trace(a) print
0
1
2
3
4
AttachMovie ?
im new to action scripting and trying to learn the concept of it. i am a php script writer but this is far deeper.
My question is this.
when the main movie loads. i have a layer designated for actions.
in that layer i call my .as file and in that is my code.
i want to grab mc's from the library. and all the mc's in my library have the link identifier set.
now what i want to do is when the movie is loaded and it calls my .as file. im trying to have all my mc's loaded on the timeline. at certain _x's and _y's but i've failed at doing so.
here is a snipplet of code i am using. I think i need to buy a book but maybe someone out there can help me =0
this.attachMovie("top_bg", "top_bg1", 1);
top_bg1._x = .3;
top_bg1._y = .3;
this.attachMovie("red_right_top", "redright", 1);
redright._x = 200;
redright._y = 200;
keep in mind that is in my .as file that is called in the first from of my movie..
how can i have it so it grabs the mc from the library and load it to a certain _x and _y then i will be able to figure out the rest.
Thanks in advance!
AttachMovie
When using attachMovie is there a way to prevent a MC that is already on the stage from duplicating on the stage again ?? (I have a button that attaches the MC's to an empty MC)
AttachMovie : Help Please
I am using the code below to attach a movieclip and then position it within its parent but am having problems. I have tried numerous methods to resolove this but haven't managed to resolve the problem.
This code is attached to a movieclip:
on (release) {
_root.viewer.garment.unloadMovie();
_root.viewer.attachMovie("longsleeve", garment, 1);
_root.viewer.garment._y = 60 ;
}
The last line is supposed to position the newly attached movie within its parent but the code has no effect on my movie. Is it because its in the same statement block?
AttachMovie()
ok say you got a big green circle movie clip on stage...and you attach a small red square button or movieclip to it at runtime using
the attachMovie method. Also, suppose you set the on(rollOver) event for that small red square to change the alpha of the square...how come this doesnt work when you roll over the square? It seems the square is trapped inside the circle movieClip somehow. (only the on(rollOver) event for the circle works...please help!
AttachMovie
I'm trying to make a movieclip that is loaded on the screen (no problem with this) and then when clicked a new movie clip (same mc, but different instance) is dragged and dropped somewhere else. And, I want there to be an endless supply of them. Right now I can only drag the original and it keeps going back to where it was. I've looked around on this forum and haven't found any examples. Thanks.
AttachMovie
hi,
I've created a fairly fat flash file that works mostly using attachMovie.
how do I preload this file (500k) ??
everything is exported first through the linkage option....
I 'm searching through docs but if someone could holla first - then awesome !
thanks
jSo
AttachMovie
hi experts
I have this code here:
Code:
_root.attachMovie("bonus","bonus1",0);
setProperty("bonus1",_x,400);
setProperty("bonus1",_y,210);
and I want to make bonus1 disappear when it hits player in my game.
I tried out different possibilities but nothing seemed to work. the movieclip never disappeared. for example I tried out this:
Code:
if(_root.bonus1.hitTest("player")) {
trace("it's working!");
_root.bonus1.removeMovieClip();
}
how do I have to do this correctly ?
thanks for help!
|