ActionScript 3.0 :: Random Position Mc's Without Overlapping?
Apr 5, 2010
how do can I position around 50 dynamic create movieclips from the library on the stage without overlapping.
I did the random x and y but they end up overlapping, i assume i have to do it with the hitTestObject, but eventually i will have 7 layers with 50mc's on each stage that need to be positioned randomly without overlapping and it will become processor heavy to test these objects.
View 2 Replies
Similar Posts:
Jun 12, 2009
I'm trying to randomly position images on the stage without having the images overlap?
View 3 Replies
Mar 23, 2010
How to stop MCs from overlapping each other?
[Code]...
This doesn't seems to be working cause the amount of it checking whether MC is overlapping is about the amount of MC on stage. how to make it keep checking till everything's fine?
View 1 Replies
Nov 15, 2010
I am creating a memory sequence game and I was wondering:
1. Is there a way to random position movieclips on the stage without having them overlap each other?
2. Is there a way to have flash draw a vector line from one clip to another in sequence and then have the user retrace what flash did? I have 6 movieclips on the stage, each with their own instance (ex. obj1_mc, obj2_mc, etc.). Is there a way to tell flash to always draw a line between movieclips in sequence even though the movieclips are randomly placed on the stage?
View 3 Replies
Apr 23, 2006
Is it possible to attach mcs at random locations without the possiblility of them overlapping?
View 1 Replies
Jul 27, 2006
I'm trying to create a flash demo for my prof and we want green dots to move randomly across the screen without ever overlapping each other.I saw the kirupa tutorial on random motion which is really good. I'm wondering if I can add something to the code so that the dots won't overlap, (as soon as one touch another they move away) as they move.
View 2 Replies
Aug 29, 2009
how to make an actionscript to move punto_mc from current position to random position after release, and then from this new position to mevo to another randon position after release?
View 2 Replies
Mar 3, 2004
What I want is for my mc to slide to a new random x position when it is less than 5 pixels away from its target, it keeps doing this. the problem is for some bloody &*�$(()** reason my random numbers only keep going up!! why is this?? i want to produce random numbers between 1 and 770 - this is my code..
[Code]...
View 5 Replies
Nov 8, 2010
I've run into a new problem, this time with positioning. I've narrowed down the line that's causing it--"block.y = block.y + block.height;" in SetOfBlocks.shiftDown. When I take it out, no problem. But with it in, instead of just dropping each block down by a block height, the affected blocks sometimes move up, and also often move about randomly within the X axis--although their new positions always keep them lined up with the 'grid', which is to say, within multiples of the block height and widths.
[Code]...
View 3 Replies
Nov 13, 2011
I wanted to built an enemy that is able to move on stage randomly in xposition and perhaps able to detect my character within the detectable zone and chase after me.. but currently I just wanted to make the enemy move randomly in x-position for starter.
It is my first time making and enemy with AI, but I'm just wasn't sure where to begin, I have used a fairy easy script to animated the movieclip in the beginning but got stucks whenever it reaches 960 or below 0 of the stage
addEventListener(Event.ENTER_FRAME,initGames);
function initGames(e:Event):void{
moveEnemy();
}
[Code].....
View 8 Replies
Jan 8, 2010
I am having problems with gotoAndStop and mozilla. I am loading an external swf ( which is Flash MX 2004 ) swf. In this swf, there are 200 keys frames. Here, i am using a command gotoAndStop(110). Now after publishing, when I am viewing in IE browsers, I can able to see the 110th keyframe position exactly. But when i am viewing the same html in Mozilla, I am getting random positions. Here am not getting 110th position.
View 1 Replies
Jan 8, 2010
I am working in Flash CS3. I am having problems with gotoAndStop and mozilla. I am loading an external swf ( which is Flash MX 2004 ) swf. In this swf, there are 200 keys frames. Here, I am using a command gotoAndStop(110). Now after publishing, when I am viewing in IE browsers, I can able to see the 110th keyframe position exactly. But when I am viewing the same html in Mozilla, I am getting random positions. Here am not getting 110th position.
View 1 Replies
Oct 20, 2011
I'm trying to code addChilld to spawn a movie clip at a random x position and then have it spawn at a random y but constrained so it only spawns between say 200 and 400 (on an 800x600 stage).
I've got it spawning at a random x, its just the constrained y
Heres the code I have so far: (Note: This is only for the function with addChild)
Code:
function addShape():void{
var obj:Objects=new Objects();
obj.x = Math.random()*stage.width;
[Code]....
View 5 Replies
Oct 5, 2007
got some code working to duplicate a movieclip, but what I'd really like to do is obviously randomise the movieclip's x position so that it spreads across the stage, rather than stacking in the same position as it is now.
Code:
for (i=1; i<11; i++){
duplicateMovieClip("alien", "alien_new_"+i, 22-10, i);
}
View 4 Replies
Mar 8, 2009
I've creating a drag and drop card game in AS 2.0 and need to set the cards randomly in set positions every time the game is played. no two cards can be in the same space, so the taken position needs to be taken out of the array.I am not concerned about the Y value just X . I think this needs to be an array containing the positions. then using slice to remove the value from the array. I'm not sure how to assigned the array position to the movie clip.
View 6 Replies
Apr 8, 2009
In realation to the following tutorial on [URL]
I was wondering if anyone can tel me how to do the following:
I have this xml gallery embeded on my webpage. Each time the page loads I want the xml gallery to jump to a random position and display the relevant information.
View 1 Replies
Sep 2, 2011
I cant get this to work. I think its pretty self explanatory what I want to do, set _x to a random position (b1 - b6)
Code:
onClipEvent (load) {
stop();
b1 = 462;
b2 = -462;
b3 = -1388;
b4 = -2314;
b5 = -3240;
b6 = -4166;
} onClipEvent (load) {
RanNum = Math.ceil(Math.random() * 6);
_x = ["b" + RanNum];
}
View 2 Replies
Jan 31, 2003
Im a 100% beginner in actionscript so heres my question, as dumb as it may sound.
I want a shape to travel from px 0 on the x-axis to px 740.
The startposition on the y-axis needs to be random, and between 140 and 180.
I have tried the following code:
startY = Math.round(Math.random()*(180-140)+140);
startX = 0;
targetX = 740;
[Code]....
View 1 Replies
Sep 23, 2007
I'm trying to find a random x,y value that always is at the far end of a circle. Like if the circle has a diameter of 300 pixels and the centerpoint is at 50,50, I want a random position on the outskirts of that circle. Just cant seem to do it.
View 4 Replies
Apr 5, 2011
I have an object which I want to rotate between -45 and 45 degrees, but I want that to be based on the mouse position. If the mouse position is at zero, I want the object to be at -45 degrees. If the mouse position is at the stageWidth, I want the object to be at 45 degrees. How would I accomplish this?
View 1 Replies
Apr 13, 2006
I am trying to make a so called pixel effect in witch I want to make a shape only from pixels that are positioned in some random place on the stage. And all these pixels move to a certain point and create that shape. I've been looking into BitmapData Class but I don't now if that is the best way to do it.
View 2 Replies
Nov 19, 2009
I added a Menu_mc on my stage. Initially, this should be at the center of the stage and when I click on it, it will tween on the upper left corner of the browser. However, when I resize the browser, the Menu_mc goes back to the center of the screen.
I have tried separating a different actionscript file where it is specifically for initialization of the object and another one for resizing. And then when I call it on my main AS file it goes like this:
Code:
// Add the symbols to stage
var Menu_mc = new Menu_MC();
addChild(Menu_mc);
[code]...
But it seems futile.
View 6 Replies
Jun 30, 2009
I am using a ScrollPane in my application(viz., instance name is: myScrollPane). When I view the contents of the ScrollPane, it shows them perfectly. My issue is: When I try to view data present inside the ScrollPane, if I move the Vertical-ScrollBar of the ScrollPane to middle(or somewhere from top to down) and then click on Submit button(viz., instance name is: submit_btn), then its Vertical ScrollPosition must be reset from middle(or any position where we leave it before) to top(or initial position). Hence, I need to move the Vertical ScrollPosition of ScrollPane to top (or) initial position. Everytime, I need to refresh the VerticalScrollBar Position when I click on the submit button. How to do it?
View 1 Replies
Feb 3, 2012
I have simple image gallery, where images are placed one next to another and the mask is revealing only one of them. Now I want to tween position of the images, but when I do that the mask is "traveling" alongside with the images..
View 4 Replies
Nov 12, 2007
So I'm trying my hands on some full browser flash and after reading a couple of tuts I wrote this
Code:
#include "mc_tween2.as"
Stage.scaleMode = "noScale";
stageListener = new Object();[code]...
The trace's are because it didn't work like I thought it would.Etc the middle movieclip didn't center itself but rather positioned itself seemingly how it pleased so I traced its x position and the var stageXcenter position and like suspected it shows different values.
View 2 Replies
Feb 9, 2011
i want to take btn1 position half wwidth of own x position on stage
View 1 Replies
Apr 4, 2009
I have 3 buttons slightly overlapping each other, all on one layer. What i'd like to happen, is for whichever button is rolled over with the mouse to show up on top of the other buttons..
View 2 Replies
Mar 6, 2010
I'm working on a game where clicking an object causes cartoon animals to appear. The animals stick around and do a little animation for about 5 seconds, before disappearing. I'm having a problem where if I click the object before the animal disappears, another appears on top of it.This is my code:
on (release) {
i = Math.ceil(Math.random()*3);
if (i == 1) {[code]...........
I'm trying to find a way to make it so "on release" is disabled for a set period of time once it executes, enough time to ensure the animal movie clip playing has disappeared.
View 1 Replies
May 19, 2009
using 'drag and drop' in flash without overlapping?
For example - I have a list of buttons i drag to an area on the stage. I do not want my buttons to overlap.
View 3 Replies
Nov 20, 2010
I am facing the problem in showing Ajax Modal Popup Extender over Flash.when Popup comes out it will overlap by flash(Its giving me problem in IE 8,its work fine with the Firefox).
View 3 Replies