ActionScript 2.0 :: Loading MovieClip Between 2 X Positions

Feb 19, 2008

I've just added in a bubble effect I found here. At the moment the script creates bubbles randomly across the whole width of the stage. I want the effect to only occur between two x positions, say 50 and 845, on the stage. This is the Actionscript I have at the moment.

function bubbles(){
xpos = Stage.width*(Math.random());
xpos = Math.round(xpos);
_root.attachMovie("bubble", "bubble"+xpos, 999+xpos);
_root["bubble"+xpos]._x = xpos;
_root["bubble"+xpos]._y = 299;
} interval1 = setInterval(bubbles, 50);

View 7 Replies


Similar Posts:


ActionScript 2.0 :: Why Emptymovieclip Positions Affect Positions Of Thumbnails

Jan 22, 2007

I have thumbs placed on the stage. I create an empty mc to load swf. But my thumbs disappear from the stage when I test the movie ( html or swf) if I settle the _ and _y position of the empty mc.why the emptymovieclip positions affect the positions of my thumbnails?

View 2 Replies

ActionScript 3.0 :: View Same Movieclip At Multiple Positions?

Feb 22, 2011

i want to have the same movieclip showing up multiple times at different locations on the screen. i don't want to create multiple instances just cuz it seems less "efficient", so it'd be neat if there's a way to do this.essentially what i'm trying to do is have a the user see the same movieclip but with different things on top of the movieclips, and if the user does something to do the movieclip in one location (ie: click to change a tile in the movieclip), i want that to take effect in all locations.i could just add event listeners to each tile in all the movieclip to have the same effect independent of which movieclip you click the tile in, but i'm hoping i can avoid this.

View 1 Replies

ActionScript 2.0 :: [FMX]Controlling X Positions From One Movieclip With 4 Buttons

Apr 26, 2004

I have a text movieclip (service_mc) on the stage for which I need to control 4 different _xpositions (_x = 0, _x = -700, _x = -1400, x = -2100) with 4 button mc's (btn_one, btn_two, btn_three, btn_four).

For these four buttons I already declared the Over, Out, Release and Restore stage in a function:

Code]...

What I like to accomplish is to control the _x positions of "service_mc" with the same buttons. I mean when btn_one is pressed service_mc should go to _x = 0, when btn_two is pressed the _x position from service_mc should change to _x = -700 etc, etc

How to integrate this possibility in the existing function?

View 10 Replies

ActionScript 2.0 :: [FMX]Controlling X Positions From One Movieclip With 4 Buttons?

Apr 26, 2004

I have a text movieclip (service_mc) on the stage for which I need to control 4 different _xpositions (_x = 0, _x = -700, _x = -1400, x = -2100) with 4 button mc's (btn_one, btn_two, btn_three, btn_four).For these four buttons I already declared the Over, Out, Release and Restore stage in a function:

