ActionScript 3.0 :: Manipulating Class References In A Array?

Feb 27, 2010

i retrieve a list of instances located in a array to manipulate them in a variable holder. Normally, the operations can be made between two instances stored in a simple variable to variable fashion and it works realy fast.I analysed two main operations: retrieving references in a array to a variable and get or set a value from the variable reference.Here are the objects used to perform the test operation:
 
var v4:Vector.<Person>= new Vector.<Person>();//List of Persons instance
var refHolder:Person; //Typed referencevar refHolder2:*;   //Not typed reference
 Test #1: looping 200 000 times and only retrieving references from the array v4.[code]........
 
So my conclusion with that test is that with a typed reference you spend more time assigning a reference than manipulating a value from the reference With a not typed reference, the time spent is in manipulating the reference in the variable.Which one should i use or what should i do to have better performance with manipulating references from arrays?
 
Here are the files i used to test this:
reference.swf     //Online example
reference.zip     //Source file

View 6 Replies


Similar Posts:


ActionScript 3.0 :: Manipulating With MovieClips In Array

Jan 22, 2009

I want to dynamicly add images from XML to movieClips and then add event listeners to these movieClips. What is the best solution? XMl loads correctly, it also add 2 movieclips on stage, but it throws errors when I try to add event listeners to movieClips. How could I do that? I want to go to different frames on release of some movieClips. How can I please recognise each movieClip and manipulate with that movieClip ? (resizing,...)

[Code]....

View 1 Replies

ActionScript 3.0 :: Manipulating MovieClips In An Array

Jan 19, 2011

I have a rather unusual problem. I've got an Array consisting of ten different MovieClips (all pre-placed on the stage), and would like to be able to manually use the gotoAndStop and gotoandPlay commands on these via the array. I've tried ActionScript Code: //This script does not work IconArray[1].gotoAndStop(1); however it simply throws out an error. Is such precise manipulation of MovieClip arrays even possible, and if so, how would I code it? (Nb: I've looked at the ForEach method, but couldn't find a way to make it sit my current dilema).

View 4 Replies

ActionScript 2.0 :: [Flash 8] Manipulating Objects In An Array?

Aug 8, 2006

This should hopefully just be a quickie. I'm slowly starting to learn Flash and Actionscript and right now I'm a bit more stuck than usual. I have an array, "container", to which new movieclips are added by clicking a button. When they are added they are given a name, "pic" + i, and are added at the corresponding index "i". Now, what if I want to change the position of a certain movieclip in the array or alter its alpha value? I tried something like:

[Code]...

View 4 Replies

ActionScript 3.0 :: Manipulating Instances From External Class?

Feb 3, 2006

I've got an image slider that I'm trying to convert to external classes (OOP and everything). I've got four bars on stage (bar1, bar2, etc.) and I'm shifting them left and right from a "Shifter" class through library linkage. I can get the individuals to shift, but I want more than one to shift (click the right-most one and all open, click the left-most one and only it opens). Like an accordion, basically. I'm new to OOP, and I can't access the individual instances. So far, I can trace the instances using:

for (var i:int=0; i < numChildren; i++) { trace(getChildAt(i).name)}
(and get: instance1, instance2, etc.)

How do I record the instance into my external class? Something like:

(very rough example)
var bar1:Object = getChildAt(i);
var bar2:Object = getChildAt(i + 1);
etc, etc

I've tried pushing them into an array. No luck.

View 4 Replies

ActionScript 2.0 :: Manipulating Class Generated Movieclips

Sep 24, 2006

I have been able to draw rudimentary shapes on the main timeline by importing this class on the main timeline (first frame) and plugging in the requisite parameters.[code]When I have created movieclips without actionscript, then attached AS 2 classes to them I can manipulate them. If there is not a way that I can manipulate AS-generated clips on the main timeline, is this doable from within the class?

View 4 Replies

ActionScript 3.0 :: Manipulating Instances From External Class

May 6, 2009

I've got an image slider that I'm trying to convert to external classes (OOP and everything). I've got four bars on stage (bar1, bar2, etc.) and I'm shifting them left and right from a "Shifter" class through library linkage. I can get the individuals to shift, but I want more than one to shift (click the right-most one and all open, click the left-most one and only it opens). Like an accordion, basically. I'm new to OOP, and I can't access the individual instances. So far, I can trace the instances using:[code]

