ActionScript 3.0 :: Referencing Library Items Semi-dynamically?

Aug 16, 2010

I'd like to add a couple of different MC's to the particle stream. I'd like to do that by referencing different items in the library.So I have 12 different particles in the library exported with classes named from Bubble0 to Bubble10 now as I run through my for loop I'd like it to use a different particle each time. first time I tried:

ActionScript Code:
var bubbleArray:Array = new Array();
bubbleArray.push(Bubble0,Bubble1,Bubble2,Bubble3,Bubble4,Bubble5,Bubble6,Bubble7,Bubble8,Bubble9,Bubble10,Bubble11)
for (var j:uint = 0; j < NUMBER_OF_BUBBLES; j++) {

[code]...

Scene 1, Layer 'actions', Frame 1, Line 871086: Syntax error: expecting semicolon before leftbracket.Is what I'm trying to do possible without some clunky switch statement?

P.S. I tried searching the forum for an answer but the terms are so common I couldn't find what I'm looking for.

View 6 Replies


Similar Posts:


ActionScript 3.0 :: Referencing A Library In A Library?

Jul 29, 2011

As one would expect, Classes within my RSL can access the classes and methods of the embedded swcs. In other words, classes in my library can for instance call import org.alivepdf.Print and then call AlivePDF's Print.print() method. But it there any way for my project to also use those third-party classes and methods, by "tunnelling through" my RSL??? Even though my project is using my RSL, when I try to type out org.alivepdf.Print it cannot be found.(Obviously I can make a manager class in the library to "pass through" specific commands to the embedded swcs; I'm looking for something a little more generic and all-encompassing here).

View 0 Replies

ActionScript 3.0 :: Dynamic Referencing Of Items Within MovieClip?

Feb 19, 2010

I am building a drag and drop application. I have a few items within a movie clip that are movie clips. They each have their own instance name.

I am trying to access them from the document class using 'event.target.name'.

That works and I can pick up the name of the movieclip.

I put it in a string var called tName.

Then I try to modify a property of the selected movieclip:

itemList.items.tName.x+=23;

thats when i get, 'A term is undefined and has no properties' error.

I know itemList.items.tName is the correct navigation to the clip, because if i replace the var and hard code the correct name, it works.

whats funny is my tName var is tracing out the correct name of the movieclip.

Or a better way to dynamically access mc's within mc's.

View 1 Replies

ActionScript 3.0 :: Error #1010 In Referencing Items In An Array

Dec 6, 2010

when I try to move my "stars" I get a 1010 error. when I try to loop a singular item, it works, but dynamically...

