ActionScript 2.0 :: Make A Movieclips _x And _y Absolute To The Stage
Mar 11, 2006
i need to make a movieclips _x and _y absolute to the stage so that i can duplicate a movie clip to the _x and _y of the mc without it just duplicating to the top of the stage (did anyone get that or was my english too bad?)
View 7 Replies
Similar Posts:
Jul 16, 2009
How can I get the absolute stage position of an object within a custom flex component that I exported from flash? In my Flex application I'm using the component and resizing it by setting its height and width properties. I want to place another component on the stage but I want it to appear at the same x and y coordinates of a text field in my custom component.
newComponent.x = customComponent.myTextField.x
newComponent.y = customComponent.myTextField.y
Because the customComponent is resized, the coordinates don't match up.
View 1 Replies
Aug 28, 2010
I have managed to add multiple movieclips of the same library object randomly onto the stage.[code]...
View 2 Replies
Jan 27, 2009
I want to make an explosion and move other movieclips on stage depending on how far they are from the explosion point. If one mc is only 10px away from explosion it should go another 90px and if it is 75px away it should go another 25px. I can't get it to work (I don't remeber anything about vectors in math class..)
View 1 Replies
Nov 9, 2004
I'm making a application where the projector is played fullscreen, and the stage itself is not scalable. But I'd like to make an animation where movieclips come sliding onto the stage (starting outside the stage). But because everything is fullscreen, you can see these MC's outside of the stage, this is not what I want.
So, is there a way to be able to hide everything that is outside of the stage?
View 7 Replies
Aug 29, 2006
im trying to achieve a Full Browser Flash and i want my bgimage to remain in the centre of the stage whilst other objects move round it depending on mouse movements but how would i go about centering the bgimage through AS?
View 2 Replies
Oct 16, 2009
I'm trying to make an array of movieclips (on stage with instance names);My code:
PHP Code:
var regions:Array=new Array("britain.eastAnglia","britain.eastMidlands","britain.ireland");
[code]......
View 2 Replies
Apr 1, 2011
Is there a method to determine the stage coordinates of a movie clip?
I don't mean something like this:
stageX = mc.x + mc.parent.x + mc.parent.parent.x + ....
I would like to be able to determine the movie clip stage coordinates without knowing what are its parents and grandparents etc. The goal is to be able to place the movie clip on exact place on a stage, no matter what is the nesting structure.
View 1 Replies
Oct 12, 2011
I typed out a function in an attempt to make two MovieClips appear on the stage in random locations onClick but I think I either forgot to add something or forgot to take something out.
[Code]....
View 1 Replies
Jun 4, 2009
is it possible with AS3 to see the list of the movieclips that are on stage?
View 13 Replies
Sep 9, 2011
Looking for a way to stop all movieclips both are the stage and that are children of the ones on the stage.
I toyed with looping thru stage's children so I can first target clips on the stage. But I am getting error.
for (var i:int = 0; i < this.numChildren; i++) if (this.getChildAt(i) is MovieClip)
{
this.getChildAt(i).stop
}}
View 5 Replies
Jul 11, 2011
How do you make a movieclip move horizontally from the start of the stage to 3/4 of the stage. Stage size is 700 px by 600 px i want just one row in the middle of the stage. i want that movieclip to disappear right after it reach the end of the 3/4 mark.
View 1 Replies
Apr 12, 2011
I'm having a hard time trying to accomplish this. I want to have several different movieclips on the stage, either added there when making the fla or dinamically created through AS3 and I want them to be controlled by a certain function. I read the blue circle tutorials on this site but I'm not sure I got it right I have done something similar to this (not posting the real thing because it's not in English and too long):
public class blabla
private var variable1
private var variable2
[Code].....
I'm not sure what to do to have the function work with different movieclips using different arguments. I could change this for an instance name, for example, but then I would have to do a function for each mc and that wouldn't make any sense. It would be cool if I could give the instance name as an argument but I don't think that's possible.
View 2 Replies
Feb 3, 2009
I have one MC on stage with instance name "box". That MC duplicates by using this script:
Code:
duplicateMovieClip (box, newname="box2", this.getNextHighestDepth());
box2._x = xPoz;
box2._y = yPoz;
So the new MC is now called "box2".
Inside original MC "box", I have one button. After click on that button, I need to know on which MC I clicked. box, or box2. I tried to use:
Code:
trace (this._name);
But, that get me only instance name of the button.
View 4 Replies
Aug 9, 2009
i made this code that duplicates a movie clip randomly in the stage but i want it to be duplicated out of the stage.
View 1 Replies
Aug 17, 2009
I wasn't sure if I were to put this in the Actionscript forum or in here, so I put it in here. I'm making a small test for a game so I made two attached movieclips to the stage. I got them to move at each other, but when they hit, it doesn't detect it. Is there anyway i can make them hit eachother? Heres the code
[Code]...
View 3 Replies
Dec 13, 2008
I have 2 movieclips in the library exported as class d1 and d2 , I want to add them to the stage using something like the code below.
this doesn't work but you can understand what i want to do. what is the correct syntax ?
View 3 Replies
Jun 16, 2009
I've got a long list of similar movieclips I'm adding to the stage. There's 9 in total and the code looks like this...
stage.addChild(zone0_mc);
zone0_mc.x=267.6;
zone0_mc.y=120.5;
[code].....
View 3 Replies
Sep 30, 2009
I have a file where movie clips are added to the stage at random time intervals and locations. How do I get pieces of code to effect all the created movie clips? At the moment I'm using attachMovie to add the movie clips to the stage. Once a movie clip is added I want to add three actions to it: the first makes it so that clicking on the movie clip will remove it from the stage, the second makes the movie clip move in a random direction across the stage, and the third makes it so that when the movie clip reaches the end of it's own timeline it performs an action then removes itself.
View 8 Replies
Mar 20, 2011
for (var i = 0; i<= 3;i++){var pic_mc = new MovieClip(); pic_mc = MovieClip(getChildByName("mc" + i));trace(pic_mc); pic_mc.alpha = 0; pic_mc.x = 0; pic_mc.y = 0; pic_mc.addEventListener(Event.ENTER_FRAME, animate);
[code].....
View 5 Replies
Nov 21, 2010
I have some movieclips on my stage that are there via timeline. I also add movieclips on stage using addChild.
What is the best way of changing the order of the movieclips because they overlap sometimes? eg.
mc_a is on the stage already
mc_b is called on stage using addChild
Can I change the order of mc_a using script even though it was already on stage?
Can I remove mc_a off stage using script?
How do add mc_b under mc_a so that mc_b does not overlap mc_a?
View 2 Replies
Jan 30, 2012
I am creating a miner game (where there are pieces of gold and you have to catch them with hook).I modified the Main class to take all children of MovieClip(root) that has name "Gold" and them put them in an Array(boulders[]) where later check collision (I design and put on stage several "Gold" MovieClips for every level). When the player collects all gold (when the boulders array.length <= 0) then goToAndStop(nextLevel), where again it takes the gold MovieClips from the stage and if it's name is == "Gold" then put's it in the boulder[].
What happened: On the first level(frame 2 cause frame 1 is the preloader) everything is good - I have 2 gold MovieClips on the stage(in design mode) and all 2 gold are put in the array and displayed.
On the second level I have 4 gold and only 2 of them are put in the array and displayed.
On the third level I have 7 golds designed on stage, but only 3 are displayed and put in the boulder array.
It's almost the previous count of the gold(on the previous frame) are subtracted from the count of the next frame gold movieclips.I am placing the Main.as code:
public function createLevel(){
nextLevel = this.currentFrame + 1;
for (var i:uint = 0; i < MovieClip(root).numChildren; i++){[code]....
View 1 Replies
Nov 16, 2009
It this part in qeustion "if(ball._x + ball.width / 2 > 400){" should the trace function be recognised when the half of th ball moves over the 400 mark.
Its doesnt though and i dont know why?
ball.dx = 10;
ball.dy = 10;
ball.onEnterFrame = function(){
[Code]....
View 4 Replies
Apr 19, 2010
before it was just
somemc._x = someotherMc._x
but as3 doesn't know how to identify someotherMC
[code].....
View 5 Replies
Sep 20, 2010
Im trying to dynamically add several of the same movieclips to the stage. This movie clip contains a textbox. I have tried the following:-[code]I have my movieclip exported fror actionscript with the identifier as (textbox). This code does add a textbox to the stage however it only adds the second one which says "goodbye" but not the first one which should say "hello"? I thought the loop should go round twice and add a 'newText1' and a 'newText2'??
View 3 Replies
Jul 20, 2011
i want to loop through movieClips like in AS2; i have some movieClips and Components on the stage.i want loop through them to check their properties. i had used [ getChildName ] method to get the movie clips ,but i can't access their properities.
here's my code
Quote:
for(var i=1;i<=4;i++) {
var tempisplayObject = getChildByName("my_mc"+i);
trace(temp.currentLabel);
}
when i run this code i am getting error like this
Scene 1, Layer 'Layer 2', Frame 1, Line 251119: Access of possibly undefined property currentLabel through a reference with static type flash.displayisplayObject. i am getting the same error also when i access to components.
View 3 Replies
Jun 23, 2009
I want to pull in an xml list containing thumbnail image src, image label, and video clip info, into a format on the stage. The thumbnail images should be pushed into 5 instances of the same movieclip on the stage. Eventually, I want to load the image label into a text box (should be easy), and then the videoclip to be played via click onto thumbnail (will attempt that later)
Below is my code:
Code: Select allimport fl.transitions.Tween;
import fl.transitions.easing.*;
[code]......
View 3 Replies
Jul 21, 2009
How Do I Count how many Movieclips on Stage? I want to make sure the code is acting as I want and creating the correct amount of MovieClips (and deleting them after).
View 4 Replies
Aug 11, 2009
I have 4 MovieClips and they are in Array but i need to randomly fade-in them on stage within the boundaryes of stage. How to do that? I know i have to use Math.random
View 8 Replies
Mar 5, 2008
How do I get my movieClips to show up on top of everything on the stage. Including the other animated movie clips that have buttons nested inside.
View 6 Replies