View 6 Replies

ActionScript 3.0 :: Movieclip References In An Array

Feb 27, 2011

I have a movie clip in which I have a number of sub movieclips. The number of sub movieclips can vary, so I would like to keep track of them in an array. I am doing that like so:[code]The trace seems fine, showing the names of the correct sub movieclips, but when I try to change the alpha I get this error: TypeError: Error #1009: Cannot access a property or method of a null object reference.

View 3 Replies

ActionScript 3.0 :: Creating Object References In Array

Oct 29, 2010

I want to do is create several arrays to hold groups of movie clips (i am using as buttons) which have similar functions so that I can add event listeners using a for loop statement rather than making a huge list of add and remove event listeners.I have seen this method working before but I cannot get my code to work!! This is probably a very noob concept but I have been struggling with it for hours.Ok, so in the extends movie clip bit on my as file I declare the array as such:public static var controlBtns:Array;Then in the initializing function I put values into the array as such: [code]The trace seems to output all the object names (as they are listed in the library) and then I get this error: TypeError: Error #1010: A term is undefined and has no properties.Which is kind of obvious as I cannot seem to access the movie clip instance names that I have set up in the array.I tried putting quotation marks around the names in the array making them strings but then I can't access properties of strings - which is obvious enough to.

View 8 Replies

ActionScript 3.0 :: MovieClip References From A Class?

Jul 15, 2009

I have a files that has movie clips and nested movie clips on the stage. I am now writing a class and want to give the MCs event handlers and other properties.
 
When I do something like the following: myMC_mc.MyOtherMC_mc.mouseEnabled = false;
 
I get the error: 1120: Access of undefined property myMC_mc.
 
I added this to the top of my class and it seems to take away the error, but I thought this was not needed in AS3 anymore.

private var myMC_mc:MovieClip;
private var myMC_mc.MyOtherMC_mc:MovieClip;
 
What do I have to do to not get the error? How is this done right?

View 3 Replies

ActionScript 3.0 :: Embede A Class That Is Only References From Xml?

Jan 24, 2011

I have some classes that I want to be able to target them in xml.[code]...

the two ways I know of to embed the class is to associate it with an exported symbol or just reference the class name somewhere in the code (like just sticking the reference in the document class constructor)[code]...

View 2 Replies

AS :: Flex - Adding Local Filenames/References To Array?

Feb 27, 2010

how can i cycle thru a local folder to add all (or some) files names and references to that file in an array using actionscript 3.0?

