ActionScript 1/2 :: MovieClipLoader.onLoadInit With MovieClip.attachMovie?
Jan 5, 2010How can we get information that the movie clip is attached (using MovieClip.attachMovie) and ready to use, like MovieClipLoader.onLoadInit?
View 5 RepliesHow can we get information that the movie clip is attached (using MovieClip.attachMovie) and ready to use, like MovieClipLoader.onLoadInit?
View 5 RepliesI am using a moviecliploader object to load a clip into the timeline. I have a loader movieclip for the graphic placed on the stage. The idea is to gotoAndplay a certain frame as per the percent loaded so far.But the percent value is always 100. Is this because I am testing it on my local machine? But even so, shouldn't every trace fire, as percent value will fall in these categories sometime. The code within onloadInit is:
[Code]...
I'm trying to get a small movieclip in my library with the linkage "spinning" to show up when a thumbnail is loading. what busts my mind is that I can create a text field, but not attach a movieclip. The basis of the code is from Blue_Chi's Advanced Image Gallery here. I know that the movieclip is capable of being pulled out of the library, 'cause I've tried it elsewhere and it works.[code]...
View 0 RepliesI didn't expect to come across such a situation and I can't imagine why it works this way. Lemme explain.
[Code]...
It works fine now! So wierd. I really need to be able to move the MovieClip with the Image loaded into it.
Is it posible to make a preloader of a SWF that loads an external JPG?
View 1 RepliesI'm trying to use attachMovie to attach a movieclip to another movieclip. Both the movieclips are set up as buttons (ie. they have _up, _over, _down, _hit states). The problem is if I define event handlers for both mcs, only the event handler on the parent clip works.
myBtn is already on the stage:
myBtn.onRollOver = function():Void { this.attachMovie("pageButton","chldBtn",1); this.onPress = function():Void { trace("parent"); //works }; this.chldBtn.onRelease = function():Void { trace("attached Movie"); // doesn't work };};
I've tried 'delete this.onPress' for the parent mc but this makes no difference.
How can I get the attached mc event handler to work?
I'm trying to load a local SWF then catch a few events that are fired but I can't see why this isn't working.
Here's the code
Parent.swf
_mcl = new MovieClipLoader();
_mcl.addListener(this);
_mcl.loadClip("Child.swf", rotator_mc);
[code]....
Now I was hoping that this would work, and the Parent would have "childLoaded caught 2" in the trace, but it doesn't.
Im loading a movieclip which contains some sound, but after it's loaded and played, there's absolutely no sound at all
View 2 RepliesIm having problems with assessing the size of an image after having loaded it into a movieclip using MovieClipLoader.Im trying to use the onLoadComplete-method to determine when the image is completely downloaded into the imageholder-mc, but Im just getting the original size of the mc, not the image's.[code]
View 3 RepliesDoes anyone know how to use the Loader method of this class? I want to play a movieclip in the loading position rather than a textbar which increases... All of the examples I've seen so far only show the latter of the two options... I can use loadMovie() and achieve what I want, but the MovieClipLoader class is the future.
View 4 RepliesIm having problems with assessing the size of an image after having loaded it into a movieclip using MovieClipLoader.
Im trying to use the onLoadComplete-method to determine when the image is completely downloaded into the imageholder-mc, but Im just getting the original size of the mc, not the image's. I using the MovieClipLoader incorrectly somehow?
Code:
var MCL = new MovieClipLoader();
MCL.loadClip("IMAGE.jpg", mc_ImageHolder);
MCL.onLoadComplete = function (targetMC) { // perhaps 'targetMC' should be used?
trace (mc_ImageHolder._width); // outputs mc's original size, not image's size
}
I have to load one movie clip symbol (with linkage identifier specified) in another swf. Is this possible? Say, in 1.swf, I have a movieclip with identifier "a_id". in 2.swf, I loaded the 1.swf using loadMovie (to one blank movieclip). After that I need to attach the "a_id" to another blank movieclip (in the 2.swf itself)
View 7 Replies'm pretty new with flash and right now I'm stuck with a problem that I don't seem to come out off. I'm working on my new site that has 3 sections that each load a movieclip using attachMovie. Now the problem happens when I load the slideshow, its all broken and even if I change the _root to _parent or this, it doesn't work
[Code]...
Ok having some issues with this:I create a new movieclip:this.createEmptyMovieClip("setClip1", this.getNextHighestDepth());and then I attach a bunch of the same movieclip from the library to my new clip:in a for loopthis.setClip1.attachMovie("dashLine","dashLine"+i, this.setClip1.getNextHighestDepth());This is all working fine. BUT, I try to duplicate this movieclip:_root.setClip1.duplicateMovieClip("setLeft1",thisgetNextHighestDepth());And it seems to work - I can trace the _x/_y values and such so it sees my new clip but nothing shows up. It's just blank.So my question I guess to start is this:When you useduplicateMovieClip, does it bring with it all of the attached movieclips as well or does it not include the attached clips as well?
View 1 RepliesI am using AS2. The character, a robot, has machine guns that fire off bullets. I am trying to get the bullets to disappear when they hit an enemy. They do dmage, but for some reason they are still there. Here is the code I use to attach and delete them.
Actionscript Code:
if (bulletReady == true && dead == false && Key.isDown(1) == true) { for(x = 0; x<machGuns.length;x++){ bulletReady = false;
[code].....
Here's what i've got...
_root.onMouseDown = function() {
_root.attachMovie("flag_mc", "flag_mc" + nextDepth(), nextDepth(),{_x:_xmouse, _y:_ymouse});
}
My problem is that it only adds one instance of flag_mc to the movieclip. When I press the mouse down again, it removes my old instance and puts a new one. Is it possible to make it leave the old one and add another?
I'm triyng to use the attachmovie command to load and position a movieclip. It doesn't show anything when playing movie. I'm using Flash MX.
_root.attachMovie("Symbol", "mcp", 0);
_root.mcp._x = 100;
_root.mcp._y = 100;
what i want to do is to duplicate a movieclip into the root, but the movieclip i want to duplicate, isn't in the root, instead it is in another movieclip.get it? i hope thats clear...so i heard that the duplicateMovieClip function only works if both movieclips are in 'this', and so i'm guessing i use the attachmovie function. But it doesn't seem to work, how to use this function the way i want it to? i've looked at the flash help thing but its not exactly what i want...
View 2 RepliesThis is driving me nuts... is it impossible to use attachMovie inside a movieclip you used loadMovie on? For example, I have this but it doesn't work out:
Code:
imageHolder_mc.loadMovie("firstImage.jpg");
imageHolder_mc.attachMovie("secondImage_mc","attachedImage_mc",1);
Why doesn't this just load the firstImage.jpg through the loadMovie method and then create an attachedImage_mc on the imageHolder_mc (with the secondImage_mc)? All its doing as of now is loading the first image... then if I comment the loadMovie part, it attaches the second image.
EDIT: Just a little more info. Basically I have a movieclip called imageHolder_mc that I created manually on stage. This movieclip calls LoadMovie to load in a JPG, but later on I need too replace the entire content of it with a movieclip from the library (still keeping the imageHolder_mc instance name).
I've used the command attachMovie to add custom movie clips to my flash document but now I want to change the value name (that I defined inside the movie clip as a text) in each movie clip. I found something like :
this[uniqueclipname].value.text = "Name";
But I couldn't use it clearly. Is there an alternative for that? Or is there any wrong part in my code?
I have 2 nested move clips in this order.
mc_a (grand parent)
mc_b (parent)
[Code]....
Now, I have a button on the stage. I am trying to load mc_a on stage using the linkage, and trying to load an image that replaces c_inst.
I am using:
on(release)
{
_root.attachMovie("a_call", "a_called", 1)
_root.loadMovie("image1.jpg", _root.a_called.b_inst.c_inst)
}
But so far it only attaches the movie, doesn't load the image.
I used a movieClip to store the attach movieclip, but How to get back the variable from that movieClip container, such as a I set a array in the exiting movieClip
var m_click:Array = new Array();
for (var f=0; f<=this[mc_name+"_qty"]._totalframes-1; f++)
{ m_click[f] = 0; }
I want the attached movieClip "y_qty" with a button inside to get the m_click for changing each m_click[0]..m_click[1]..value, how to do it?
Adobe Flash CS3
publishing as Flash 8, AS 2.0
I have a movieclip named menu (instance name = mainmenu). Inside of that there is a button named btn_about (instance name = about). On the main stage there is an empty movieclip named empty_mc (instance name = mcholder, linkage id = empty). I want a user to press the button which causes a movieclip in the library named tesst (Linkage name = testid) to load into the empty movieclip (mc_holder).
Here is the code on the button:
on (release) {
this._parent.mcholder.attachMovie("testid", "tesst1", this.getNextHighestDepth());
}
It does not work.
Im triyng to use the attachmovie command to load and position a movieclip. It doesn't show anything when playing movie. I'm using Flash MX.
_root.attachMovie("Symbol", "mcp", 0);
_root.mcp._x = 100;
_root.mcp._y = 100;
I used a movieClip to store the attach movieclip, but How to get back the variable from that movieClip container,such as a I set a array in the exiting movieClip [code]I want the attached movieClip "y_qty" with a button inside to get the m_click for changing each m_click[0]..m_click[1].. value, how to do it?
View 1 RepliesIs there a way to extend the movieclip class without using a library item and attachMovie?
View 3 RepliesI am trying to make this class remove a dynamic Movieclip that was attached on the mainstage using attachMovie(); it wont let me remove the movieclip tho
here is my code
Code:
class close_btn extends MovieClip
{
function onPress () : Void
[Code]....
I had a movieclip which contained a button in it exported as "mc". Then I attach this movie clip onto the stage using: _root.attachMovie("mc", "link1", 1); But i couldn't find it with AS. I mean, how can i refer to the button inside the movieclip after I attach it onto the stage using attachMovie?
View 2 Replieswhy a ComboBox component wouldn't work if it's in a movieclip brought in with attachMovie? When I click on the combo box, the menu drops down like normal, but no matter what I click on, it goes blank. Just spent a lot of time searching the net for an answer, found a few suggestions but nothing has worked.The combo box works fine if it's placed on any timeline in my main movie, but when it's in a movieclip that is attached with attachMovie, it stops working.
View 2 RepliesI am loading a few thumbnails from XML.When they load in, I want them to perform a few simple functions.However, when I load them in, Only the LAST thumbnail takes the onLoadInit() function.
Code:
function AttachThumbs(xmlData)
{
xmlNode = xmlData.firstChild.childNodes;
var total:Number = xmlNode.length;
[code]....
It's as if I need to create multiple loadListener objects.. one for each thumbnail, but I dont know how to do that when declaring a variable .. ie: one cant say:
Code:
var ["loadObject"+i]:Object = new Object();