ActionScript 3.0 :: Gets The (wrong) Values And Shows Them As A Color?
May 23, 2011
We have an hsb- color wheel (.png) and we have create a circle which is rotating on the color-wheel. It should grab the color on the wheel, but there is the problem --> It doesn't. We try to make it with the getPixel function and flash traces some numbers, but the wrong ones. In addition there is a rectangle which gets the (wrong) values and shows them as a color.
function mouseDownHHandler(e:MouseEvent):void {
sButtonH.startDrag(false, rechteckH);
/ROTATION
stage.addEventListener(Event.ENTER_FRAME,rotate);
function rotate (e:Event){[code]....
I am recording FLV videos with Red5 server and playing them back in a Flex app. I am aware that Red5 does not properly inject the FLV MetaData, so I am using an external commandline tool to get the metadata in there.
Because I am injecting the metadata, my duration of the video is correct.
The problem I am having, and this is true with all FLV players I try to play the video with (even 3rd party stand-alone video players), is the PlayHead time is never started at 0. When I load up the FLV to play and lets say the video is 10 seconds long, the current time label on the playhead starts at 1-2seconds instead of 0 and the horizontal slider current time indicator also is moved away from 0 and is set to 1-2 seconds along the slidebar. the video plays back fine from what I can see though.
Is there a byte in the FLV that I need to change so that it will start the playhead at 0? I realize this is probably something to do with Red5, so if anyone has any work-arounds or potential things to watch out for that may be causing this
I'm making a flash app that allows you to create text, edit it. At some point, I need to get the text's color.
[Code]...
Then, you can stick the text on the movie and make a new one. During the creation of the movie clip holding the created text, all the format parameters of the text are passed to the movieclip. When I call back the .color parameter, it shows a value that isn't hex nor RGB... I've been googling for the last hour trying to find how to convert this back to RGB or hex values with no success. In this case, the value is : 65535
Flash receives the XML, but the values are wrong. How do I fix this? Problem I can see the XML loaded with no errors, but my output is way off. It's as though it's not receiving any values. Numbers in the output window and animation move rapidly. The Flash file runs as if it's variables where set to zero. I changed the order of my code, but that didn't help with this. how I can correct this.
[Code]...
your problem is that you're calling myLoader.load() and adding an event listener to wait for the xml to finish loading, but you're then immediately setting var delay:uint = 0; and var repeat:uint = 0; and starting the timer. you can see this in your results by the 1, XML, 2, 3, 4 output. the load call is asynchronous so it returns immediately. you need to wait until your processXML function is called before proceeding to the next step.
My problems keep piling up. I was trying to figure out where child objects X and Y positions are on stage and not locally. Therefore i use the "localToGlobal" function and I'm pretty sure i use it correctly? The thing is that some Y values are true but the X are just completely spaced out. I use a function to find all child objects on stage and this works great.
Code: private function findGameElements():void { // Array that will store all elements on screen and their values fixedElements = new Array();
I need to create an interface for a competition which also is a fund raising event. There are a number of teams, and for each point a team scores, their 'points' will be equivalent to a certain amount of money.Problem:To figure out a way on how to make so, that when you click/add a point to a certain team, the following should happen:1) The team's amount increases2) The team's bar shows the same increase3) The total amount of all teams updates and shows at the top of the screenHere's a pic that illustrates the whole thing:Fund raiser interfaceIs there anyone out there who has a clue on how to get this thing working? The graphical aspects of it with tweening etc is no problem, it's the actual "adding value to Bar1 and have a MC show the increase, and summarize the total value of all bars" programming that I'm struggling majestically with.
I've got a TitleWindow with 2 buttons in it. One button is in the contentgroup and the other in the controlbargroup. Titlewindow and buttons are styled with chromecolor.
Why has the button in den controlbar not a red color? How can I get a red button?
So when I call lineTo() and then next call lineStyle() with a new color - that previous lineTo gets drawn in the new color, not whatever color was previously set. It is strange but I don't know if there is some kind of justification for the behaviour?Example: this is meant to draw 2 white lines but the second is drawn in blue if I do a blue lineStyle immediately after. Insert a moveTo or similar "end-draw" function then it's ok. seems broken to me...
//EDIT: - put this rect draw bit first graphics.beginFill(0x000000);graphics.drawRect(0,0,50,50); graphics.lineStyle(1, 0xFFFFFF); graphics.moveTo(0,5); graphics.lineTo(30,5);
I am looking for RGB, for example, 0.5 0.5 0.5, for a gray color.Is there a chance the RGB parameters are hidden somewhere or is there a conversion function at least?
If you have two textareas, one has a rotation value besides 0 and the other has no rotation value or a value of 0 and you 'tab' focus from the one w/rotation to the one w/out. The border around the textArea w/out rotation will be rotated. If you set the rotation value of the non-rotated text field to a non-zero number, even 0.01, it fixes the problem, this causes tons of other problems in text rendering though so its not a solution.
I found setting the focusThickness style to 0 removes the border, which is a good solution but not a great one, anybody got a better one? Here is some sample code:
In my AS3 code all the elements on the page are dynamically positioned depending on the current width and height of the SWF - providing it's not under a certain value, then the items are back in their original position.
When debugging in the Flash player the size all reports correctly however when run from a web browser it does not - initially.
This is my HTML & PHP code for the entire page:
HTML Code: <?php function hashId($fn) { $hash=md5_file($fn);
[Code].....
But I cannot get the size to report correctly without, say, clicking a button.
It seems to me like I need to force flash to re-draw the screen, but I had no luck trying to do that.
So I'm trying my hands on some full browser flash and after reading a couple of tuts I wrote this
Code: #include "mc_tween2.as" Stage.scaleMode = "noScale"; stageListener = new Object();[code]...
The trace's are because it didn't work like I thought it would.Etc the middle movieclip didn't center itself but rather positioned itself seemingly how it pleased so I traced its x position and the var stageXcenter position and like suspected it shows different values.
I am new to flash, trying to do some animation character. I have 2 queries
1. What is lock fill; whenever I am trying to fill a color, it shows lock fill....
2. If I am creating a non regular figure like say with pencil, if I draw some part of it & do other part by later; these will be assumed different objects & I am not able to fill the whole figure with a selected color.
I have 3 Numbers representing the RGB values of a color that I'd like to convert into a uint. I'm trying this: var color:uint = r<<16 + g<<8 + b; but it will always return 0.
Up until CS4 the Colour effects dialog box was incredibly powerful. These 8 little fields were never the most intuitive, and it took a lot of fiddling before I realised their true power: the first column basically controls the contrast of an asset - and the 2nd column controls the brightness.Using these experimentally, you can acheive inverted colours, high contrast effects and colourising effect far superior to tints(see image).Well, you USED to be able to - when you could put high numbers in those fields.But the CS4 version of these controls caps any entered values to 100% and 255 respectively.It seems that it is only an effect of the interface - as I can cut and paste clips with the old settings from CS3 into CS4 and they display correctly.Is this an oversight on Adobe's part, or is there another explanation for the loss of a great design feature?
I'm trying to make an array with different color values. My problem is that when I do... teamColor[i] = currentColor... All color values in my array turn into the currentColor. (I would upload more code, but that would be a massive mess, considering that I have code everywhere with references from movie clips that are as far as 3 layers deep. However, this would be irrelevant anyways (probably), because I tested this with color values on my main timeline, without any references to or from anything deeply nested). I would like to add that I tried adding strings in there and that the strings remained their original, intended, value, while the color exhibited the same phenomenon.
I changed my code by creating separate variables for each color instead of putting the variables into an array (not what I really wanted to do, but it works). My code looks like this: if (teamColor != 0) { this["team"+teamColor+"Color"] = new ColorTransform(0,0,0,1,currentColor.redOffset,currentColor.greenOffset,currentColor.blueOffset,) teamColor = 0 namebox.addboxes()//function in a movieclip }
TeamColor is now an int that is changed based on which box a user clicks from a movie clip that has a dynamically generated name, based off of what the variable value in a loop was when it was created. (E.G: 'tempboxname[ttns].name = i;') teamColor is then equal to that name when the user clicks it. I have another movieclip with colors in it and the above function is called to check if any teamColor change has occurred, and if it has, act accordingly. (The idea of having teamColor equal to 0 is so that if the user clicks twice, nothing changes. I other conditionals for other colors, all within the same function). That is how I fixed me code. It's not what I wanted, because it's not an array (meaning a seemingly infinite number of teamColors, and thus, teams) but it'll do for me.
I am having a color array with values like 0x2EFE2E, 0xFFFF00, etc. but when i am trying to trace the values in the array, it prints something else like 95455. I think these are some converted values. But i tried using parseInt(val, 16), uint(val). None of these works. Basically, i just want to take values from this array and assign it to particleColor (a uint) and use like this:
I have an MC with the instance name "building". I want to be able to change the RGB color values of this MC with three buttons for example. for example, one button would change the RGB values to 60 89 159 another button would change the RGB values to 50 251 59 another button would change the RGB values to 22 21 59 And, when the button is clicked, the new RGB color value should fade in without the old values fading out.
Let's start with the following XML: Code: <swatches> <swatch> <swatchName>Plaid</swatchName> <swatchColors> <color>black</color> [Code] ..... I want to return a list of the <color> values without having any duplicates.
I am doing a simple combobox example. Now my requirement was, i want to differentiate the combobox values with some colors. I dont know how to do this. can you guys pls help me out on this. Suppose for ex: if my combobox data value exceeds 200 i want to display the items in "red" else i want to display in "green".
<?xml version="1.0" encoding="utf-8"?> <!-- Simple example to demonstrate the Halo ComboBox control. --> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
I am able to get <styling> as a XML but I cannot figure out how to parse the style object in order get the color, fontFamily fontSize attribute values. I am also unable to access the lang attribute value <tt xml:lang="en">
am doing a simple combobox example. Now my requirement was, i want to differentiate the combobox values with some colors based on a condition. Suppose for ex: if my combobox data value exceeds 200 i want to display the items in "red" else i want to display in "green". i need solutions for this requirment.
<?xml version="1.0" encoding="utf-8"?> <!-- Simple example to demonstrate the Halo ComboBox control. --> <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
Array of color id-s represents a 3D Array of values. I've represented each value with a color(Blue is 1, Red is 2 and Green is 3). So for the example the array for the image would be[code]...
Now, I have an array of predefined shapes/objects. I'd like to replace the grouped colors with the shapes that I have. I'd like this to follow the rule of finding the largest shape first and then down to the smallest one. [code]...
i have a button, with instance name lightblue_color. I am assigning a color to its color field like this: lightblue_color.transform.colorTransform.color = 0x65ffff; then i am adding an eventlistener to the button like this: lightblue_color.addEventListener(MouseEvent.CLICK, ChangeColor); Then, in the function: public function ChangeColor(evnt:MouseEvent):void {trace(evnt.target.transform.colorTransform.color);} It prints 0. Why is that? Shouldn't it print 0x65ffff or do i need to do some type conversions?
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:
i want to change a colors tint and store that color for later use to apply to dynamically created sprites, for some reason the code changes my place graphic as expect but when i draw a square using the Colortransform.color property the color always in gray scale?