var fileArray:Array = new Array();
for (var item:Object in "../myFolder/")
{

[code].....

View 1 Replies

ActionScript 2.0 :: Change Strings In Array To References To MovieClips

Sep 26, 2009

I have an array containing references to movieclips like this

ActionScript Code:
positionsArray = [posi1, posi2, posi3,posi4,posi5];
tooltipArray = [tooltipProy, tooltipAsig, tooltipRota, tooltipActi];

[Code]....

And the result is: tooltipArray = ["tooltipProy", "tooltipAsig", "tooltipRota", "tooltipActi"]; which doesn't work because the array no longer contains references to MovieClips but strings

2. NOT surrounding the name of my movieclip with ""
on (release) {
_root.tooltipArray.push(tooltipProy);
}

Which gives an undefined value

How can I "transform" the strings in the array to references to MovieClips?

View 4 Replies

ActionScript 3.0 :: Can't Access References That Are Defined Within A Class

Feb 2, 2010

I have a very simple class[code]...

when I click I get "undefined"

How do I get at references that are defined within a class when I am on the timeline

View 5 Replies

ActionScript 2.0 :: References To Variables Inside A Class

Mar 21, 2010

I'm pretty new to working wth custom classes, but so far everything has been working great - up to the point where I create more than one instance of the same kind of class. For example:

[CODE]...

Do I simply have to call the arrays different names??? I really don't want to, shouldn't by creating two different instances you subsequently create two different arrays in turn?

View 4 Replies

ActionScript 2.0 :: Class References Are Still There After Unloading Object?

Sep 29, 2004

loading external SWF's and its class files hanging around after the movie is unloaded....Its kind of tricky to explain, but you can see it very clearly in this file... http:[url]...Just run the main_stage.fla within flash [mx 04] and you'll see that if you click "Tester A" it will trace out "My Name is Tester A", then if you click on "Tester B" it will load a different swf, with a different class, but still trace out "My Name is Tester A" when it should be "My Name is Tester B"....

I have tried, unloading the swf's, removing the mc_Dropper and re-attaching it, re-declaring the variable testObj as null before declaring the class,

View 2 Replies

ActionScript 3.0 :: Manipulating An Ext Loaded Swf?

Feb 7, 2010

So I have a simple as3 project i'm creating in FlashDevlop and I was hoping to create the layout as a simple swf thats loaded in then move the assets where they need to go. Things like roll over states would be stored on different frames to make it nice and easy for designers so they don't have to know flash. And loading it is no problem but how do you target the movie clips inside it or how do you even attach it to the root? When I say target I mean as in how would I target it to change say the height or width. I know this is broad question so even pointers to a good FAQ or example project would be helpful. I spent a little time on google but all im finding is how to load a SWF not how to deal with it afterwards.

View 1 Replies

ActionScript 2.0 :: Manipulating MCs Attached To Other MCs

Aug 31, 2004

How do you address a mc attached to another mc?I have an array of movie clips some of which I have attached additional movie clips to. Now I need to alter scale/alpha etc of those additional movie clips.[code]How do I now manipulate the "ExtraMC" movie clips? I know I can use parent to get at the parent mc but how do I get at the "child" when names are dynamically created as above?

View 2 Replies

ActionScript 2.0 :: Manipulating Non Selected MC's?

Mar 26, 2009

I have a menu with 5 menu items that when an item is selected, the non-selected items need to be moved. All are movie clips. When user selects item 1, the remaining items will slide underneath item 1. I want to make a custom function so as to alleviate unnecessary code. I am moving the MC's with tween class.

View 1 Replies

ActionScript 2.0 :: Manipulating MCs Attached To Other MCs?

Aug 31, 2004

How do you address a mc attached to another mc?

I have an array of movie clips some of which I have attached additional movie clips to. Now I need to alter scale/alpha etc of those additional movie clips.

ie.

for (i=0;i<BasicMCArray.length;i++) {
_root.BasicMCArray[i].attachMovie("myExtraMc","ExtraMC" + i,depth++);
}

How do I now manipulate the "ExtraMC" movie clips? I know I can use _parent to get at the parent mc but how do I get at the "child" when names are dynamically created as above?

View 2 Replies

ActionScript 3.0 :: Calling An Array In One Class From Another Class?

Oct 13, 2010

I'm trying to call a function in one class from another class and I'm using an array in the function of the class that I am calling from the other class. The array is declared and instantiated in the one class but when the other class calls the function with the array in it I get an error #1010: A term is undefined and has no properties. because the class that is calling the function that contains the array doesn't know that it is already declared. Anyway here is the code.
 
//CLASS THAT CALLS THE FUNCTION OF THE OTHER CLASS WITH THE ARRAY:
public class SpaceWolf extends MovieClip
{
private var _playerMissiles:PlayerMissiles;

[Code].....

View 7 Replies

ActionScript 2.0 :: Loading & Manipulating Movies (CS3)

May 5, 2009

i have a photography website, the main 'index.swf' file has two scenes, one for the loader and one with the content.i have a navigation menu:item 1, item 2, item 3, and so on. i have 10 layers, my nav menu is on layer 10, at the very top.i also have a a layer for each one of my navigation menu content. Now i click on item 2, and i load a external movie clip called "fotos_mc" on to the stage and inside this movie clipe i load pic1.swf using: loadMovie ("pic1. swf", 1);it loads fine, except that it loads on top of my navigation menu, logo and so on, even it's on a layer that's under the layer where i have placed my menu and logo. is there a way that i have load my movie so that it displays behind my menue?

View 3 Replies

ActionScript 3.0 :: Manipulating Object In A TileList?

Oct 2, 2009

Okay, so I am filling a TileList component with custom "ChordUnit" MovieClip objects, each of which is associate to a ChordUnit ClassI've established a way of determining if any of these objects are being moused over or clicked:

public function setChordBinSong(song:int, extend:Boolean):void {
dpChords = new DataProvider();
for (var i=0; i < activeChords.length; i++) {

[code].....

View 10 Replies

Loading And Manipulating MovieClips Fullscreen

May 5, 2009

I am working with a site that's similar to : [URL]. When you click on Wedding Site and then go to the gallery, you will see the pics loading full screen and the navigation bar on top of the pics. What I have done is I have made each one of this pics a separate .swf file so
they load individually once they are called using the " loadMovie("pic1.swf") code line. On layer 10 (being at the very top) I have my menu so it will always display on top
of anything else. Now on layer 3, frame x I have a movieclip called : fotos_mc,
inside this fotos_mc on layer 1, frame 1 I call the swf using the code above:
"loadMovie(pic1,swf");
However when the picture loads, it covers the full screen on top of my navigation menu, on top of my logo etc. Which I dont understand why if the layer where I have placed my fotos_mc is under layer 10 which contains my menu and my logo.

View 4 Replies

ActionScript 2.0 :: Manipulating The Imported Movies?

Oct 28, 2005

I have a list of external movies. I want to import them only once and then use them as many times as I want. I need to attach them to other clips the same way I would attach them if they were in my current library with linkage option on.suppose i have a movie called s1.swf in the same location with my movie. then I have this code:

Code:

function createObj(objname, whichMc, level) {
_root.createEmptyMovieClip(objname, level);
_root[objname].createEmptyMovieClip("mc", 1);

[code]...

I don't know why the event handler for the movie "mc" is not invoked ... I have no trace record in the outpus window.

View 1 Replies

ActionScript 3.0 :: Manipulating Shape At Run Time?

Feb 12, 2009

anchor points for manipulating shape at run time?

View 2 Replies

ActionScript 3.0 :: Duplicating And Manipulating Loaded SWF?

Nov 12, 2010

I am trying to make a card game.

The main fla file loads an external swf file that is a movie clip that has the card art images (one card art on each frame)

This works good and I can view the loaded swf on the stage.

public function FinishedLoading(loadEvent:Event):void {
LoadedMovie = MovieClip(loadEvent.currentTarget.content);
addChild(LoadedMovie);
}

What I want to do in another function is to duplicate the load swf, so that I can have 52 of the same object, each with a different picture. I need to know how to create an instance of the loaded swf.

I would like to control each instance of the loaded swf by telling each one independently of each other to go to and stop at a specific frame such as 3 or 17, or 43, based on what card is needed at that time.

This code creates an error:

var NewCard:MovieClip = new LoadedMovie();

View 1 Replies

ActionScript 3.0 :: Accessing A Variable Within Another MC And Manipulating?

Aug 10, 2011

I have an mc with the variable called "Section" and I want to be able to change the contents of this variable from another MC. I have tried MovieClip(parent).mcInstanceName.variable = "normal"; But that doesn't work.

View 1 Replies

ActionScript 3.0 :: Manipulating Flash Library MovieClips?

Jun 24, 2010

I drew up some graphic symbols in Illustrator and imported and defined them as MovieClips in the Flash library. That way I could just place them where I want to visually on the stage. As I have been solidifying the visual design, I have been implementing it in Actionscript to access the flexibility the code provides.

In order to port a symbol to actionscript I did the following:

[Code]...

View 5 Replies

ActionScript 3.0 :: Loading In An Image At 300 Dpi Manipulating It And Saving It As A 300 Dpi Png

Feb 27, 2012

I have a project where the user uploads a large 300dpi image, then manipulates it (drag it, rotate it, position it). And the user can reuse this 300 dpi image, basically to make something like a t-shirt pattern. Then when the user is ready, they save this t-shirt pattern, and the save format is a large 300dpi png. This saved png file is for printing.  Now I figure I can have PHP take bitmap data (as binary I assume) and the php can create the png. Is it a good idea to use Flash for this?  I will have to scale down the users loaded 300dpi image so they can position. Then I assume scale it back up when it comes time to save Does anyone think Flash can't handle this?

View 4 Replies







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