ActionScript 2.0 :: Positioning Mcs On The Stage?

Aug 24, 2011

I'm trying to make some mcs be displayed from alpha 0 to 100, one by one in the stage and in random positions. I've managed to make appear it randomly from alpha 0 to 100 with this code:

Code:
mcs = new Array("mc0", "mc1", "mc2", "mc3", "mc4", "mc5");
mc0._visible = mc1._visible = mc2._visible = mc3._visible =mc4._visible =mc5._visible = false;[code]....

The strange thing is that only some mcs are positioned randomly and others stay in the same position.

View 3 Replies


Similar Posts:


ActionScript 2.0 :: Positioning Mcs On Stage

Aug 24, 2011

I'm trying to make some mcs appear to alpha 0 to 100, one at one in the stage and in random positions. I've managed to make appear it randomly from alpha 0 to 100 with this code:[code]The strange thing is that only some mcs are positioned randomly and others stay in the same position, but not always the same.

View 1 Replies

Actionscript 3.0 :: Determining Which Mc Is On Stage And Positioning It?

May 19, 2011

I have a series of movieclips acting as buttons that load different flashvars video srcs onto the stage.When the swf loads --- the first button is added to the stage after a 20 sec Timer completes.As you click through each button, the one just CLICKED is removed and a new button is added in its place.All the buttons are set to dynamically be centered on the stage. However, the function that is positioning them is called BEFORE the first button is on stage, throwing the error (Error #2007: Parameter child must be non-null.)here is the code inside of the windowResize method which positions the buttons.

Code: Select allprivate function onWindowResize(e:Event):void
{
//position hidden buttons[code].....

Even though I've set up a boolean var and set it to true after the first button has been added to the stage -- the method still tries to find the first button and gives me a error saying that it must be non-null.Basically I want to make sure that it doesn't try and position the first button before it has been added to the stage. I'm not sure if encapsulating this method inside of another Timer is a good idea.

View 1 Replies

ActionScript 2.0 :: Y Positioning - Keep Browser At Top Of The Stage

Jul 29, 2008

I have a bottom bar on a site that has he following code: nav_menu.menu_bars._y = 0; But I want it to be at the top of the stage. Sorry for such a noob question, but how do it? I've tried nav_menu.menu_bars._y = -600; but when the browser is resized it obviously moves down the page. Is there a bit of code to keep it at top of the stage?

View 1 Replies

ActionScript 3.0 :: Positioning After Stage Resize?

Aug 25, 2011

coordinates in flash, particularly after resizing the flash player window.I have an mc on stage and draw an ellipse inside that mc. The movie is of size 800 x 600.

Code:
var ellipse:Shape = new Shape();
ellipse.graphics.beginFill(0x6CCDF4, 0.5);
ellipse.graphics.lineStyle(4,0x186B87);

[code]....

If I check the coordinates of that ellipse from it's transform property, I see that the top left is at 400, 300.

Code:
ellipse.transform.pixelBounds.topLeft.x
ellipse.transform.pixelBounds.topLeft.y

This seems fine to me as this position is in relation to the stage, yes? If I convert this to a position local to the container I get values ~0,0.

Code:
var stagePoint:Point = new Point(ellipse.transform.pixelBounds.topLeft.x, ellipse.transform.pixelBounds.topLeft.y);
var localPoint:Point = join.canvas.globalToLocal(stagePoint);

When the flash player window is resized, the coordinates change entirely. Instead of being at 400,300 the transform property indicates that it is at 640, 510. I assume this is because the viewport has changed, but the stageWidth and width properties of the stage do not change.

View 12 Replies

ActionScript 3.0 :: Positioning External Flv Files On Stage?

May 21, 2009

i am loading 3 flv files so that the first file plays once and the other two loop afterwards. Now i am interested is it possible to position the flv files on the stage to certain coordinates when they start to play (so for example that the first flv plays as default in the centre, the second flv file plays a little bit right and the third plays a little bit left). This is the code i'm using:

[Code]......

View 9 Replies

ActionScript 3.0 :: Positioning XML Slideshow Images On Stage

Oct 12, 2009

I have a xml slideshow that is working fine. The problem I am having is all of the images load in at x=0 and y=0. I would like to have the images load at a specific x coodinate and y coordinate on the stage. I have been looking at other code examples to see how to fit this in to mine but I keep breaking it.

Here is my code: 

[Code]....

View 5 Replies

ActionScript 2.0 :: Positioning Buttons Always At The Bottom Of Stage?

Apr 1, 2007

I have a group of 6 buttons which on my stage sit in the center and are 20 pixels from the bottom, I am trying to create a bit of a liquid layout, and the browser is going to be able to resized by the user. I want always for the buttons to stay at the bottom in the center of the browser 20 pixels from the bottom no matter wether it is resized too

View 7 Replies

Actionscript 3 :: Positioning Nested Movieclips Based On Stage?

Aug 12, 2010

I have multiple nested movieclip in its own different movieclip, and i would like to arrange them accordingly. My idea was to use the localToGlobal function. I can get the position of the MC on stage, but how do I use the function and place the MC based on stage?

cAPos = new Point(objectA.y);
newcAPos = objectA.localToGlobal(cAPos);
cBPos = new Point(objectB.y);
newcBPos = objectB.localToGlobal(cBPos);
objectB.y=objectA.y+objectA.height <-- based on stage

View 1 Replies

ActionScript 3.0 :: Giving Object Random Stage Positioning?

Jul 20, 2010

so i am giving these objects random x and y coordinates on the stage, but i need each object to be spaced apart from each other (lets say 20px) how can i achieve this. I have got the following code:

ActionScript Code:
for(var i:int=0;i<=bubbleNumber;i++){
var bubble:Bubble = new Bubble();

[code].....

View 2 Replies

ActionScript 2.0 :: Positioning Big Image To Absolute Middle Of Stage?

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

IDE :: Relative Positioning With X AND Y?

Feb 13, 2009

I'm looking to create something like the link below, [URL].. however I need it to work on both x and y,I've been trying for days to figure out a way to pull this off,

can anyone point me to a tutorial or an example of something along those lines?

View 5 Replies

ActionScript 3.0 :: Positioning Loader For Swf?

Mar 9, 2009

I am trying to position my loader for an external swf. Can anyone help me. Here is the code that I currently have to load the swf. These are the positions that I need x=0, y=180.

Code:

stop();
var myLoader:Loader = new Loader();
myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, swfLoadComplete);
function swfLoadComplete(loadEvent:Event)

[code]...

View 2 Replies

ActionScript 2.0 :: Positioning And Resizing A .jpg

Jul 12, 2010

I'm using action script v2 to load a .jpg from a button.I'm using the command 'loadMovieNum("photo.jpg",4)'What script could I add in to resize the jpg to specific dimensions and position it at a particular x,y coordinate?

View 2 Replies

ActionScript 3.0 :: Positioning MCs According To Height?

Aug 24, 2010

I need to create the attached jpg, but i'm not sure of the best way to tackle it. The news posts are loaded from XML and will vary in height so they need to somehow be sorted so that if one is going to come off the page, then it's put into the next page - where the user will click the scroll buttons to view.

1/ Load article from XML

2/ Create a postMC_0 and add article bits to it (date, title, body)

3/ Record height

4/ Create a newsColumn_0 and add postMC_0 to it

Then a loop:

5/ Load next article

6/ Create a postMC_1 and add article bits to it

7/ If difference between postMC_0 height and newsColumn_0 height is greater than the height of postMC_1, then add postMC_1 to newsColumn_0.

8/ If not, then create newsColumn_1 and add postMC_1 to it.

9/ Loop back to 5 (increasing the numbers each time, so postMC_2, etc) Then just make the scroll buttons function according to how many columns have been created..

View 21 Replies

ActionScript 1/2 :: Loading And Positioning A Swf Into A Swf

Sep 8, 2010

This is the swf I'm trying to load. These actions load and position a small simple swf just fine and the trace in the onLoadProgress function indicates that it loads completely but I can't see it. What am I doing wrong?

[Code]...

View 12 Replies

Flash :: Get Positioning After Rotation?

Nov 28, 2011

I built an app in flash where you can rotate objects and save positions and rotation to xml.... that xml then feeds html to produce a layout that is then rendered the a pdf It seems that every time it goes to the html, a rotated object in positioned a little to the lower right then the position in flash.

I know the rotation in css in different, but I think if I can find the true top left of the rotated object in flash and pass that it will solve the issue.

I tried this

newx = imageHolder.parent.localToGlobal(new Point(imageHolder.x,0)).x;
newy = imageHolder.parent.localToGlobal(new Point(0,imageHolder.y)).y;
also this imageHolder.parent.globalToLocal(imageHolder.localToGlobal(imageHolder.getBounds(imageHolder).topLeft));

neither work. Is there something else?

View 1 Replies

ActionScript 3.0 :: Positioning And Resizing?

Nov 27, 2010

I have been working on this to no avail. I would like to individually position different movie clips unto my flash site, yet it will only let me position one. Well.. more specifically it will perfectly position rock_mc, but transition_mc wont appear centered until I resize the screen manually. Is there any way I can fix this to have it appear in position from the beggining?

Code:
function init()
{

[code].....

View 1 Replies

ActionScript 3.0 :: Relative Positioning With X And Y?

Feb 13, 2009

I'm looking to create something like the link below,
[URL]
However I need it to work on both x and y.

View 2 Replies

ActionScript 2.0 :: Top Right Dynamic Positioning?

Mar 8, 2007

how would you go about positioning a MC in the top right hand corner - a few pixels. And How to get it to stay even on Resize? to get it to stay in that corner so it moves with the screen resize?

View 2 Replies

ActionScript 2.0 :: Positioning MCs And Textfields?

May 1, 2007

Here's my code:

Code:
for (var i = 0; i<nTotalPics; i++) {
main.createEmptyMovieClip( "container"+i, i );
var container:MovieClip = main["container"+i];
container.createEmptyMovieClip( "pic"+i, i );

[code]....

First, if I add "trace (pic._name);" inside the onLoadInit function it outputs "pic3,pic2,pic1,pic0". Why does it show up in reverse order of the for-loop?

Second, is the "pic:MovieClip" in "mclListener.onLoadInit = function(pic:MovieClip)" pointing to the "pic" in "mcl.loadClip( astrImages[i], pic );"? If not, what is it pointing to? If it is, can I add another variable after "pic" so that I can pass it inside the onLoadInit function? Ultimately what I would like to do is create a textfield under each pic.

View 1 Replies

ActionScript 2.0 :: Positioning Mcs On The Y Axis

Nov 20, 2008

I am using this actionscript to obtain full screen flash in AS2 but am having problems positioning mcs on the y axis (the x is no problem).

[Code]...

I am trying to get the mc "buttons" position in the top right of the browser window but I cant get the height value correct. When the width is used on its own it works perfectly.

View 2 Replies

IDE :: Positioning The Movie Clips?

Jan 16, 2009

I have five rectangle shaped movie clips....I need to change their _y position randomly by clciking a button..but there must be 10px space between them... so how do I modify the code to do it ?

PHP Code:

myArray = new Array(m1, m2, m3, m4, m5);for (i=0; i<=myArray.length; i++) {_root["m"+i]._x=400;_root["m"+i]._y=Math.floor(Math.random()*300)+20;} 

View 6 Replies

ActionScript 2.0 :: Positioning Mc At Fullscreen

Feb 1, 2009

i have seen websites with fullscreen .swf and i dont know what kind of script they used to have the movie clips positioned constantly i.e. 20px from right border of the screen while all people have different resolutions.

View 2 Replies

ActionScript 2.0 :: Positioning MovieClip To Always 20px Below Another

Apr 8, 2009

I have a movie clip named "footer" and another movieclip named "portf". I want footer to always be 20 pixels below movieclip portf. How can I do that.

View 7 Replies

ActionScript 2.0 :: Flash 5 - X And Y Positioning Of MovieClip

Oct 28, 2009

I always run into the same bug concerning the x and y positioning of a Movie clip. When I try to get the X and Y values of a movie clip inside another movie clip, they aren't the same values (since I guess every MC has it's own x,y grid starting at point 0,0 where that MC is placed on the work area). How do I get the x and y values of a MC inside another MC when I want those values to be the same as the _root's x and y values? In other words: The movie clip that is inside the other one is moving on a simple guide path. I want to create "lasers" (or whatever) at its own coordinates every few seconds depending on where that moving MC is at when the shooting counter is up.

View 2 Replies

ActionScript 3.0 :: Can't Use StageWidth For Positioning When Resize

Sep 5, 2010

I'm trying to get the width and height of the stage to position my objects when the user resizes the window, but I can't figure out how.

I've Googled a lot and found some examples and my last try looks like this [code]...

View 4 Replies

ActionScript 3.0 :: Writing Loops And Positioning?

Feb 2, 2009

I am writing a loop and want to position 25 boxes in a square. I can make 5 boxes appear in a line, but can't make 25 boxes appear in a square without writing 5 seperate loops (e.g. j, k, l, m, etc.). This seems long-handed, can I shorten the code? Here is the code I have used so far:

var box:Box;
for(var i:int = 0; i < 5; i++)
{

[Code].....

View 2 Replies

Positioning (centering) An Externally Loading SWF

Aug 3, 2009

how to make it so that it is always centered horizontally in the middle of the browser window. I am having issues making it so that it is centered vertically between 150pixels from the top to the bottom. This will make it so that if the window is small the swf will be right at y=150 but if the window is large it will have equal spacing between the top(150) and the bottom of the window.

[Code]....

View 3 Replies

ActionScript 3.0 :: Positioning/Layouting Photos?

Oct 24, 2011

We have a flash application that developed using Adobe Flash CS5 - AS3 that will display an article with photo, however, the article has a particular layout to have a "float left" effect of the photo and articles should wrap around it and adjust. I do NOT know how to this on flash but what I did is just to create two dynamic text and do the layout but sometimes since this is a dynamic content feed, the article body doesn't look good at all since I am only doing substring on the whole content and display just to cater the layout.

View 20 Replies







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