ActionScript 2.0 :: Find Frame Position Of An MC With It?
Oct 2, 2003
How do you find the frame position of an MC with AS? I have several MCs that are supposed to play one after the other, however there's got to be a way to keep my AS organized and not have nextMC.gotoAndPlay()s at the end of each one, ya know. I try to keep my AS all on a few essential well marked frames.
I have built a site in AS2 and would like to know the position of a ball so that I can move a sign to it always.The whole website is in AS2, but I think I have written an incomplete code below for AS3. I need it for AS2 because the whole site is in AS2. The get position of ball is wrong, but I just wanted to throw in some ideas eg.
Code:
// get position of ball ball_mc.addEventListener(<what goes here?>, ball_pos); function signMove(Event:MouseEvent):void{[code]..........
I have an mc that is displaced. Within this movie clip is a text box that moves about but it is being displaced along with the rest of the mc. Is there anyway to find a position inside the displaced mc and translate that to root coordinates.
Is it possible to call a function to tell me if a var string is in my array. And if so, what position it is in?I pictured it to look something a little like this:
Code: var pages:Array=['index','services','about','testimonials','contact']; var pageName:String; pageName="services";
To make this easy, lets say I have a movie clip with a diagonal line in it (top left to bottom right).
I want to start my y position at 0, and place it in a loop and increase y by 5 every time. So we start at the top left of the clip, and move to the bottom of the clip.
Now since we have our y value (0, 5, 10, etc.) would you get the x position of the line? such as (x, y): 5, 10
I've got a grid of sprites.Now I would like to drag an image on a grid-element.Therefore I need to know which x/y of the grid-element is the closest point to the mouse-position.
I'm trying to build a function that finds max-value in array of numbers and returns index position of the value (in AS.3.0)I already have this.....but it is not helping me finding the index number.[code]
I have a movieclip, which attaches to another movieclip, which scrolls.On click I want to be able to drag that movieclip away from the one it was attached to. When I just removeChild it, it's position changes. I want it to stay in the same spot until it's dragged.Any suggestion, on how I can give it that same position, when not attached?
i have created a movieClip in the authoring enviornment. i dynamically get it to play and then it pauses at frame 20. how do i dynamically tell when frame 20 has been reached and get the next code executed?
Basically there's an object in a movieclip. I want to find the location of that object in relation to the movieclip, not of the object's symbol. So when i look at the x and y of it, it wont show 0, it will show the x and y location in the movieclip it's in.
How can I find out the frame numbers of the beginning and end of a layer (with content) without actually going there? It would be a lot of work if I manually enter them and have to revise again when frames are different due to content change. Can I get a list of all the frame numbers of the first frames of all the labels in a movie?
How do you detect the end of the loaded swf that loads the flv? It never reaches the frame 20, and I think it is due to the loaded flv CamTest.flv file. So how do you find out that the loaded swf really reached the end? How do you find out the end of the loaded flv inside the loaded swf?
On mainline frame 1, I have loader_mc.loadMovie("CamTest_controller.swf"); On the loader_mc movie clip onClipEvent (enterFrame) {
I have a script where i need an objects X and Y Position to change when you enter a certain frame.
On layer 1 i have an input text field with the instance of "message_txt" that runs along all 5 frames in the timeline.
On layer 2 i have 5 frames each with its own actionscript on. The user navigates between frames with simple 'gotoAndStop(4)' etc... on each next or back button.[code]...
I am trying to get the position of a movie clip called "Shooter", returned to a variable called spitballYpos.
The movie clip is sitting on frame 6 (labelled "Shooting") of a movie clip called PDFstanding.
The position returns perfectly if I place the .shooter MC on the first frame of PDFstanding, but on frame 6 the variable result just returns "undefined".
What have I missed? If I need to reference the particular frame the 'shooter' movie clip is on, then what is the correct syntax?
I've been looking everywhere but not solved my problem:In frame "2" I've got a ScrollPane with a long external sfw text scrolling. At his side I have buttons that links to a certain position of the scroll so they have:
on(release) { ScrollPanename.vPosition=200; }
(where 200 is n°of pixel down from the top)My problem is that I'd also like to have those shortcuts buttons on frame "1" (main menu) so they can jump directly to the ScrollPane position in frame "2" by press.
Back in 2007 I was using a script that allowed me to store in the browser's cache a specific frame, so that when I navigated through different static html pages, it would remember to not "load" (if you will) the first half of the movie.
I am working on a site that has flash elements, one being an audio player, another being popup navigation.
Does anyone have or know of a script that will allow me to do two things:
1) remember a position page-to-page via browser caching (so the navigation won't pop up every time)
2) allow the audio player to remember its last position and whether it was muted or not.
This is what I am using to pause/play the audio:
Code: var mySound:Sound = new Sound(); mySound.attachSound("track1"); mySound.start();
I am attempting to create 360 degree spin-around product viewer. So far I have a movie clip with 24 frames, each one with a different 15 degree angle shot of the product. Upon playback of the movie, the product appears 3D, spinning 360 degrees.
That was the easy part. Now what I need is to be able to click and drag the product to change which view you are seeing (or which frame in the mc you are on) thus producing a spinning effect. How can you code, in AS3.0, that when the mouse is clicked and drug, go to a certain frame based on the current X position of the mouse?
I always see these bezier curve things where you can like choose how to make the line bend and everything and today i started expirimenting with the drawing API and found out that it's incredibly easy to do. My question is how do you make it so that the position of the anchor points refreshes every frame? I have the basic idea I just can't quite figure it out.
Well, basically what I want to do is, if the mouse is on the left side of the movie clip.. the movie clip will then play ( "A" animation inside the movie clip) vice cersa, if the mouse cursor is on the right side of the movie clip, the movie clip will then play ("B" animation inside the movie clip)
To put it simply, I would like to make a character in a game which faces the mouse cursor and chasing (with a runnning animation) after the mouse cursor but not rotating. I've got the movie clip slides along with the mouse working well, now I just need the mc to face the mouse cursor.
Basically I have a load of movieclips on one frame, and a load of the same type on the second frame. However, when you're coming from the first frame to the second frame, Flash decides to place the new movieclips in the same position as the old movieclips (from the first frame) rather than where I placed them in Flash.
I vaguely remember seeing something like this before, but I can't for the life of me remember the solution. Any of you guys know what's happening here?
Just a note, it looks as if giving the movieclips instance names stops it - but this isn't really plausible for me as I could have hundreds of movieclips on each frame..