ActionScript 2.0 :: Possible To Handle The Attached Movie Clip?
Feb 13, 2009
I've attached a movie clip using the attachMovie method. I was wondering if it's possible to handle the attached movie clip... I don't know if I'm expaining this correctly but I'd like my movie clip to perform some simple actions (gotoAndPlay, Stop)This is my (lame) script:
//Ataching clip
this.emptyClip.attachMovie("photo001","Img001",get NextHighestDepth());
//Action for the attached clip
this.emptyClip.gotoAndPlay("starting");
Q1) The registration point of a created clip is top left - my question is how can I dynamically change it's registration point - say to center center?
(I am trying to attach a movie clip to a created clip and I wanted it to be centered inside the container - a related sub-question, how can I find the x-y coordinates of the attached movie clip within the created movie clip?)
Q2)When I tried to create two different movie clips, I found I had to create them at different depths, else the first would load and the second would not. Why would that be so? I'm on MX 2004 Pro.
I have a flash movie I'm externally loading into my SWF. It isn't mine. I'm trying to pause the swf, but I can't and I don't know how the SWF works because it isn't mine. I was thinking about maybe creating a bitmap of it, but I can't do that because I don't think you can create bitmaps at runtime of moviing movie clips. Is there a solution to my problem
I copied this code from the web that creates snow and I have this code on frame 100. I want to remove this movie clip when it starts back again on frame 1.
Basically its an onPress event handler on a movie clip that attaches another movie to it when pressed.The problem is, I only want the movie clip to be attached once in the designated x,y coordinates, no matter how many times the main object is pressed. I'm essentially trying to write my own FreeTransform script, that allows users to resize the object.
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,ow can i remove all the attached movie by the reset button from newgrid2?
################################################## ## this is the method i used to remove the clip _root.reset.onRelease = function ()
I have a series of mc's I'm attaching from the library, with buttons in the main movieInside each of the attached mc's is a close button that needs to close the attached mc and launch a function in the main movie, but I'm having trouble addressing the button inside the attached mc from the main timeline.I've tried this:
I'm quite new to A.S and lately i got a problem when trying to trace the info of an attached movie clip.I created 2 movie clips named "test" and "testChild". In actions frame of "testChild" i put this:
i'm trying to remove a function from a movieclip, is there a way of doing this, so I keep the movieclip on stage but removes the onPress etc? I'd also want to be able to reapply that function the movieclip later.
I currently am creating a game where you shoot at targets that randomly appear. I have them set to be randomly generated via an attachMovieClip object, and all works well... EXCEPT that whenever it generates the clip from the Library, the instance is WAY above the rest of movie (layer-wise)!
This means that my custom-crosshairs cursor, for instance, is always behind the target and thus the user cannot mouseDown and shoot it.
I have an AS3 project (publishing to FP10) where I load a custom made window from the main movie. The custom made window is saved in the Library and has a close button (called exitinteraction_btn).
I manage to load the window from the main movie with the following:
var WinA = new windowa(); addChild(WinA); var myTween:Tween = new Tween(WinA, "x", Elastic.easeIn, 175, 175, 5, true); var myTween:Tween = new Tween(WinA, "y", Strong.easeIn, 175, 175, 5, true);
This is the code in my custom window (which I cannot manage to close and have it remove itself from the main movie when clicked):
exitinteraction_btn.addEventListener(MouseEvent.CLICK, closeI); function closeI(e:Event):void{ this.unloadAndStop(); }
I get the following error:
TypeError: Error #1006: unloadAndStop is not a function. at windowa/heyb()
apply actions to an attached/created movie clip at runtime? I.E. You use attachMovieClip to attach a clip, and then you add a startDrag/stopDrag system to it dynamically.
I'm trying to get in the habit of using AS in the first frame on the main timeline as much as possible. but sometimes i hit a snag. like getting a movie clip to change it's alpha when it hits a certain frame in an attached MC.
Does anyone know a way to apply actions to an attached/created movie clip at runtime? I.E. You use attachMovieClip to attach a clip, and then you add a startDrag/stopDrag system to it dynamically. Is it possible?
I am using CS3 with Actionscript 2.0I am trying to get a play / pause button to control a movie clip.I have placed the MC on one layer and the button on another layer.The button works great.All I need is the AS to control the timeline of the movie clip.
I created a movie clip (mcPopup), deleted it from the stage, and set it to export for ActionScript. I then set up the movie to attatch the clip to the stage and then load a JPEG image into it. Now, I need to be able to let the viewer dismiss the popup, but I cannot figure out how to add an event listener to the movie clip. I tried several different ways, but the popup doesn't seem to be clickable and doesn't respond to clicks (perhaps the image is in the way?) Here is what I have for the code for the thumbnail the visitor clicks to open the popup:
on (release) { _root.attachMovie("mcPopup", "popup_mc", _root.getNextHighestDepth());
I have ablut 60 movie clips attached dynamically on the stage in flash each at various depths. I want to place some other movie clips in between the depths of those clips dynamically .. how would i go about that?
Inside the attached clip there is a dynamic text field with an instance name of catHdr_Ins, variable name varCatHdr. I cannot for the life of me reference that text field.
i'm attaching clips from library using attachMovie. inside those clips are functions. I'd like to call those functions a few lines after instantiating them using 'attachMovie.' It seems that the clip isn't fully loaded because my functions aren't being called. I tried using movieClip.onLoad, but no dice.
I'm creating a scrollbar gallery from a tutorial on this site. Though I've completed the tutorial, and customised the gallery to my own needs, however I'm trying to make a very small change to it - and no matter what I do, keep running into problems. I'm trying to replace the rectangular handle with my own customised handle - a (20 x 20) 'circular' png image that I've imported into Flash, made a graphic and stored in the library (though I understand it can be imported using actionscript, like the other images in the gallery).
I've got clips being attached using attachMovie (clips are in the library with linkage id's).
inside those clips are two functions. I'm trying to access those functions after I attach the clips, but not getting anywhere.
I assume that the methods of my attached clip (the functions) aren't available immediately, but rather after the clip actually 'loads' to the stage they are.
say I have a clip with an onEnterFrame running on it with a hit test to check if the user has rolled off the clip . . . Then i create an empty clip within that clip and attach clips to it. Will my .onEnterFrame and hitTest now apply to the clips i have attached to the original clip?
I try to connect a line object between 2 draggable movie clips. If either MC changes position, the line will follow and still connect to it. The first version I got is as following: (works smooth but takes high CPU and computer resources if there are thousands of objects duplicated)[code]...
What is the best way to attached sound to my movie. I used to used the sound obejct as such:
my_Sound_sound = new Sound(); mySound_sound.attachSound("soundID");
But by under the linkage menu I am only able to select export in the first frame. Which makes my first frame super huge. Than my preloader will not load until the sound, so it is no good.