Code:
for (var i in this) {
if (this[i]._name.substr(0, 4) == "btn_") {

[code].....

View 10 Replies

Incrementing Several Movieclip Positions When Adding To Stage Using For Loop?

Jun 23, 2009

I'm adding several similar movieclips to the stage with a 'for' loop. However, I'd like to increment the position of each movieclip when added on to the stage. I know exactly where I want each movie clip positioned as well. At the moment I just have a small 'for' loop which setups the movieclip. Like so...

[Code]...

View 1 Replies

ActionScript 3.0 :: Drag Movieclip And Save Positions And Speed?

Sep 8, 2010

i want to drag a movie-clip from A to B via different positions and on stop drag , the movieclip must go back to initial position ,via the same way traversed by the mouse and with the same speed. i did an example but it's not taking exactly the same speed and i'm not using classes(you will find it attached). i have to use classes in AS 3.0.

View 3 Replies

Actionscript 3 :: Movieclip - Change Positions Of Objects On The Stage By Click?

Oct 31, 2011

I have somme mc's on the stage an I want thatto change on mc with antoher by clicking on them. For example if I click on mc1 and than on mc2 than they schould change the positions.

View 1 Replies

ActionScript 3.0 :: Incrementing Several Movieclip Positions When Adding To Stage Using For Loop?

Jun 23, 2009

I'm adding several similar movieclips to the stage with a 'for' loop. However, I'd like to increment the position of each movieclip when added on to the stage. I know exactly where I want each movie clip positioned as well. At the moment I just have a small 'for' loop which setups the movieclip. Like so...

ActionScript Code:
for (var i:uint = 0; i<=8; i++)
{
zone[i] = new Zone();
}

I then have a long list adding and setting each mc position on the stage...

ActionScript Code:
stage.addChild(zone[0]);
zone[0].x=267.6;

[code]....

Although I've just had a thought as I was typing that last bit of code. Will I need to setup a for loop for each row...so the y position remains constant and I just increment the x value for each movie clip, and then repeat this for loop for the next row with the new y coordinate?

View 1 Replies

ActionScript 3.0 :: Swap 3 Movieclip Positions On The Stage Randomly So They Don't Randomise The Same Way?

Jun 11, 2010

I want 3 movieclips to change positions (swap places) on the stage randomly when I push a button and make sure they are always in different positions, so they don't randomise the same way.

cat, dog, fish
position_a,position_b,position_c
position_b,position_c,position_a
position_c,position_a,position_b

then loop and randomize the position they popup in again. So I can just keep on clicking the screen and they always change.

xxxa
xxbx
cxxx

I will have the 3 movie clips on the stage with instance names.

position_a
position_b
position_c

[code]....

View 9 Replies

ActionScript 3.0 ::nest MovieClips Using Code / Display / Change Their Positions Reletive To Their Parent MovieClip

May 6, 2010

I have a MC with an instance name MovieClip_1 and I create another like this:[code]So basically, what I want to know is how to nest MovieClips using code, display them, and change their positions reletive to their parent MovieClip, and not the root/stage.

View 1 Replies

ActionScript 2.0 :: External Swf Loading Into Target Movieclip Loading

Apr 20, 2005

I'm trying to load a SWF movie into a target movieclip called blankmc. The SWF movie is loaded from an absolute URL (eg. [URL]/img/20042005113934movie3.swf ) My Loading Progress code fails to detect the SWF file size. However the same code works perfectly for a JPG! Essentially the .getBytesLoaded() and .getBytesTotal fail to work. Why is this and how can I get it to work for loading SWFs?

[CODE]...

View 3 Replies

ActionScript 2.0 :: Loading A Movieclip Into The Main Movie From A Previously Loaded Movieclip

May 26, 2010

Im making a movie with a menu that loads movie clips according to which menu is selected simple enough. However, the newly loaded movie clip also needs to allow the user to load another movie into the main movie effectively swapping the first movie clip with the second. This needs to be done without using the main menu.

View 6 Replies

ActionScript 2.0 :: Loading A Swf Into A Movieclip Inside Another Movieclip?

Jun 24, 2008

i am having a main.swf which has a movieclip in the form of a window. it's instance name is window_mc. this window has an empty movieclip called load_mc and i am trying to load another swf called login.swf into window_mc.load_mc using

window_mc.load_mc.loadMovie("login.swf");

both main and login swfs are having resolution 1000x780.. but wen it is loaded as said above, the texts inside the loaded swf looks very large. the resolution looks as if they are different.. i haven't tried loading movieclips much. but wen i load a swf into an empty movieclip, it wrks perfectly fine...

View 9 Replies

ActionScript 3.0 :: Add Duplicates At Different Y Positions?

Oct 9, 2009

I have a movieclip in the library that I am exporting for actionscript.  I duplicate the movieclip by adding a child for each occurance of a tag in actionscript.  This works fine, but I can't figure out how to change the y postion of each new child to be 30 pixels below form the last child.  Here is a snippet of the code where I am having the problem:
 
for (var i in xmlData.region){        for (var k in xmlData.region[i].regionInfo.payment);
            var mcRI:regionInfo = new regionInfo();            this.addChild(mcRI);            mcRI.txtPayment.htmlText = xmlData.region[i].regionInfo.payment[k].card;            mcRI.y += 30;        }
}
 
Instead of each new child's y position changing +30, every duplicate is on top of each other at +30.

View 3 Replies

IDE :: Flash 8 Moviclip X+Y Positions

Aug 11, 2009

What I'm really looking to be able to do, is have a clip in the root move to the same x and y as a clip that is embedded into another movieclip. How would I pick up the X and Y co-ordinates of this embedded movie clip?

To summarise,

ClipA is embedded into ClipB, what I want, is for ClipC - that is based in the root - to match ClipA's position.

View 2 Replies

ActionScript 2.0 :: Positions Of MC (x And Y Co-ordinates)

Jul 20, 2010

I have 52 (pack of cards) movieclips on stage all turned invisible When selected they turn visible. and need to display in one of five set positions (e.g. x and Y co-ordinates). If the first slot if full the card should be displayed in slot two. IF slot two is full the next dard displays in slolt three. I card two is then removed and a space left the next card chosen should go in there.

View 3 Replies

ActionScript 2.0 :: Swf Refers To Positions Of MC's In Itself?

Aug 14, 2004

ok I am having what I think is a targeting problem.I'm loading a swf into a blank container inside another movie (main). The AS in the loaded swf refers to positions of MC's in itself _x & _y etc.However once it is loaded, those positions are not true... ex. if the center of the swf is 200 by itself depending in where it is loaded, it might become 400 or any other number - reletive to the main movie's stage (I hope Im being clear).I need the AS in the loaded swf to refer to itself (x/y values relative to its OWN stage). So how do I target that? _root.MC.containerMC doesnt seem to work, but is this on the right track? Basically when an swf is loaded into another, does its _root now become the main timeline of the movie its loaded into???

View 2 Replies

ActionScript 3.0 :: Loading Movieclip Into Movieclip

Apr 7, 2010

I can get the movieclips into the container movieclip, but they're supposed to float around within the boundaries of container movieclip.Unfortunatly they just float off stage...I THINK THE IMPORTANT PART IS AT THE END OF THE SCRIPT IN THE ON ENTER FRAME HANDLER [code]

View 3 Replies

ActionScript 2.0 :: MovieClip Loading Another MovieClip

Jan 7, 2007

Currently I have a MovieClip that when you roll-over it a hover menu pops up. But I also needing to have that same MovieClip when rolled=over load another external SWF inside an empty movie clip.

View 2 Replies

ActionScript 3.0 :: Get X , Y And Z Positions Of A Point In A Shape?

Jan 5, 2010

Is there any way to get the positions of points in a shape on stage at runtime? for instance a triangle, is there any way to get the positions of the 3 points that make the triangle?

View 2 Replies

ActionScript 3.0 :: Calculating Positions Along A Curve

Jan 13, 2009

what I am trying to do is calculate the position of a point along a curve, what I want to do is create a function where i am able to determine where a point intersects the curve when I provide an X value.I have created a simple diagram to illustrate what I am looking for:So assuming I know the x,y of each black dot, and the x of the red dot, how do I calculate it's y value?

View 2 Replies

ActionScript 3.0 :: How To: Call 3 Array Positions

Jan 19, 2009

im trying to get this project done. Basically i'm pulling info out of an XML file:

Code:
<COVER>
<COVER_FILE_LOC>myImage1.png</COVER_FILE_LOC>

[code].....

View 0 Replies

ActionScript 2.0 :: Fixed Mc Positions In Web Browser?

Sep 4, 2009

When creating content for the web, I have certain elements I always want to be in view - no matter on what display or size it is being viewed from..How do I actionscript an mc, nested within a swf file to stay in a specified position / relative to the edge of a web browser

View 0 Replies

ActionScript 3.0 :: Find Positions In A String?

Nov 10, 2009

I have a function that finds the position of a specific string.[code]...

But indexOf searches the string and returns the position of the first occurrence.I know there's a startIndex parameter but I dont know how to use it so that I could go through an entire string.

Like for example: " Hello there little boy. What's your name boy?"

How can I get the position of first boy word and then the position of second boy word ?

View 2 Replies

ActionScript 3.0 :: Change The Positions Of Movieclips

Nov 14, 2009

i wanna know how to change positions of movieclips.[URL]

View 4 Replies

ActionScript 2.0 :: Mouse Show X Y Positions?

Apr 24, 2010

I have made a colouring application. The mouse changes to a brush when the user enters a page, but I dont know how to change the brush back to a mouse when the mouse is outside the colouring canvas,so the user can click on the navigation buttons.

View 1 Replies

ActionScript 2.0 :: Save SWF (not As Image But Positions Of MCS)?

Jun 1, 2010

I have a flash where users drag and drop icons around a matrix to indicate their opinions. I would like to have an option for them to save the positions of the movie clips that they have dragged and dropped so the next time they open it, they are where they left them.

View 5 Replies

ActionScript 2.0 :: Using Positions To Change Frames?

Aug 21, 2010

well i'm working on a small scale game and I appear to be coming across some small issues that I was hoping someone could help me with. I have this:

ActionScript Code:
if (_root.mc_player._x <= 540){
stop();
}else{
gotoAndStop(2);
}

in the frames actions.What I am trying to achieve is that when the players x position is greater than or equal to 540 it changes frame, I've tried various adaptations of this such as the following:

ActionScript Code:
stop();
if(_root.mc_player._x >= 540){
gotoAndStop(2);
}

mc_player is the instance name of the player (obviously :P) and when i enter the second code it just jumps straight to frame 2, so far it seems that the code is just setting the players x position at 540, so i tried setting it using actionscript like:

ActionScript Code:
_root.mc_player.x = 179
_root.mc_player.x = 143

it would set it at that and then the if the player reached the x position of 540 it would change frames but in that case it just didn't change frames.

View 9 Replies

ActionScript 2.0 :: Mutiple MC Easing To New Positions

Jul 2, 2011

I have flash 8(old school) so i am working AS2.i have a menu mc which is draggable along with 4 other mc's also draggable,each time i click an item on the menu I want to have all the mc's that are on the stage move to another position(rearranged) with easing.And so on for each item (keep in mind that all of the mc's are draggable and could be anywhere the user places them at anytime.)

View 0 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved