ActionScript 2.0 :: Retrieving R, G And B Values From Colour?

Mar 28, 2011

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.

View 6 Replies


Similar Posts:


Flash :: Colour Format/Encoding Are These Colour Values In?

Oct 31, 2011

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:

View 1 Replies

ActionScript 2.0 :: XML Calling And Retrieving Parameters & Values?

Feb 18, 2009

I created code based on a site I found that puts the XML into CSV's, here is the code:

var myXML:XML = new XML(); // instance of XML Obj.
myXML.ignoreWhite = true;
myXML.load(config.xml)

[Code].....

So after all of that, my question is, if that one tag XML file that I gave an example for has 100 or so lines, is there a way to call it without having to know the line it is on so you don't need to put the array value in all of the time?

View 5 Replies

ActionScript 3.0 :: Retrieving The Width And Height Values?

Oct 23, 2009

How do I get Width and Height values from a Movie Clip created just for contains external content loaded?

When I trace it I get "0", why?

Here is my code:

Code:
containerFotos.addChild(loader);
trace(containerFotos.width);
container = Movie Clip.

loader contains the External jpg image.

View 2 Replies

ActionScript 3.0 :: Retrieving Class Values In Main Timeline?

Feb 28, 2012

The code works, I'm jsut unable to read the Class variable "myString" on the main timeline.I thought I could pass the "myString" value from the Class to the Main Timeline?I created a variable in an external Class .as file.See coding below.

//------- Code on main timeline .Fla
var testClass:MyClass = new MyClass(myString);
var myString:String;

[code].....

View 3 Replies

ActionScript 2.0 :: Get RGB Values Of A Mc During A Colour Tween?

May 12, 2009

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.

View 1 Replies

ActionScript 2.0 :: Get Current RGB Values During A Colour Tween?

May 12, 2009

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);

I am using Flash MX with AS2.0.

View 10 Replies

Actionscript :: Build A Colour Hex Value Using 3 Decimal Values?

Feb 11, 2010

basically i want to build a colour hex value using 3 decimal values.

for clarities sake, the 3 decimals i have are

255
254
253

and i want to generate the hex string:

0xFFFEFD

how would i do that?

View 1 Replies

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.

View 5 Replies

Professional :: Create Document To Change Colour Of Certain Graphics Using Own Colour Palette

Jul 14, 2010

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.

View 3 Replies

ActionScript 3.0 :: Changing Colour Of A MC With A Colour Picker?

Aug 17, 2009

i have a background and i want to be able to change the colours of it using a colour picker... if the MC was to cover the whole stage... how could i then get a colour picker and make it so it would change to whatever colour i wanted from the colour picker?

View 5 Replies

ActionScript 2.0 :: Change All The Elements In Movie That Have The Colour X And Change Their Colour To Y

Jul 24, 2007

I need to change all the elements in my movie that have the color X and change their color to color Y. Is it possible to have this in AS? like, if i press one button all the elements that have the color black (graphic, text, background, etc) change their color to yellow?

View 1 Replies

ActionScript 3.0 :: Slider Input Values - Can't Get The Output Values To Add Up?

Dec 6, 2010

I've gotten these sliders to work but can't get the output values to add up. For instance, depending on the values for slider 1, 2 and 3, I need the total to show up in a separate text box. I keep getting a NaN message in the text box.Here's the code I have so far:

//item 1
sliderOne.width = 600;
sliderOne.value = 0;[code].....

View 3 Replies

CS3 : Retrieving The Last Keypress?

May 19, 2009

What I'd like it to do is find out what key was last pressed and then based on which key it was, go to a specific frame of guy_mc. So basically if the left key was the last key press I want it to go to frame "Left", if right key was the last, go to frame "Right," etc. I'm completely lost on this one and every tutorial I come across is based in AS2 which has much simpler methods than AS3.

Code:

//listen for guy_mc to see if all keys are up
guy_mc.addEventListener(Event.ENTER_FRAME, allKeys);
//if all keys are up...

[code]....

View 1 Replies

Retrieving The Value Of An Array Variable?

Jun 19, 2009

