ActionScript 3.0 :: Flash Setting Multiple Movieclip Properties Via A For Loop?

Dec 2, 2010

I have 35 movieclips, named s1, s2, s3 etc, depending on the value of currentDisplay, I would like to set a movieclip visible property to true while the others are set to false, I have tried the following:

Code:
for (i=1; i<36; i++){
trace(i);[code]....

but I receive an error message: 1083: Syntax error: dot is unexpected. I assume it is referring to the dot before visible.

View 1 Replies


Similar Posts:


Setting Same Properties To Multiple Buttons?

Oct 16, 2010

I'm completely new to this forum, and would like to ask your help for one issue. I am working on an interactive flash map, I was able to set all the countries borders with the help of fireworks (awesome tool), and import them back to flash and set each country as a button. I would like to set all of the buttons to have the same properties for example : All the buttons have default red color, and will have a mouse hover frame that will change the color of the button to blue. I DO NOT want to set each button manually, because I would like to have the choice to change the mouse hover color to a different one, and would like to avoid passing each button and changing each one's mouse hover frame.

Is there a way I can built a template of a frame, and for each button set its mouse hover frame as the template frame I built ? And then if I make any changes to the template frame, all of my buttons would be automatically updated ?

View 1 Replies

Professional :: Setting Same Properties To Multiple Buttons?

Oct 16, 2010

I am working on an interactive flash map, I was able to set all the countries borders with the help of fireworks (awesome tool), and import them back to flash and set each country as a button.I would like to set all of the buttons to have the same properties for example :All the buttons have default red color, and will have a mouse hover frame that will change the color of the button to blue.I DO NOT want to set each button manually, because I would like to have the choice to change the mouse hover color to a different one, and would like to avoid passing each button and changing each one's mouse hover frame.

Is there a way I can built a template of a frame, and for each button set its mouse hover frame as the template frame I built ? And then if I make any changes to the template frame, all of my buttons would be automatically updated?

View 1 Replies

ActionScript 3.0 :: Setting Properties Of Nested Movieclip Before AddChild?

Jun 21, 2010

I have a button function the launches a small movieClip (like a window). Inside this movieClip is your typical keypad.

Code:
package com {
import flash.display.MovieClip;
import flash.events.*;
public class Login extends MovieClip{

[Code].....

I'm trying to next a series of keypad buttons inside the new loginBox instance, so they'll be referenced as loginBox.key1 etc etc.

I want to set their x/y coordinates before they are added to the stage (loginBox.key1.x = 23) , but obviously they don't exist yet.

I'm missing the way to get around this. The very last line of the above code is my hack attempt so far, and it's still causing me problems.

If you have 5 or 6 different components in your library that you want to put inside of eachother from *.as files

View 1 Replies

ActionScript 2.0 :: Setting Component Properties Of Dynamically Created Movieclip?

Mar 2, 2008

I created a movie clip symbol with a user interface in it, using the standard components. It contains various components that I draged on the stage. I named the instances (e.g titleLabel). Then I created an ActionScript class for that user interface. Under the linkage properties of the symbol I specified that class. In the class itself, i declared the attribute "var titleLabel:Label". I thought this would be the same instance from the symbol? But: Trying to set the text of the Label AFTER the movie was dynamically added to the parent does not work. I cannot access any properties.

Here is the example:

My Class for the user interface:

Code:
import mx.controls.*;
class Information extends MovieClip {
var titleLabel:Label; //this is the same instance name as in the symbol

[Code].....

View 1 Replies

ActionScript 3.0 :: Access MovieClip Properties In For Loop?

Aug 28, 2009

i have 10 movieclips mc1_mc-mc5_mc and coin1_mc-coin5_mc on stage i aded listeners in for lop tat is working.when i click mc1_mc i want to make coin2_mc-coin5_mc invisible and coin1_mc and if i press mc2_mc then coin2_mc should wil b visible others invisible.i used folowing code but when i click any movieclip every objects in stage is becoming invisible.

Code:
for (var i=1; i<6; i++)
{
["mc"+i+"_mc"]addEventListener(MouseEvent.CLICK,clicked);
}

[Code]....

View 5 Replies

Professional :: AS2: Apply Multiple Properties To A Single Movieclip?

Aug 31, 2010

Is there a way, in ActionScript 2, to set multiple properties for an exising movieclip in one command?
 
For example, is there a way to write something like this more succinctly?:
 
myMovieClip._x = 10;
myMovieClip._y = 10;
myMovieClip._alpha = 100;

[Code]....

View 3 Replies

Actionscript 3 :: Flash Event Properties Trace Them With A For Loop?

Nov 3, 2010

I was wondering if it was possible to use a for (or for each) loop to trace the properties of an event to the output window. I know I can trace the event in one go, like this:

[Code]...

View 1 Replies

ActionScript 3.0 :: Flash For Loop Loading Multiple Images Into Multiple Movieclips

Feb 5, 2012

[Code].....

I have a group of 16 images that I would like to load 1 of each into each movieclip. I want image1 to be inside of visual1, image 2 inside of visual2, and so on. the images are named like, 1960s_(1).png where the 1960 (year) part is coming from the rangeNum variable. The above gives me this error: 1061: Call to a possibly undefined method addChild through a reference with static type int.

View 4 Replies

ActionScript :: Xml - Setting Object Properties From Other Object Properties?

Jun 25, 2010

i'm attempting to cast an object's property as an actual property of another object. here's my object variable: var propObj:Object = {prop:"width", width:50}; now i want to assign the property of a sprite using that object's properties. var sp:Sprite = new Sprite(); sp.(propObj.prop as Sprite.property) = propObj.width; now, i'm not even going to try that because i know the compiler will explode all up in my face. but you should be able to see what i'm trying to do. why i'm trying to do it is because i'm reading in an XML file with an undetermined list of usable properties for specific objects. so instead of writing something like a huge switch statement to evaluate whether the XML file has a value for that specific property, i'm trying to assign properties dynamically based on what's available in the XML file. if what i'm trying to do is possible, what's the best way to do it?

View 1 Replies

ActionScript 1/2 :: Get URL And Setting Window Properties

Dec 30, 2009

I want to open a new internet window using actionscript on a button but I also want to control the characteristics of that window when it opens:

1. I want it to be a specific size - 180 x 200
2. I want all the standard page elements removed - the scrollbar, browser tools etc - so there is just a box to close it.
3. I want it to be centered on the screen

Can I get this much detail with actionscript regarding the new window when I open it?

View 7 Replies

ActionScript 3.0 :: Setting X And Y Properties According To Stage?

Jan 18, 2011

I need to assign a symbol that is added dynamically in a symbol, x and y coordinates (that are from the main timeline).

View 2 Replies

ActionScript 2.0 :: Naming MCs And Setting Properties

Feb 22, 2003

i have a problem whenever i name a movie and set its properties. whenever i use eval on the name it works,

[Code]...

i've heard you shouldn't use eval anymore because it's deprecated, and that you should use this[object]._property instead, but it's not working for me--am i doing it wrong?

View 6 Replies

ActionScript 2.0 :: Loop - Flash 8 Duplicating Movie Clips And Setting 3 Nodes From XML

Apr 4, 2007

Flash 8 duplicating movie clips and setting 3 nodes from XML. I am trying to read in an xml with 3 parameters; 2 links and one text field for a caption. What am I doing wrong this time?

[Code]...

I am trying to have "bMC" load into and repeater for however many XML props there are. within "bMC" are two MC's that on click would open window or grab file and One Text field which would load in caption. For some reason the "bMC" isnt even loading at all. Attached is the .Fla

View 2 Replies

ActionScript 3.0 :: KeyCheck Combos And Setting Properties Accordingly

May 6, 2010

Trying to check for keypress combos and setting properties true accordingly, the trouble is I'm not being able to set the properties false to the corresponding keyreleases.

Code:
// X3msnake v1.1.060510
// Controller checks for keypresses translates it to property states, sets up and gets keys.
package{
import flash.display.Sprite;
import flash.display.Stage;
import flash.events.KeyboardEvent;
[Code] .....

View 1 Replies

AS3 :: Flash - Creating Multiple Read-only Properties Dynamically?

Jun 3, 2011

I have a class which at the moment is quite messy/repetitive:

public class AvFramework extends Object
{
// vars

[code].....

View 2 Replies

Actionscript 3 :: Setting Default Values For Object Properties?

Dec 28, 2010

how to set default property values for objects that are being created in a loop.

In the example below, these propeties are the same for each object created in the loop: titleTextField.selectable, titleTextField.wordWrap, titleTextField.x

If you pull these properties out of the loop, they are null because the TextField objects have not been created, but it seems silly to have to set them each time.

var titleTextFormat:TextFormat = new TextFormat();
titleTextFormat.size = 10;
titleTextFormat.font = "Arial";

[Code]....

View 4 Replies

ActionScript 3.0 :: Setting Width And Height Properties Of A Loader

Feb 19, 2009

I want to bring an image in from a folder and then display this image in a specifically sized box.[code]So obviously I want the image loaded into a 200 x 200 box (the image is 1200x1200) and scaled proportionately. What do I need to do? The box won't resize at all.

View 6 Replies

ActionScript 3.0 :: Setting Properties Of Objects Found Using GetChildByName

Mar 9, 2009

I am attempting to set the propreties of a navigation button (movie clip) that has been built dynamically. The button contains a text field that I want to format and a movie clip that I want to adjust the alpha. I find the object using getChildByName(), however do not seem to be able to set the properties using the code below.[code]

View 2 Replies

ActionScript 3.0 :: Custom Class Setting Properties Through MXML

Mar 10, 2009

I have just created a custom AS3 Component to use in an MXML project.[code]but then i lose some re usability.What do i need to do to be able to set properties from mxml?

View 3 Replies

Actionscript 3 - Flash Call Of Multiple Properties For Object In Class?

Jan 16, 2011

I have a MainClass and a GUIClass.The MainClass lets the GUIClass handle everything about the GUI.How do I call different Object properties from the MainClass to the GUIClass.

package {
import gui;
public class main {

[code]...

View 1 Replies

Actionscript 3 :: Flash - Multiple Frames - Alter Symbol Properties

Aug 4, 2011

if you have an active state and a passive state for something, you can jump between the two with gotoAndStop(2), gotoAndStop(1); or you can manipulate whatever property is changing directly (e.g. if it's alpha, then symb.alpha=0.5, symb.alpha = 1.0). I've found myself jumping between the two, and I don't like it (I like to have a standard, or at least a usual). What's considered a good practice

View 4 Replies

ActionScript 2.0 :: Image Slideshow - Setting Preloader XScale Properties?

Jul 7, 2010

I've got an image slideshow, and a preloader for each individual image. I want the preloader BAR to be dynamically assigned the width of the banner, which is defined in a variable. Here are my preloader settings and function call:

ActionScript Code:
/****PRELOADER SETTINGS****/
progressBar._width = myVars["BANNER_WIDTH"];
progressBar._height = 2;
progressBar._visible = false;
progressBar._xscale = 0;
[Code] .....

Basically, what is happening is. The "progressBar" width is being defined as the variable BANNER_WIDTH, but when the _xscale property is run in my preloading function, it doesn't care what the banner width is. So what I want to say is. I want you to _xscale according to what is being loaded, but I don't want your _xscale to exceed BANNER_WIDTH's width. I don't know how to do this and keep the preloader accurate. I can only save as CS4, CS5.

View 5 Replies

ActionScript 3.0 :: Setting Properties Of Nested Clip From Document Class Of Parent

Aug 29, 2011

Setting properties of a nested clip from the associated document class of the parent clip. I am developing a Jigsaw puzzle in Flash. I am developing a class for puzzle piece. The code of the PuzzlePiece class in given as follows.

PuzzlePiece class
package {
import flash.display.MovieClip;
import flash.events.MouseEvent;
public class PuzzlePiece extends MovieClip {
private var pieceX:Number;
[Code] .....

Is it wrong to access it like that. The PuzzlePiece is the export for a puzzle clip. For the time being I am hard coding the dimension as 60. I have aloso uploaded the fla and as files. [URL].

View 4 Replies

Flash :: Access Movieclip Properties From Inside Another?

Dec 5, 2010

I have 2 movieclips. One is a fairy flying up the stage. The other movieclip is a magic dust, which is originally designed to generate magic dust with onMouseMove event, based on the mouse's x & y. I want to change the the magic dust movieclip so it will generate magic dust following the fairy's movement.[code]...

View 2 Replies

Flash :: Properties Of A Dynamic Variable Of A Movieclip?

Jan 9, 2012

I do occasionally use this useful property of the flash.display.MovieClip class

for eg:

var mc:MovieClip = new MovieClip();
mc["myVariable"] = myAnotherMovieClip;
mc["myVariable2"] = true;
mc["myVariable3"] = new Array(0,0,1);

Well, I'd like to learn more about this 'feature' of movieclip. As I got to know this from a colleague and do not really know as to what this is called in AS3.

View 2 Replies

ActionScript 3.0 :: Flash - Save A Movieclip With It's Properties?

Jan 27, 2011

I have a requirement to save a part of animation that comprise of many movieclips in a parent movieclip and make it available for another user to edit it. So, Its pretty sure that I cant save it as a bitmap data.

View 5 Replies

ActionScript 2.0 :: Loop Through All Properties Of MC?

Jan 10, 2008

I would like to loop through every property of a movie clip. how to do this and I can only get one level down. If someone could let me know that would be great. here's how I am checking the first level:

[AS]function checkOb(ob){
for (var i in ob){
trace(i+":"+ob[i])
}
}

View 2 Replies

Flash :: Assign Properties To A MovieClip In It And Have Them Accessible In Flex?

Feb 27, 2011

In Flash Professional, I have a MovieClip and that clip has children. Let's say the parent clip is a night sky and the children are different instances of a star MovieClip that animates in a loop. This whole thing compiles down to a NightSky.swc which I use in Flash Builder as part of a larger project.

In Flash Pro, I position the child clips with a high level of precision. From there, I want to assign properties to these "stars." Say, I want to assign "galaxyId" and "isRedGiant" but (and this is key) I want to edit those properties in Flash Professional and have those value accessible in Flex.[code]...

View 2 Replies

ActionScript 3.0 :: Modifying Properties Of MC Using A Loop?

Sep 16, 2011

I have twenty objects in the stage, everyone is name: unit1... unit2... and so on to 20.I wanted to use a loop to modify for example, the alpha values of everyone at the same time. So I used a name like unit1, unit2 so I thougt I could use a loop to assign the alpha values...

"unit" + i.alpha = 0;

View 1 Replies







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