Using FlashDevelop.
main()
Actionscript Code:
package {  import com.gfx.mainContainer;  import flash.display.MovieClip; import flash.display.Sprite; import

[code]....

I can trace starArray, but I can't loop to each individual element and move it.

View 1 Replies

ActionScript 3.0 :: Error #1010 In Referencing Items In An Array?

Mar 14, 2011

when I try to move my "stars" I get a 1010 error. when I try to loop a singular item, it works, but dynamically...Using FlashDevelop.

[code]...

I can trace starArray, but I can't loop to each individual element and move it.

View 2 Replies

ActionScript 3.0 :: Referencing A Library Class?

Mar 17, 2009

In As 2 you were able to reference a linkage ID using a string.Example

Code:
var strName = 'home';
attachMovie(strName+'_mc', strName, 1);

[code].....

View 3 Replies

ActionScript 2.0 :: Referencing To Shared Library?

Jun 1, 2005

I don't know how to reference to sharedLibrary.swf file.That sharedLibrary.swf is in root folder and another swf which uses sharedLibrary.swf is in folder TEST.I try to pur reference like: ../sharedLibrary.swf and ..sharedLibrary.swf and ..\sharedLibrary.swf and ..//sharedLibrary.swf

View 1 Replies

Actionscript 3.0 :: Referencing The Timeline Of An External/library Loaded Swf?

Oct 25, 2010

So I am using the following code to load an external swf and am trying to reference the timeline of the loaded movie i.e. a frame label. Say I wanted to do a simple gotoAndPlay what is the syntax? I would use (myloader.gotoAndPlay ("framelabel") this seems like an obvious answer but doesn't seem to work for me.

Code: Select allfunction yesClick(event:MouseEvent){
/////// Loader (Loads External SWF lesson file) **********************************
var myLoader1:Loader = new Loader();

[code]........

View 1 Replies

ActionScript 3.0 :: Referencing A Child Of A New Object Instance From The Library?

May 20, 2009

I make a movie clip in the library ( a button with a text field on it ) and export it for actionscript. Then I create an instance of the object using code ( myButton = new Button1(); ).And then I want to access and change the text field ( whose instance name is "myField" in Flash ) afterwards.Is that possible, or I have to create a custom class for the object, or just create an entire button dynamically?

Because what I have tried until now doesn't work.

Code:
var button1:button_test1 = new button_test1();
button1.x = stage.width / 2;
button1.y = stage.width / 2;

[code]....

This questions is for all movie clips: is there a way to access a movie clip's objects with actionscript after you have created (with code) an instance of that object (which was designed in flash, and exported for AS) ?

View 2 Replies

AS2 :: IDE : Dynamically Referencing ROOT?

Aug 3, 2009

I am having trouble dynamically changing the reference to root in my movies. Here's what I'm trying to do: I have a main movie(_level0.mainMovie) that I am loading external .swfs into. However, I want to be able to test the child movie clips without having to load them into the mainMovie(for testing purposes). In such a case, the child clip would be at _level0 or _root. I would like to add some code to the child clips to test whether they are the _level0 clip, if not, then I want to change their reference to _root. Here's what I've come up with, which doesn't seem to work:

Code:
function testLevel(){
//This code goes into each child clip to see if it has been loaded into another clip
trace(this);
if(this == _level0){ //If this is the _level0 clip

[code]....

View 4 Replies

Way To Combine Library Items

Aug 21, 2009

Say I create a symbol, and then another inside the symbol. In the library I now have 2 symbols. Is there a way to combine these into just one library item?

View 1 Replies

Possible To Tell Which Library Items Aren't Used?

Apr 12, 2011

I have a flash file, which is a header for a website. I inherited it from my company's previous webmaster. I was looking through the library items & see alot of images & graphics that I don't see in the finished product on the webpage. The guy worked really sloppy so it's possible there's alot of unused items. Is there anyway to easily tell which items are not used in the final exported flash file so I can clean it up?

View 2 Replies

ActionScript 3.0 :: Dynamically Referencing Movieclips?

Nov 28, 2011

I'd like to know how I can achieve this in AS3. The code would work fine in AS2, but as I am very new to AS3 I am not sure what the equivalent would be in AS3.

code:
humanNum = 1;
MC = ["Human"+humanNum];

[code].....

View 1 Replies

IDE :: Referencing A Dynamically Created Clip?

Jan 10, 2010

here is a snippet of code in first frame of the movie I have trouble with:

----------------
for (var i = 0; i < 5; i++) {
var container:MovieClip = new MovieClip();
this.addChild(container);

[Code]....

I am getting an error message: A term is undefined and has no properties. I checked list of objects and container0.one and it's there but I can not get to container0.one.usecase

View 6 Replies

How To Save / Export Library Items

Jul 20, 2009

I downloaded a flash template for my website. All the library items are not local. Here's the path:..........websites20004sources2007dekabr_#lana_2128flashps d1_ikon.png
How can I save my library items so I can edit them in FW? I have CS4.

View 6 Replies

How To Remove Unused Items From Library?

Aug 13, 2009

Flash CS4 is really good for design and development point of view. But I noticed two things:If library have more item then there is no option on right click "Select Unused Items". How can I get this option "Select Unused Items" on right Click while library have a more items with scrollbar?Some times the actions window's height increased. At this time there is no option to decrease the height of actions window except the Reset option.

View 3 Replies

Items In Library Linked Together Somehow, But Want To Delete One

Aug 13, 2009

I'm practice with Flash, and trying out different things, but somehow, I managed to create a movie symbol from a graphic symbol, and now whenever I try deleting one of the symbols, it effects the other symbol as well.
 
I only want one of these symbols, yet I can't seem to only keep one. They both seem to depend on each other, and I don't know how to get around this.

View 2 Replies

How To "search' For Library Items

Oct 19, 2009

I am developing a site in flash and have over 800 Library Items. My problem is, I need to edit a portion of a Library Item and cannot find the Library Item, and NO, I did not delete the Library Item because when I go to preview or test the flash document, the Library Item is there in the movie. Is there any way to search for the Library Item? I am using Flash Professional 8..

View 2 Replies

Rename All Selected Library Items?

Feb 21, 2011

version flash cs5

ok so i know the general code to rename all selected library items

var items = fl.getDocumentDOM().library.getSelectedItems();
for (var i=0; i<items.length; i++){
var item = items[i];
item.name = "ABC_"+item.name;
}

but this isn't good enough if the library items are in folders... because item.name returns the full path, but item.name sets the name. o.O as someone else points out here, [URL]

so when i try to rename Level1 to be ABC_Level1 if Level1's folder path is LIBRARY/FolderA/FolderB/Level1 i get this instead ABC_FolderA-FolderB-Level1

i could probably code some sort of string parser something like this,

item.name = "ABC_"+item.name.substr(item.name.lastIndexOf("-"), 99)

but that is really ugly and would not work if library items contained "-" already. "Level-1" for example

different way to access the name that returns just the name and not the path

View 3 Replies

ActionScript 3.0 :: Reference Library Items From XML?

Jan 29, 2010

I've got a flash movie that loads images from an external folder. I'd like to make a CD version and would like to have the images embedded in the flash movie so that the images can't be copied from the cd. I thought I could add the images to the Library and reference them from the xml file.

View 2 Replies

ActionScript 3.0 :: Loop Through Library Items?

May 21, 2010

I was wondering if you could loop through your library or a specific folder in your library and get alle linkage names of items that have 'Export for Actionscript' checked. I have an amount of items in my library of which I want to random pick one. Of course I could just use an array of linkage names that correspond to my library items, but I was wondering if there is a more efficient way.

View 2 Replies

ActionScript 3.0 :: Access The Items In .fla Library?

Aug 15, 2010

Does flash store the items in the library in an array? I would guess yes. For example if i have an array named pics in my fla file can i write something like:

for(var counter:int = 0;counter < library.array.length;counter++){
pics.push(library.items[counter];
}

View 9 Replies

ActionScript 2.0 :: Get A List Of The Items In The Library?

Jan 18, 2006

if there is a way to get a manual text list (or an array or really just anything I could use to get an overview) of items in the library of an FLA...?

I have about 60 movieclips of different flags in my FLA- they all are "linked" to be used in Actionscript- so they have names there but are not named otherwise (as instances on the stage, for example).

Is there a way to get a list of them? I don't want to have to type them all out manually, if there is another way

View 3 Replies

ActionScript 3.0 :: Library Items Use Same Class?

Apr 27, 2009

I'm still in the 'need to learn a lot more' phase of AS3 and am wondering the best way to do this. I have some graphics (MovieClips) in my library that I'd like to have use the same class. But Flash wants unique class names.What's the proper way to handle this? External swf graphics?

View 7 Replies

ActionScript 3.0 :: Whole Website In Oop & Library Items?

Sep 1, 2009

lets say you have a whole website written in classes, and you have some items in the library as well (maybe some buttons, a picture for a background and so on...)what to do with all these simbols?leave them in the library, give them all a class name, and when the website loads access them like that, or pull them out on the stage, not neccessarily in the visible area, and not neccessarily on the first keyframe.

View 1 Replies

ActionScript 3.0 :: Preloading And Library Items?

Sep 30, 2010

so I have a few questions about preloading and specifically preloading in relation to items within the library which get added to the stage through AS3.

The main thing I don't understand is, what is the library? Are these assets contained within the FLA itself and is their data transferred to the SWF on export? If that is the case, does preloading the entire SWF preload its entire library (even the items that are not on the stage?)

If not, how do I preload items which are in the library?

View 4 Replies

ActionScript 3.0 :: Linking To Library For Certain Items?

Jul 17, 2011

So my simple question is, when you link to the library for certain items right, whats the purpose? Does it reduce file size? and if so how?

View 3 Replies

ActionScript 3.0 :: Replace Library Items?

Oct 10, 2011

Don't know if I should place this here, but this is where I'm at the most and possibly this needs some coding.I'm working on an Android App and I've been constantly working on getting my content as small as possible, recently I found a way to make it even smaller with remaining quality. But now I have to manually change every file/import a new one and change the movieclips contents. This is A LOT of work, is there some way to batch replace a lot of files at once?

View 10 Replies

ActionScript 3.0 :: Dynamically Referencing Movieclips On The Stage?

Jan 20, 2011

Just wondering, is there any way to dynamically reference movieclips on the stage, as in through a for loop like so:

for (var i = 0; i < 10; i++) {
["mc" + i].x = 10;
}

[code]........

View 3 Replies

ActionScript 2.0 :: Referencing Dynamically Created Variables?

Dec 9, 2006

I have a number of 'TweenField' instances created in a for loop. The problem is that each time the loop increments, the 'myTweenField' variable has the same name, so I don't know how they can be referenced individually from elsewhere in the script. How can I rewrite it so that each instance has a unique name, and how would I then reference it from outside the loop?

Code:
package
{

[code].....

View 11 Replies







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