Actionscript 3 :: Modify Position Of Children Inside Loop?

Mar 3, 2010

I'm trying to make a dynamic image gallery from and xml. From my tutorials, right now i've got it so it will constantly add the next thumbnail below the other, which is fine, but I'm trying to figure out how to make it that once it reaches a certain y coordinate, it will move the x coordinate over and stack them again. So that rather one long list of thumbs, it will be a side by side stack. For some reason, I can't get it in my head how something like this would work. My goal is to have a side by side stack that I will end up putting in a movie clip that will be masked to show only 2 stacks at a time. Then when clicking a button will slide it over. I was planning to use the "movieclip.length" to calculate how far over to move it, but i haven't gotten that far yet. This is what I got:

[Code]....

View 1 Replies


Similar Posts:


ActionScript 3.0 :: [CS4] Children Inside Children - 1119: Access Of Possibly Undefined Property NumChildren

Jan 12, 2011

I have a Sprite called pageContent. Inside pageContent are 12 more Sprites with unique names, a couple of Buttons, and some TextFields. Inside each of the 12 Sprites I have either one or two TextFields and one TextInput. My question is, since they are children inside a child of pageContent, how can I access them? Here is how I am trying to do it:

[Code]...

In my mind, this should totally work. But surprise, surprise, it doesn't. I have debugged it and it works fine for the first two lines, but when it tries to get numChildren of a Child of pageContent (line 3), I get this error: PHP Code: 1119: Access of possibly undefined property numChildren through a reference with static type flash.display:DisplayObject.

View 4 Replies

ActionScript 3.0 :: Modify This Menu To React To Mouse Position?

Feb 6, 2009

I am trying to modify a fla i got from flash den. [URL]

It works by clicking on menu items, and or using your mouse wheel.

I am trying to make it so that it responds to mouse movement. So if you mouse up, the menu moves up, and if you mouse down, it moves down.

The file populates the menu using xml, and below is the primary code that makes it work.

Every mouseposition functionality that I've worked on required that the content be in an MC, but this is all xml generated content, and I don't know how to target or control it.

