ActionScript 1/2 :: Load A Fill Colour Values And Make Them Apply?
Nov 4, 2009
I have a main FLA and when a button is cliked few swfs loads in to it. I need to get a fill colour applied to a object depending on whcih button is cliked.E.g. my_btn - click - loads my.swf & applies #333333 to "my_mc"I'd like to involve a MySQL db here since I'm loading some data with the same buttons' onPress command.
I am parsing colour codes that I get from a Flex(Flash ActionScript) application, then creating HTML div elements with that same colour. My Problem: The colours are all only 8 digits long. So they cant be RGB colour values can they? What color value format are they in? If I can figure the format they are in I can convert them to RGB. Maybe the last/first digit signifies its 0. alpha value?
PS: Should I convert the colours to RGB or something else?
This is an example of the colour code values I getting from the flash application:
how do we change the button colour using action strip. for example , i have created a button , and the fill colour for the button is green now. After i click on the button , i want the button to change to red colour .
I'm building an activity for young kids where they click on a colour in a palette (mouse cursor will be a paint brush) then click on various shapes that I'll layer to create a picture.
depending on the colour they select they should be able to fill the shapes with that colour. Change colors half way through change their mind etc.
I've seen that it's possible to format a specific bit of text in a text field with:setTextFormat(format:TextFormat, beginIndex:int = -1, endIndex:int = -1):void
I need to format a section of text by applying a texture to the rectangular fill space around the letters. (Imagine in Microsoft Word that you've written a short sentence and you highlight it. Then you fill the text background with a colour. Then imagine that that colour is a single repeating texture. That's what I'm trying to achieve.) Note that the text field must be multiline, and I'm not looking to fill the whole rectangular text field area. The applied texture needs to fit to each character. Is this possible in Actionscript? Would I need to use some kind of HTML or CSS formatting? Is it possible at all? If it is possible, is it possible to change the size of the fill area around the text?
I have a game, in which the player can open maps to edit them. The maps each have their own colour. The player assigns a colour to the map by using sliders (R, G, B) This all works fine.
However, I also need a way to put those sliders back in place when re-opening an existing map. This means that I need to know what the percentages of R, G and B are in a colour. I made flash trace a few of those colours, this is the output:
16646398 0 16646144 65024 58878
I need to know the amounts of R, G and B in any colour.
I am trying to carry out an actionscript colour tween and have found the following code on these forums:
doTween = function () { var t = (getTimer()-this.startTime)/this.dur; if (t>1) {[code]....
My problem is, I would like to have a variable which returns the current red, green and blue values of the movie clip during the tween.In other words, I need to define a variable for the current RGB in the middle of my AS colour tween so that the following example would tween smoothly from the current values to the target.
I am trying to carry out an actionscript colour tween and have found the following code on these forums:
//////////////////////////////////////////////////////////// doTween = function () { var t = (getTimer()-this.startTime)/this.dur; if (t>1) {
[code]...
I would like to have a variable which returns the current red, green and blue values of the movie clip during the tween. In other words, I need to define a variable for the current RGB in the middle of my AS colour tween so that the following example would tween smoothly from the current values to the target.
E.g. mc.beginColorTween(currentr, currentg, currentb, 255, 204, 0, 500);
Is it possible to fill a ByteArray with random values that SoundMixer.computeSpectrum() could read? If so, how?The reason I ask is if a tab like youtube is open, I get a security error. I would at least like to see some random values even if they arent matched with the music playing.
I intend to apply a linear gradient via actionscript to an image (.png) with transparent areas. Of course, I previously converted this image to a movieclip. So I actually want to apply the gradient fill to the container movieclip, which has the instance name of "flower". Here's the code:
[Code]...
There must be something wrong with my code because nothing happens when I call the myFunc() function. the more time I'm spending on trying different variations of these variables, the more frustated
I'm using String.split to parse a command line string into an array of strings. The result is then used to call a function using the Function.apply API.If apply(null, ["17"]) is called with this function:[code]does not work (expected output: false Boolean; actual output: true Boolean).Is there a way to make it recognize "true" and "false" (or anything else) as Boolean values, just like it does with numerical strings? Ideally "true" and "false" should also remain valid string values.
I'm using String.split to parse a command line string into an array of strings. The result is then used to call a function using the Function.apply API.
If apply(null, ["17"]) is called with this function:
static function test(foo:int):void { trace(foo, typeof(foo)); }
it works as expected (output: 17 number).
However, calling apply(null, ["false"]) or apply(null, ["0"]) with this function:
static function test(foo:Boolean):void { trace(foo, typeof(foo)); }
does not work (expected output: false Boolean; actual output: true Boolean). Is there a way to make it recognize "true" and "false" (or anything else) as Boolean values, just like it does with numerical strings? "true" and "false" should also remain valid string values.
I've searched the threads to find something that may help but as i'm not too good with AS i'm not sure what Is relevant to what I need. So i'm hoping someone can put it simply for me.
I have a pattern in the background of each page on my website which sits on the Index page. When each new page is loaded, on release of the relevant button, the background pattern should change colour. I have 9 pages to load therefore it changes colour 9 times.
What sort of code should I use? I'm not familiar with changing colours in AS!
make a colour in game with flash? you know the one, its got a picture then you click on the colour you want then you click on the part of the image, and it fills in that part. a bit like the fill bucket tool in flash
i have a MC named "intro" with two images and a video inside it, and i need to make this MC fit the whole window, so it will be 100% maximized but keep the aspect ratio/dimensions (so the video dont get distorted and stretched).
but that will just stretch and distort the video/MC to fit the window... and i need to constrain the proprtions (like when you resize a video in a video player).
I want to create a flash document that allows me to change the colous of an image using a colour palette of my own. I am a complete beginner and have no idea where to start this, hence i would need to know what to do and how to do it. I basically want the image to be a simple 2d image that i will create using different layers in photoshop and import them into flash, the layer images will all be one colour so the colour of the whole layer changes. so the colour palette will be on the side of this and when i click on an image and then a colour the image changes to the colour i clicked.
I have really complex flash animation thats severely obfuscated accross several layers and over 500 Symbols. Luckily the whole animation uses just two colours, all the way through. I need to find a way of swapping colours like this, so I can make all the red parts green, etc.
I've been developing a piece of code that looks for keywords inbetween tags, and then stores these into an array (hlword) I am now trying to get it so that when it finds these words, it makes the word bold and changes the colour.
[Code]....
The code in orange is what I have been working on in an attempt for it to change the Textformat - Is this going a long the right lines?
how to make you swf fill the whole browser window? something like this... [URL] I'm just wondering how to maximize the space in the browser... this may also be a stage size problem/solution?