ActionScript 3.0 :: Create ARGB From RGB And Alpha?
Mar 21, 2011How is it possible to create an ARGB value from an RGB value (ex: 0x00FF00) and an alpha value (ex: 0.5) ?
View 1 RepliesHow is it possible to create an ARGB value from an RGB value (ex: 0x00FF00) and an alpha value (ex: 0.5) ?
View 1 Repliesi'm studying getPixel32() and the Bitmap and Bitmap Data classes.Basically, i'd like to know how to output a simple trace of an ARGB from a hexadecimal value.as an aside, i'm under the impression, which i assume/hope is wrong, that hexadecimal values can't produce as many colors as RGBA values.perhaps "web safe" has thrown me off with understanding the usefulness or desire to use colors produces with hexadecimal values.
View 1 Replieswhat's the fastest way to dump your data (not from a file) into a bitmap for display?I have it working with setPixels and colored rects but that's way too slow.Is there a way to load in the raw bytes or hijack the loader class to put in custom loader data?
View 11 Repliesin actionscript 3, what's the fastest way to dump your data (not from a file) into a bitmap for display?
I have it working with setPixels and colored rects but that's way too slow/inefficient.
Is there a way to load in the raw bytes or hijack the loader class to put in custom loader data?
What would be the best/fastest--should I start writing a byte encoder?
BTW, this should be in actionscript 3.
What's the fastest way to dump your data (not in a file) into a bitmap for display?
I had it working with setPixels and colored rects but that's way too slow.
Is there a way to load in the raw bytes or hijack the loader class to put in custom loader data?
I have colour values from a Flash application that are ARGB format(A being the alpha/transparency value). I have to convert that long decimal number to a RGB/Hexadecimal number in Javascript. Do you know how I can extract the individual R, G, B & A values from a long(8 digit) number? Here's my function which converts a number to hexadecimal BUT its not good enough because it needs to convert the values individually(R,G,B,A):
[Code]....
What is the best way to create a video with an alpha channel, suitable for flex/flash? Does it need to be FLV, or can it be MP4/MOV as well?
View 1 RepliesI am trying to tween some text and keep getting the error.
ReferenceError: Error #1056: Cannot create property alpha on builtin.as$0.MethodClosure.[code].....
how to create the proper Actionscript code that will control the Alpha Transparency of a MC I want as a preloader. I want the MC to start of at 100% alpha-transparency, and then decrease to 0% alpha-transparency when the whole Scene is loaded. Also, it should show the precentage of the Scene loaded. I have the code that I thought would work to control the alpha transparency of the mc and loading it. But, I get confused with the perloader code to incorporate into the alpha transparency code? Does this make sense; is it possible?In Leaman's Terms, As the scene loads, the mc goes from invisible to visible at completion of the scene load.
Here is the code:
Code:
onClipEvent (enterFrame) {
loading = _parent.getBytesLoaded();
total = _parent.getBytesTotal();
[code]....
Now, I have no idea if and where you'd include the poper code to control the mc's alpha transparency based on the percentage of the scene loaded? Can someome maybe rework the code to make this work. And use a working example, that way I see it working to fully understand the concept? The mc's instance name is "sm_logo". Where would I use the instance name in this code, or better yet the proper code alltogether?
I would like to create a dynamic 3 layer image that can have any of the 3 layers changed. i was thinking of doing this with alpha mapping where I have a back, middle, and front layer each defined by an alpha map. So if the style or shape of these changed I just render the texture with a new alpha map to define what portion actually takes the texture. So for each of the 3 layers there is a type(defines the shape), the texture which is applied to the shape, and an alpha map that is used to specify how the shape takes the image.
Imagine a fruit basket that can have the fruit switched out or the basket, and any combination of textures applied. You could potentially see the inside of the basket which may have a different texture than the outside. The fruit would all be one image that would then fit into the basket, and finally the basket would render. Then if you swap the color of the basket but keep the same model it would update, and you could then swap the model of the basket and keep the same color. But i'd want to do it where I have 1 texture that can fit over all the baskets but is just chopped off using alpha mapping.
I'm trying to take a png and create two images, one that represents the color data and the other a grayscale version of the alpha channel.
Extracting the correct data was no problem, i'm just embedding the png, creating a new instance (as a Bitmap) and then extracting the relevent channels of it's bitmapData to two new bitmapData instances.
ActionScript Code:
[Embed(source='/../deploy/images/alpha_test.png')]
public var image : Class;
[code]....
The problem that i'm having, is that when i assign the colors bitmapData to a bitmap instance to display it, the background color is showing as black, even though the default fillColor of a bitmapData instance is white. how i can use the alpha channel data to create an 8 bit, grayscale image, that's the reverse of the channel?
posting after a long while, so i thought i'd actually follow the rules for posting,.. I am trying to get this waves thing done, here is the sketch [URL]I am trying to create those antenna waves as in making alpha go to 10% or so in a continuous loop....
View 3 RepliesI'm creating a mask effect. i create 10 movieclip with a library class reference that appear on the screen with a random alpha effect. THe problem is that if i try the effect alone all works ok. if i mask the layer that contains the effect on an image i don't see the effect. i see directly the image masked with the boxes. i can't explain that because i've the effect first but it seems that when i test the movie the effect doesn't play and the boxes appear directly on the screen.
View 5 Replies[URL] i want the object to fade out but in the object there's a lot of overlapping pictures and each becomes half transparent. how to make the movieclip to change the alpha as it was without objects?
[Code]....
just spotted this curious trick. If you want to flip something to go invisible on a click, and then reappear on another click (etc etc), try this:
create the sprite, setting alpha to either to 1 OR -1
mySprite.alpha=1; //OR
mySprite.aplha=-1;
[code]....
using AS, on loading a movie a solid shape is there with alpha at 100% then over a period of 5 secs its alpha is reduced to 0.
i'm new to this......please help if you want to if you don't have a good weekend but think of me struggling onwards and upwards...
I want to do aplpha = .5 for the whole app, but then have a MC display at full alpha, is there any way to do this?
View 6 RepliesAs far as I know theres in no way to cahnge the alpha of a dynamic text box. I put one in a movie clip and when i try to change the alpha of it everything else in it changes its alpha but the not the DT box. Could someone plz verify for me that u can't change alpha and help me find a component that allows alpha control with a dynamic text box. thx in advance.
View 5 RepliesI've bought a component on flashden. This is a text component that makes it possible to load CSS & Html on your flash project. Check the included zip for the source. What I want is that the background of the component is transparant. Now it has a linear gradient. I've tried to set the drawing in the component to zero alpha but that didn't do the trick. How to edit the background (if nescessary by actionscript)?
View 2 RepliesI'm trying to get an instance of an FLV Playback that serves as a background to one of the sections of my Flash site to fade in once the section is entered, and fade back out again when it is exited. I've put it into an mc called 'vid container' and I applied some simple motion tweening to the container, to fade it in from 0 opacity to 100 and back down again. What I'm having trouble understanding is that, while the fadeout works absolutely fine, the fade in doesn't work at all.
View 2 RepliesI have a page with buttons and i want the buttons to grow on click, get bright on mouse over, get brighter on click, go back to original on mouse out (Unless clicked). Then I want the current selected button to shrink and return to normal alpha upon clicking another button. This is the code i have, and it works pretty well:
Actionscript Code:
import fl.transitions.Tween;import fl.transitions.easing.*;homeClip.addEventListener(MouseEvent.MOUSE_OVER,
[code]....
I am using flash to create an animation where text, once converted into a movieclip or a button, fades at a certain point. To do this I am using the text tool and converting the text into a movieclip.
I am trying to make the text fade away by using the alpha property, but the preview will never adjust the movieclips alpha value. I've tried embedding the font and linking it but it still just doesn't work.
i draw a rectangle, convert it to symbol1 and export for actionscript. after that i edit the rectangle class and inside the constructor i want to change the alpha value by writing this._alpha=44; a error msg popout : 1119: Access of possibly undefined property _alpha through a reference with static type Symbol1.
View 2 RepliesI have a game I'm adding a print button to, for users to print their score at the end of the game. The problem is, is that the printing make some of the buttons look weird, for some reason (color is missing, a white box around the button, that should be empty/transparent). This is the script I'm using to print:
Code:
printButton.onPress = function() {
print(drawingArea, "bframe")
}
I've tried a number of ways of making it so the buttons are seen normally, even tracing them as bitmap, but it makes everything lock up when I try to print that way and nothing else seems to work. So I want to temporarily make the buttons invisible, while it's printing, and then go back to vissible once it's done.It's easy enough setting the button alpha to 0, with
Code:
printButton.onPress = function() {
buttonInstanceName._alpha=0;
and then the script to print; it makes it invisible just before it prints, but what I need is way to reset the alpha to 100 once it's done printing.
I've created a txtField with background set to true, backgroundColor set to a certain color, and txtField.alpha set to 10; however, the alpha does not work. The background color of txtField appears to have a full opaque color and not transparency.
View 4 RepliesI'm trying to create a tab system on my website. I have a small 25 pixel tall swf file at the top of the page that acts as the tabs. It uses PHP to communicate with the rest of the site. I have a larger swf below that acts as a directory to my files. When the user finds a file, he or she can open it in a new tab by clicking a certain button. And then switch between tabs using the top swf. I've got all of this down using AS3, but I'm not as good at the basic web design elements. How do I communicate to have every lower layer except for the one that the viewer wants to look at go to 0% alpha? Also, I cannot just have the tab system be all in one swf because some of the files that I want the user to open will be in AS2, which won't run inside an AS3 host.
View 3 RepliesI am trying to get target movie clip's alpha value, which is animated.
When the alpha value is reached to certain value, I want to trigger certain event.
Is any way to get current frame's target alpha value by using set interval or event lister?
I have a line that starts invisible then becomes solid then invisible again. First keyframe is alpha 1%, should the two keyframes that follow next in the timeline where it shows as full strength colour be left alone, showing still as colour>none in properties, or should I choose alpha and 100% ? Last keyframe again sees it given alpha 1%. ( I was told dont use 0% as it causes flash more work !)What is best practice here? I have many of these to do so leaving keyframes as 'none' for colour would make life much quicker.
View 3 RepliesI have this code:
[code]....
It is called recursively. The problem is the alpha value augments, apparently multiplying itself. Why? I successfully remove the child.
After whittling down of the options we've encountered a problem with PNG's and ActionScript 3 (AS3).
When loading a PNG 8 or PNG 32 with alpha transparancy we're getting the following error reported in Flash:-
"Error #2124: Loaded file is an unknown type" Now, we're dealing with some legacy images, and it appears as though this problem isn't universal - some images believed to be 32bit alpha PNG are loading. BUT, some conclusions:-
converting one image that was 32 bit alpha (NOT WORKING IN AS3) to PNG 8 index transparency DID work.
And converting that same image to PNG 8 alpha DID NOT work.
[Code]...