I have an array variable called ball[#], which value starts at 0 and is incremented up to 8. I also have a corresponding array variable called _ballPlaced which returns true or false if a ball is placed in a target zone. What I would like to do is retrieve the array value variable from the ball[#] at any time. For instance, the ball[#] variable can be clicked and dragged, so when it's selected it becomes the event.target. E.g. How can I put the array value of the ball[0] in the ball _ballPlaced array.

ActionScript Code:event.target._ballPlaced[/* retrieve vale of ball[0] array i.e. 0 and put it in here */]

View 1 Replies

.net :: Retrieving Image From Db In Flash?

Jul 5, 2011

So basically, I need to find a way to retrieve the image url that is stored in a database, and I need to do it through asp.net if possible (I want to avoid XML if I can). I'm an actionscript 3 newbie so I don't know what calls I might use to connect to the .net page, but I am able to retrieve the data through SQL to the .net page.

View 2 Replies

ActionScript 2.0 :: Retrieving XML Attribute Value?

Feb 6, 2007

How do I go about retreiving the attribute value in the following XML script. In this case "atl" in the first child?

Code:
<?xml version="1.0" encoding="iso-8859-1"?>
<hotels>
<prop id="atl">

[Code]....

View 1 Replies

ActionScript 3.0 :: Retrieving Name Of A TimerEvent?

Feb 27, 2009

I'm using multiple timers in a script, but I would like to use the same function with a Switch to define the appropriate action corresponding to the event.target. I've tried e.target.name but it says that name isn't a property of the Timer class... how can I retrieve the names (timer or timer2) within the onTimer function?

Code:
var timer:Timer = new Timer(3000);
var timer2:Timer = new Timer(3500);
timer.addEventListener(TimerEvent.TIMER, onTimer);

[Code].....

View 1 Replies

ActionScript 3.0 :: Retrieving Input Text?

Mar 16, 2009

I have a input box in which what is typed is returned in a text field on the same page.I've created the variable inputTxt to hold the typed text and added the following code to the submit button, which works fine.

function onClick(event:MouseEvent):void
{
inputTxt = name_txt.text;
username_txt.text = "Welcome " + inputTXt + "! ";
};

I'm not sure on the code needed to retrieve the typed data on a later slide.

View 1 Replies

ActionScript 3.0 :: Retrieving The Color Of An Object?

Mar 21, 2009

Is there a way of finding out the color of a graphic? For example if i have an array of rectangles, each with a different color set using graphics.beginFill(), can I then do something like:

color = rectangleArray[i].getColor();

View 1 Replies

ActionScript 2.0 :: Retrieving Value From A Cell In Datagrid?

Jan 21, 2010

I have created a datagrid with 2 columns. The first one is the normal text data and the second column contains buttons for each cell. What I want to do is retrieve the text information when the corresponding button on the same row is clicked. How do I get this information? I am unable to use selectedItem because I do not want to select the correct row before pressing the button.

View 2 Replies

ActionScript 3.0 :: Dynamically Retrieving Xml Data

Sep 7, 2010

I'm experimenting with data retrieval from xml spreadsheets. I have 5 links in the xml labelled:

<link0>index.html</link0>
<link1>about.html</link1>
<link2>portfolio.html</link2>
<link3>links.html</link3>
<link4>contact.html</link4>

In my movie, I have a loop, which upon each revolution a dynamic 'counter' ticks from 0 to 4, then resets etc:

[Code]....

View 3 Replies

ActionScript 3.0 :: Retrieving File From ApplicationStorageDirectory

Jan 11, 2011

I have this Load Manager Package class file now for a while and I would like to make changes to it e.g. 1st step.How to read the Xml/Text file. The first part is the original code.[code]The second part is in a way how I would like to do the same as above, but loading/reading it from the 'applicationStorageDirectory'. I have left two lines in there which are not used just for testing things. The App works as is eliminating all Errors, but of course with nothing showing of the text file.[code]

View 2 Replies

ActionScript 3.0 :: Retrieving Some Text From A Xml File?

Nov 1, 2008

here is the deal. I am retrieving some text from an xml file in AS3.0 and i'm having some problems.

for exemple(below) :

While showing the first 3 line... I ain't able to show the last lines...

View 2 Replies

ActionScript 3.0 :: Unable To Retrieving Xml Data?

Dec 2, 2009

i have xml structure.

<?xml version="1.0" encoding="utf-8"?>
<ul>
<li><a href="http://www.google.com">Google</a></li>

[code]....

View 5 Replies

Professional :: Retrieving XML Without Getting Child Nodes

Dec 22, 2010

Have xml that looks something like the following:
<level1>ARTWORKS
<level2>ARCHIVE
<level3>COLOR</level3>
</level2>
</level1>

I am trying to retrive the ARCHIVE String, but can't seem to do that, without also getting the <level3>COLOR</level3> node. I am doing this like this: _
xmlData.navigation.level1.level2[0], which returns this:
ARCHIVE
<level3>COLOR</level3>
How do I get it to where it only returns the ARCHIVE?

View 5 Replies

ActionScript 3.0 :: Retrieving Variables From Objects?

Feb 13, 2009

I want to get the variable-value name pairs from an object. Anyone has got an idea how to do it? The name-value pairs are always different, not even the same lenght. I need an universal loader

[Code]...

View 0 Replies

ActionScript 3.0 :: Retrieving Value Of Array Element?

Jul 20, 2009

I'm trying to retrieve the value of an array element in a trace statement...how do I go about this? I've had a look through the AS reference manual but can't work out what should follow the dot '.'?

ActionScript Code:
trace(currentBall.name + " is in " + zone[i]./* something here to retrieve array element value */);

View 2 Replies

ActionScript 3.0 :: Retrieving Bitmap From An Array?

Sep 15, 2009

i have several bitmap stored in an array in this way:

var my_bmp:Bitmap = new Bitmap();
my_bmp = Bitmap (event.target.content);
my_bmp.smoothing = true;
bmpArray.push(my_bmp);

how can i get later (from the array) each different image and add eventually to a movieclip?

View 9 Replies

ActionScript 3.0 :: Retrieving Clicked Button Id Into FLA?

Oct 7, 2009

I am stuck with a problem of retrieving the button Id, clicked in a dialogBox, into my FLA. To make my point clear, here is the code snippet:

ActionScript Code:
package
{
import flash.display.*;

[code]....

View 7 Replies







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