ActionScript 2.0 :: Set Color On Dynamic Created Mcs?
Jul 20, 2007
I create a mc on the root level from the library by attachMovie (box1).box1 creates a second mc from the library by attachMovie (box2).On the root level I have a button who change the color of both mcs by new Color / setRGB.But box2 will have the same color than box1, regardless which color I set to box2.Button-AS (FLA is attached):
Code:
this.onPress = function () {
// set box1 to green
[code]....
View 2 Replies
Similar Posts:
Oct 18, 2003
How would I make a dynamic text boxes border a certain color, along with background color.
View 1 Replies
Jul 28, 2009
I have a movie clip where it contains an instance of text
I able to change the movie clip and text color individually
but when i try to change both at once the text color is same as movie clip color
ActionScript Code:
myColor = new Color(myMovieClip);
myTextColor= new Color(myMovieClip.myText);
[Code].....
View 3 Replies
Apr 21, 2005
How is it done? All I've seen on the web is how to change the color. Well how about going back. I'm talking about a MC with many colors. I can't just change back to a single hexadecimal color.
I can accomplish the change as it passes over a frame, but I can't get it to change back.
In the frame is this:
Code:
cHurtColor = new Color(_root.compMC);
cHurtColor.setRGB(0x00FF33);
View 6 Replies
Apr 21, 2005
All I've seen on the web is how to change the color. Well how about going back. I'm talking about a MC with many colors. I can't just change back to a single hexadecimal color.I can accomplish the change as it passes over a frame, but I can't get it to change back.[code]
View 6 Replies
Dec 16, 2010
in FlashBuilder I want to dynamically generate approximately 1200 rectangles from a CSV file (these are all different colours) which will perform an action on Click.
What is the best way to go about doing this? I've read that the drawing API on Air and Android is not a good idea, and am thinking about using the Spark Rectangle class, but I can't seem to work out how to apply a colour to it if I'm generating them dynamically using AS?
View 2 Replies
Aug 24, 2010
Say I draw a square on the stage, with a fill of blue and a stroke of black. My width and height are both the same. Now, in my Actionscript, I want to change that blue fill to something else.... on some off the wall condition of course.
Better yet, imagine I draw this extremly elaborate polygon out. How could I change it's fill, dynamically, in Actionscript (AS2 preferably, but I'm just lookin' for logic here)
View 1 Replies
Aug 27, 2006
The menu items are created dynamic out of empty movieclips and have the name movie + x. Now I'm trying to create a method that resets al the other movieclips to their original size and colour when one is pressed. The first problem is to adress the other ones. Even if I try to put the following in the script: movie[x]._alpha = 0; nothing happens..
for (x=1; x<=11; x++) {
eval("movie" + x).onRelease = function() {
var my_strNr:String = this._name
[Code].....
View 1 Replies
Oct 20, 2006
I dynamicly create MCs and give them names and URL's through the XML i load, but how can I scroll them? I can display 10per page, but I want a scroller so I can view the rest for instance.
Code:
//start generate filelist
GenerateMenu = function() {
[code].....
View 1 Replies
Oct 3, 2011
i created an MC that is made of dynamic mc clips that include a textfield named combo_txt, it is the same clip that i put on stage with add child and i dont knowhow to refer to them i, think i gave them different named but still cant reach them:
[Code]...
when i click on each of them i get the name i gave it but i want each clip to have a different text. this doesnt work:
[Code]...
View 4 Replies
Sep 20, 2006
I've created a XML-dynamic news box which uses a external .CSS Since my hosting is slow, when I load my movie of the news box, some of the times CSS doesn't seem to do its work -- All I see is the html code that I created in the XML file.
I was wondering how I preload the css and xml before executing/using it.
[Code]...
View 3 Replies
May 21, 2008
I was wondering if there was a way of drawing different shapes dyamically, and then somehow "join" them so that the resulting shape has only one outline, and not an outline for each shape.For examples making a random cloud with circles, and only have the outline on the cloud, and not each circle.
View 4 Replies
Feb 23, 2004
What I want is the following. Based on an XML file and one empty movie clip, I create about 80 different items (menu items). By drag and dropping these menu items you can create a scene with objects. These objects are copies of the menu items.But I want to use the attachMovie command to have control over the path of the objects. But by creating the menu items dynamically, I cannot say in the library, export for actionscript.So my question is, how can I use the attachMovie command on items that are dynamically created.
View 6 Replies
Nov 10, 2010
How do you set up a hit test for a dynamic movieclip that hasn't yet been created?I have a movieclip on the stage, and I want it to change colour when a yet to be created dynamic clip touches it.
View 1 Replies
Nov 30, 2009
I'm building an Xml-driven application. I create new states in a separate actionscript-class.These states all contain a DataGrid. I can switch the states in the Main.mxml.
But now I would like to access certain children of the DataGrid. In this case I would like to toggle the visibility of GridItems, from a Button in the Main.mxml.
How do I have access and apply this to the already created states ? I tried to create RemoveChilds and override/push it to the state.All I archieved was to remove an entire GridRow at the very last state, but it should be just one GridItem at every state.
View 2 Replies
Mar 15, 2011
I try to get acces a property by click on a dynamic created Moviclip.
function finishLoading(evt : Event):void {
// Handle XML Settings
XML.ignoreComments=true;
[code]....
View 1 Replies
May 4, 2011
Im currently creating textfields in a for loop - though in this example only creating one TextField. My questions is, how do I remove the TextField child in another function? What im basically doing is, create a Textfield, addchild to a container - > then the container into another position - > then removechild and another text in the container. I've tried something like:
[Code]...
View 3 Replies
Jan 26, 2009
I am a bit puzzled why this does not work when placed in my document class, but works when directly added a key frame in the Flash IDE.
ActionScript Code:
this['myVar1'] = new Object();
When within the document class I get this error when compiled,
ReferenceError: Error #1056: Cannot create property myVar1
I have tried the following but I still get an error.
ActionScript Code:
public static var root_Ref:Object;
root_Ref = root;
root_Ref['myVar1'] = new Object();
View 2 Replies
May 12, 2010
I have created a dynamic text box and have xml content loaded into via a for loop. I would like for each item in the list to be clickable and fire off a different function.
[Code]...
View 3 Replies
Sep 22, 2005
I have html text being loaded into an Actionscript created dynamic text field using LoadVars, and any line within the text which contains a bullet point or an accented character displays in bold. The txt file containing the html text has been saved as Unicode in order to display the characters. Cannot work out why this is happening
View 1 Replies
Apr 7, 2006
I have got a movie clip that is dynamically created with actionscript I then load an external swf into that movieclip. My problem is having it centered when I view it in my browser..How do place I center that dynamic created movie clip? I was trying this but it's not seeming to work.
Code:
var container:MovieClip = this.createEmptyMovieClip("container_mc", 0);
container._x =Stage.width/2;
container._y =Stage.height/2;
View 7 Replies
Dec 7, 2010
I am adding a bunch of MC's(linkage ID:buttonHolder) dynamically using a for loop and attachMovie. If I want to dynamically add an onRelease function to each of those MCs,so that each of them links to different links how would I accomplish that? here's where i've reached so far..
var depth:Number=0;
var nextY:Number=77;
for (i=0; i<5; i++)
[Code].....
View 1 Replies
Apr 12, 2011
I have a 13 buttons to wich I added Event listeners using a for loop:
Code:
for (var i:Number = 1; i < 13; i++)
{
[code].....
View 9 Replies
Jul 15, 2011
I have two TLF textfileds in my application. The first TLF textfield is on the stage and the second one is created dynamically during runtime. Now I am able to embed the fonts in the first TLF textfield by using "use device fonts" since it is on stage. The flash player the rendering the data absolutely fine. I want to get the same look and feel for the second TLF textfield which is created dynamically during runtime. I tried so many ways.
Here is the code I am trying.
[Code]....
View 7 Replies
Sep 23, 2010
I am having problems while creating object with actionscript, I am new to it and I am getting some errors. I am creating my object this way
Code:
var myMC:MovieClip = new MovieClip();
myMC.x = 50;
myMC.y = 50;
myMC.name = "hunterToken";
tCursos.addChild(myMC);
And it is created, so far everything's good
Later I try to access the visible property, and I get an error
Code:
tCursos.hunterToken.visible=false;
And I get this error:
Code:
TypeError: Error #1010: A term is undefined and has no properties.
at newSiteHTR_fla::mCursos1_1/go()[newSiteHTR_fla.mCursos1_1::frame1:157]
View 3 Replies
Mar 26, 2010
I am confronted with a simply yet annoying problem: I manually created a row of MovieClips inside another movieclip container_mc on the stage in the Flash CS4 Editor. The MovieClips are named in the same convention (eg. target_1_mc, target_2_mc, ...target_200_mc).
When I try to access a property of it via AS3 during runtime of the SWF like this, it works:
container_mc.target_0_mc.alpha = 0; But how do I access the MovieClip dynamically? During runtime, a script will determine of which MovieClip i need to access a property. I will get the ID number of the MovieClip I want to access. So I need to be able to to something like this:
var mc_ID:int = 2; ["container_mc.target_"+mc_ID+_mc""].alpha = 0;
Obviously, that doesn't work. When I would create all the target-MovieClips dynamically at runtime, I would simply put them in an array. But in this case I need to work with the existing MovieClips manually created in the Flash Editor.
View 7 Replies
Mar 10, 2011
I created a movieclip and linked it to a class called CustomButton. Inside the movie clip is a text field with name btnText. I then created a few buttons with this code:
Code:
var newBtn:CustomButton = new CustomButton();
// set properties of new button
newBtn.x = INIT_X;
[code]....
So far, so good. Everything works ok and the code sets the text of the new movieclip. Now, I wanted to actually write the CustomButton class and add some properties and eventually do other stuff with it and so I wrote this:
Code:
package
{
import flash.display.MovieClip;
[code]....
On trying my script again, it gives me this error:
Code:1119: Access of possibly undefined property text through a reference with static type String
the line of code it refers to is:
Code:
newBtn.btnText.text = text;
View 1 Replies
Jun 11, 2009
I have created a dynamic accordion style navigation button using both Falsh and XML.I have the XML loading at a certain keyframe after the navigation button is fully expanded creating 7 sub navigation buttons which link to a certain website.
The Issue I'm having is when the user rolls off the button the it collaspes but the 7 sub navigation buttons still remain.
[Code]...
View 1 Replies
Dec 4, 2009
I have made an input text filed in frame 2 (made at authoring time) and populated a variable with it i.e var g_nameEntry: String; g_nameEntry = nameField_txt.text; and now have performed the concactenation with this variable in the Frame 4 i.e loserField_txt.text = "Sorry" +g_nameEntry where loserField_txt is another dynamic field created at authoring time in Frame4. However this is not working.
View 3 Replies
Aug 14, 2010
I have a small issue going on. I created a dynamic scrollbar which scrolls dynamically loaded XML text. But it's not scrolling..You can view it here:(Click Start, 2 times the right arrow, then the book, to the righthand side there is a scrollbarI have divided my Scrollbar into 3 classes, the actual scrollbar, the scrollbar custom event and the scrollbar including content and mask.This is the actual scrollbar:
Code: Select allpackage com.own.ui
{
import flash.display.*;
[code]......
View 5 Replies