package net.flashden.lydian {
import fl.transitions.Tween;
import fl.transitions.easing.Strong;
import flash.display.MovieClip;

[Code].....

View 1 Replies

ActionScript 3.0 :: Modify Object X Position Slowly - Shrinking Effect

Jun 8, 2011

I want to modify an object's x position slowly (e.g. 4 pixels per frame) from actionscript. How do I go about doing this? It would be simple if AS3 had Sleep() and DoEvents() functions - are there equivalents?

View 4 Replies

Modify Objects Inside Frames With It In A Permanent Way?

Apr 18, 2010

I have a MovieClip symbol created with flash in a fla file library. There is a textfield in frame one of this movieclip's timeline . There is another frame in the movieclip timeline. There is a custon class definition for this symbol. It is a flipping card in a memory game.

I access the textfield by going to frame 2 (gotoAndStop(2)) and setting the textfield's text property ( this.field.text = "hello" ). However if I go to frame 1 and then return to frame 2, the text becomes the original one in the library's symbol. I have to modify the text propery again in a showFace method I've written.

Besides, I cannot pass parameters in the constructor because it is a symbol in the library and that would give errors.Is there a way I can set properties inside frames permanently?

View 1 Replies

ActionScript 3.0 :: Modify Dynamic Text Box Inside A MovieClip?

Jan 1, 2010

i'm struggling with the following, i'm building an xml based flash menu. For the buttons I used a MovieClip 'mainMenuItem' that contains the MovieClips 'MenuBackground', 'menuBlueLine' and 'menuText', all of them with the exported for AS and export in frame 1 checked.

in the following code i am trying to get the text of an array into the dynamically build menu.

Code:
var menuHoogte:int=34;
var menuY:int=0;
var menuArray:Array=new Array();

[Code]....

View 5 Replies

Actionscript 3 :: Re-position The Children Of A MovieClip?

Oct 14, 2011

I am having a container mc with 5 children mcs. children names mc0,mc1....mc4.

cont.getChildByName("mc"+Number(cont.numChildren-1)).x =
cont.getChildByName("mc0").x - 20 *1.2;

after this re-position process.. I want to set the last item position as 0 and so on. How can I do this?My target is to attain a circular movement.like

[mc0][mc1][mc2]
[mc2][mc0][mc1]
[mc1][mc2][mc0]
[mc0][mc1][mc2]

View 2 Replies

ActionScript 3.0 :: Order Children By X Position?

Sep 8, 2009

take the children of an object, the children are groups nested within a parent group, and sort them based on their x coordinate. so the one furthest left (lowest x) is in position 0 and so on.

View 3 Replies

Actionscript 3 :: Force A Sprite To Position Children In Reference To 0,0?

Sep 26, 2010

I'm trying to add some scroll bars to a Sprite using ScrollRect. The Sprite starts empty and when I add something at 500, 500, it should scroll, as it is outside the viewport. Unfortunately, adding a 10x10 Sprite at 500, 500, doesn't make my Sprite change its size to 510, 510, but to 10, 10 ::- (.

We all know that DisplayObjectContainers resize according to what's put in them. But I didn't know up until today that if you put something at 500, 500, the Sprite / DObjContainer will NOT resize from 0, 0 to 500, 500, but simply jump directly at 500, 500. Annoying, as I cannot put Scrollbars on something whose content fluctuates so. I need 0, 0 to remain 0, 0 and if something is placed at 500, 500, the sprite's height should increase with 500 + that something's height.

View 3 Replies

ActionScript 3.0 :: Force A Sprite To Position Children In Reference To 0,0?

Sep 26, 2010

I'm trying to add some scroll bars to a Sprite using ScrollRect. The Sprite starts empty and when I add something at 500, 500, it should scroll, as it is outside the viewport. Unfortunately, adding a 10x10 Sprite at 500, 500, doesn't make my Sprite change its size to 510, 510, but to 10, 10 ::- (.

We all know that DisplayObjectContainers resize according to what's put in them. But I didn't know up until today that if you put something at 500, 500, the Sprite / DObjContainer will NOT resize from 0, 0 to 500, 500, but simply jump directly at 500, 500. Annoying, as I cannot put Scrollbars on something whose content fluctuates so. I need 0, 0 to remain 0, 0 and if something is placed at 500, 500, the sprite's height should increase with 500 + that something's height.

View 9 Replies

Flex :: GroupingCollection: Loop Through The Children

Nov 13, 2009

I am using a GroupingCollection to bind my advanceddatagrid. I have used groupingcollection to group the data by date.

Now I need to select the data in the datagrid through the code. I need to loop through the adg's dataprovider and select the item that matches the criteria for the selection.

View 2 Replies

Flash :: Loop Through Children And Display Each - As3

Mar 30, 2010

How do I loop through all of my children, and display each? I would like to know the best way to do this. my children and containerfive children, one plays every sec, 1,2,3, etc.

[Code]...

View 1 Replies

ActionScript 2.0 :: Adding Properties And Events To MovieClips Inside A Loop Inside A Function

Dec 8, 2009

I have done this same thing in ActionScript 3, but am not familiar with ActionScript 2, which I am forced to use for this project. I am loading products into a SWF via XML and attempting to add a click event to each dynamically-created movieclip. Simply tracing the text from a node in XML will do for now. I'd like to assign a property called "desc" or "description" to each movieclip and have it trace that property's value when clicked. Here is the relevant portion of my code as it stands:

ActionScript Code:
var iXML:XML = new XML();
iXML.ignoreWhite = true;

[Code].....

View 6 Replies

AS3 :: Image - Add A Child Inside A Newly Created Instance, Inside Of A Loop?

Feb 2, 2005

I am trying to create a gallery where each thumb is housed inside of it's own movie clip that will have more data, but it keeps failing because it won't let me refer to the newly created instance of the movie clip. Below is what I am trying to do.

var xml:XML;
var xmlReq:URLRequest = new URLRequest("xml.xml");
var xmlLoader:URLLoader = new URLLoader();

[code]....

View 2 Replies

ActionScript 3.0 :: Calling On Children Through A Loop And Using E.currentTarget

Aug 25, 2010

I have a number of MC's that I've assigned listeners to through a loop that references an xml table.
 
//create listeners for all biketrails mc's and designate functionsfunction createListenersbk():void{for(var i:uint=0;i<bktrlXml.row.length();i++){var mc:MovieClip =

[Code].....

I thought I'd be able to replicate the above code and somehow refernce the "idlink" children through the e.curentTarget. 

View 1 Replies

Flash :: Loop Through Children In MXML View?

Mar 5, 2011

I have mxml component and want to go through all its children, that I've created in it and not to go deeper. For example I have this view:

<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"

[Code].....

View 1 Replies

ActionScript 2.0 :: Loop Through Children In MovieClip And Get Values

Nov 8, 2009

I have a movie clip (mc_moviegroup) which is made of a group of many dynamic text fields. I want to loop through the dynamic text field children of mc_moviegroup and pull out their text values in a string. Does a movie clip have a property which gives the number of it's children movieclips?

View 2 Replies

ActionScript 3.0 :: Loop Through Children And Add Them Instance Names?

Jan 14, 2010

how could I make a simple loop which loops through the childrens of specific movie clip and add each of them instance name lets say "iname", since I have movie clip in which childrens are not added by code.

And if I'm sure I could acces those childrens then by code like iname.x = 100?

View 6 Replies

ActionScript 3.0 :: Add Children To These And Tween Them With A Loop In Function?

Sep 13, 2010

so on my main stage I have clips that are placed with AS.

container.1
container.2
container.3
and so on....

I am trying to add children to these and tween them with a loop in this function.

[Code]...

View 4 Replies

AS3 :: Add A Child Inside A Newly Created Instance, Inside Of A Loop?

Jun 6, 2010

I am trying to create a gallery where each thumb is housed inside of it's own movie clip that will have more data, but it keeps failing because it won't let me refer to the newly created instance of the movie clip. Below is what I am trying to do.

var xml:XML;
var xmlReq:URLRequest = new URLRequest("xml.xml");
var xmlLoader:URLLoader = new URLLoader();

[Code]....

It dies every time on that last line. How do I refer to that vidThumbn instance so I can add the imageLoader? I don't know what I'm missing. It feels like it should work.

View 2 Replies

ActionScript 3.0 :: Controlling Multiple Children Created In For Loop?

Nov 15, 2011

So I'm working on a Flash version of the old "Robots!" game. In case you're not familiar: the game lays out a number of robots on a grid (number varies by level), and drops the player in the middle. As the player moves around the grid, the robots all move towards the player one grid space per player move. The object is to destroy all the robots by making them run into each other (or the rubble left from previous collisions) without letting a robot run into you.

Anyway, my robot hordes are being created on the stage through a "for" loop, and each icon is a child of variable "evilBot" which references a library item with the class name "enemy."

ActionScript Code:
function placeBots():void{
for (var c = 0; c < numBots; c++){
evilBot = new enemy;

[Code]....

I've run a trace on "evilBot.name" and verified that the children are being given instance names of "evilBot0, evilBot1 ..." and so on. But no matter what I try, I can't issue instructions (regarding movement, orientation, etc) to individual children.

Using a for loop and "this["evilBot" + x]" returns a "term is undefined" error.

If I store the instance names in an array (named "botName") and use "evilBot.name[botName[x]]", I get the error "Property evilBot0 not found on String and there is no default value."

View 9 Replies

ActionScript 3.0 :: Xml.children() Returns Grand-children And Gr8-gran-children?

Nov 18, 2009

I'm making a OSX-finder-type file browser in CS4.The Structure for the folder and files is being generated by a PHP in a XML, heres an example:(sorry the xml is not sorted, but the command i'm using in php doesn't sort it)

Code:
<root>
<dir name="images">

[code]....

View 2 Replies

ActionScript 3.0 :: Get The ID Of An Item In A Loop Inside A Loop?

May 15, 2011

I'm trying to make a matching pairs game. First of all I'm making all the tiles, using a loop inside a loop. How do I get the ID of an item inside that loop? My code looks like follow:

Code:
var matches:Array=new Array(1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8);
makeTiles();
function makeTiles() {

[Code].....

View 3 Replies

Flex :: Elements - Loop Over Children Of A Container When They Are State-dependent?

Aug 17, 2011

Flex's new States re-parents visual items that are marked with includeIn/excludeFrom. If I have a Group (MainGroup) with 5 children/elements that are state controlled, is there still a way to get a reference to MainGroup's children? mainGroup.numChildren and mainGroup.numElements don't work since the children are re-parented. At best, they show 1.

<s:states>
<s:State name="view1State" />
<s:State name="view2State" />
<s:State name="view3State" />

[code]....

View 4 Replies

ActionScript 3.0 :: Remove The Children For All The Buttons Inside Array

Mar 21, 2012

So i have a calculator and converter on two different scenes. I have two arrays which i stored for my number and operator buttons. I am using a button function to switch between scenes and would like to remove the children for all the buttons inside that array however it only removes one button inside the array. This is the code i have so far: My buttons:

[Code]...

View 1 Replies

ActionScript 3 :: Calling Children Inside MC - GetChildByName / GetChild At?

Jul 20, 2010

I found out that I can't target a object inside the main MC if I use getChildAt / getChildByName. It will return me
Error #1119: Access of possibly undefined property someProperty through a reference with static type flash.display:DisplayObject.

I was trying to use something like
this.getChildAt(0).getChildByName("objectName")....

View 1 Replies

Flash :: Address The Object That Has Been Clicked But Not The Children Inside It?

Aug 5, 2011

inside a MouseEvent.CLICK function, I usually used e.target to address the movieClip that I clicked, but that only work with a movieClip that doesn't have any children (such as text and other symbols) inside. When it has children inside, the e.target return the child inside the Mc but not the Mc itself. The e.currentTarget didn't work, either; it returned [object MovieClip] but not the instance name of the Mc.

View 3 Replies

ActionScript 3.0 :: Scale Container MovieClip But Not Children Inside

Jan 15, 2010

What's the best way to scale a container mc but not scale the children inside it? Basically I have a box mc with a background colour, with a logo added using addChild, if the user changes the browser size the box scales to the height of the window but it's also scaling the logo, I just want to change the height of the container box really.

View 4 Replies

ActionScript 3.0 :: Swap Children Of Stage From Inside A Child?

Apr 26, 2008

I have 9 movie clips which are all of the same object, they get larger or smaller as the mouse gets closer to their respective centers. The functionalilty for this is in an AS3 class file that extends flash.display.MovieClip.How do I go about swapping depths so that the largest one is in the foreground, I am new to AS3 and dont seem to be able to find a way of getting the depth of the movieclip I am currently inside (this) and if I try to access the stage to call swapChildren I get the following runtime error:

View 6 Replies

ActionScript 3.0 :: Remove The Children For All The Buttons Inside The Array

Mar 21, 2012

So i have a calculator and converter on two different scenes. I have two arrays which i stored for my number and operator buttons. I am using a button function to switch between scenes and would like to remove the children for all the buttons inside that array however it only removes one button inside the array. This is the code i have so far: My buttons:

[Code]...

View 2 Replies







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