Flash :: Bitwise-shift Operations In AGAL?
Jan 18, 2012
If I encode all colors into one single float value (RGB) as:
//Each Channels are from 0 - 255
red << 16 | green << 8 | blue;
How can I retrieve those color channels back in AGAL? There doesn't seem to be any bitwise operators.
View 2 Replies
Similar Posts:
Sep 19, 2009
Here's an example I ran across:
private function bitwiseAnd(a:int, b:int):int {
var result:int = 0;
var n:int = 1;[code]....
So basically all I need then is bitwiseOr and bitwiseNot and I'm set.The reason is that Pixel Bender doesn't support bitwise ops (inexplicably) but does support various math operations. Also they don't support loops for Flash either, but the above can just be expanded out.I thought about doing bitwise ops without bitwise operators a while back, but couldn't picture how to do it. I wouldn't know how the above was derived logically either.
View 2 Replies
Feb 29, 2012
I want to pack epoch milliseconds into 6 bytes but i have problem. Let me introduce it:
[Code]...
View 2 Replies
Jul 16, 2011
Is there a direct way how to turn a negative number to positive using bitwise operations in Actionscript 3? I just think I've read somewhere that it is possible and faster than using Math.abs() or multiplying by -1. Or am I wrong and it was a dream after day long learning about bytes and bitwise operations?
What I saw was that bitwise NOT almost does the trick:
// outputs: 449
trace( ~(-450) );
If anyone find this question and is interested - in 5 million iterations ~(x) + 1 is 50% faster than Math.abs(x).
View 4 Replies
Oct 18, 2011
For example, I want to output red color in fragment shader.[code]...
View 1 Replies
Dec 20, 2011
I store a UV-coord from va1 to v1. In the frag shader, an interpolated texture coordinate now is available in v1 to sample. Are there connections under the hood, like semantics, to associate v1 with being the normal coordinates?Are fragments pushed to the fragment shader per triangle or once an entire mesh's geometry vertices are run through?In the vertex shader, let's say I multiply my modelview by my vertex's position. I then want to share my z-coord with the fragment shader for something else. I store the z-cord of the transformed vector into v3. Once I am in the fragment shader and I access v3 for the z-coord, is this the same z-coord I passed in or is this z-coordinate going to be altered by the perspective divide in between? I only ask as I want to clarify the "interpolating" behavior described when storing values in these registers.
View 1 Replies
Dec 29, 2011
I understand the 'xyz' components of a vertex's position, but what does 'w' do? Could it be left as the same constant value all the time?
Example:
mov op.xyz, va0.xyz
mov op.w vc0.w
View 1 Replies
Nov 19, 2004
i came across these things called bitwise operators. After some research i didnt get any further than the fact that they alter bits directly. Then i read something on shifting bits and stuff, and that this would be more efficient it this got me confused. Can you use them to optimize your code? Can someone give some examples of this, like a function and his alternative (using bitwise operators)?
View 6 Replies
Oct 13, 2002
why the script in the movie as shown in the attached file bitwise.gif is not working.I have used 2 instances of buttons and a movieclip (orange box) wiht an onclipEvent( enterframe) handler. the goal was to use the movie clip to monitor if the buttons are clicked once or twice. the movie works if I use the button with (1<<0) only
View 6 Replies
Nov 19, 2004
i came across these things called bitwise operators. After some research i didnt get any further than the fact that they alter bits directly. Then i read something on shifting bits and stuff, and that this would be more efficient it this got me confused. Can you use them to optimize your code? Can someone give some examples of this, like a function and his alternative (using bitwise operators)?
View 9 Replies
Sep 11, 2009
I've written a function that makes all white pixels in an image transparent. This works OK, but the resulting image looks jagged because it only replaces pixels that are solid white. What I'd really like to do is set the alpha value for each pixel proportional to the amount of white in that pixel, then set the RGB value to #000000. I think this would produce a very smooth semi-transparent image. However, I'm not very good at bitwise operations. Can any of you lend a hand?
As an added bonus I'd like to overlay the resulting bitmap on top of another image. I know this is possible via other means, but it would be nice to do it all in one function for performance reasons and simplicity.
[Code]...
View 7 Replies
Mar 24, 2010
just can't understand why Adobe has not corrected this very basic bug since ages. So, the thing is Windows users tend to love, GOT USED TO using CTRL+INSERT and SHIFT+INSERT for copy and paste operations.Yyyeeas I know, that under Keyboard shortcuts I can define my own shortcuts, but the real problem is, that even after the Shortcut manager eats shift insert as a paste hotkey, it just fails to function.CTRL INSERT works like a charm, but SHIFT INSERT as Paste DOES NOT.AAARRRGGHHH. ADOBE PLEASE CORRECT THIS ERROR TO ALLEVIATE THE PAIN!
View 6 Replies
Mar 25, 2011
in my Flash/CS3 game I want the user to hold down SHIFT key to make their character run instead of walking. However on Windows I keep getting the "do you want to enable stickykeys" popup as a result. Is there a way to avoid this in Flash, or should I just use a different key... if so are there other keys I should blacklist as well?
View 1 Replies
Oct 12, 2011
I load a bitmap to the stage, it's a GIF and set to lossless compression. I have ensured its coordinates are integers and have not allowed smoothing (smoothing somewhat fixes the issue but reduces quality of the image).The problem is the image appears to shift one pixel to the left and add that pixel on to the right side meaning one side has no border and the other a double border.The original bitmap does not have this issue, and there is no transparency .etc in the image.
View 1 Replies
Jun 19, 2011
i am using senocular transform tool in my flash, anyone know how to force user to scale image proportionally without pressing shift key?
View 2 Replies
Aug 25, 2010
I am trying to use the same script, an image uploader (that uses PHP), twice to upload two different images into two different scroll panes using two different buttons, while displaying the current action in a text area.I would have thought this could be done by changing the names of the buttons etc and then changing them in the script to match, but I'm not entirely sure how to go about doing this (I am completely new to Flash!)
ActionScript Code:
//Allow this domain
System.security.allowDomain("http localhost/");
[code].......
View 1 Replies
Nov 6, 2009
I've created a application where the viewer could change colours, add text, add logos, rotare them, etc... How do I create a reset button which resets everything to back normal in a specific FRAME? What functions do I have to use?
E.g.
Frame 5 is used to Add colours and text, etc...
Frame 10 is used to Add logos,scale them, rotate them, etc...
I need a reset button in Frame 5 to make only the things which were changed back to normal.
View 1 Replies
Aug 2, 2011
I need for my little project know a way to do following things:
- Getting any character from string (preferably operating on strings like on 1 dimensional arrays)
- Get ASCII code for character
- Convert number which contains ASCII code to character
View 7 Replies
Sep 9, 2005
url...when you click on DATES it will bring up an event calendar everything works fine but when i click on another nav link like PHOTOS the dates remain visible!this is a serious problem and i cant figure out how to unload whatever operations cause that layer.
View 3 Replies
Jul 27, 2006
This is what Have done but will take up a lot of lines
Code:
check.onRollOver = function(){
_root.check.gotoAndStop(2);
};
check2.onRollOver = function(){
[code]....
View 7 Replies
Jan 23, 2012
I've mostly seen examples where a Matrix3D object is passed as a vertex constant register in AS3 to the Context3D object. But never seen a matrix in any other types of registers (temporary or attribute).Would there be any way to copy a Matrix vertex constant to a temporary register, and then manipulate individual fields of that Matrix temporary register (ex:for the rotation), with other supplied values (vertex attributes or other constants)
View 2 Replies
Aug 28, 2010
Let's take the next example:
<mx:State name="sayHello">
<mx:SetProperty name="preText" target="{this}" value="Hello"><mx:SetProperty>
</mx:State>
Can I somehow know when preText property has been set to hello?
[Code]...
View 1 Replies
Nov 14, 2010
I'm editing the MotionPath LinePath2D by Greensock to make it become LinePath3D. However I'm stuck in editing this method:
[Code]....
I don't get the operations Greensock does to find the y and x inside the atan2. Why does he multiply xChange (which is a scalar and it should be the delta-x of the Line segment [IMG]) to the b component of the matrix and then sum it to the other thing?
[Code]....
View 0 Replies
Mar 22, 2012
I'm trying to make a calculator to convert radians to degrees. I can do it with radians in decimal form (0.523 instead of PI/6, for example) with no problem. I'd like to do it in the correct way, but I don't know how to make math operations directly in text field nor introducing the PI number.
View 2 Replies
Jun 28, 2009
I'm using WebService class with WSDL.How to list available operations in WSDL and their parameters?There is operations property but it's empty.
View 2 Replies
Mar 25, 2010
I am currently working with a hierarchical tree structure in AS3/Flex, and want to enable drag and drop capabilities under certain conditions: Only parent/top level nodes can be moved Parent/top level nodes must remain at this level; they can not be moved to child nodes of other parent nodes Using the dragEnter event of the tree, I am able to handle condition 1 easily.
[Code]....
View 1 Replies
Feb 13, 2011
I am working on a project where I need a lot of calculations.I found a really strange and very annoying problem in Flash: If you try to multiply 17.4*32.8 the result is 570.7199999999999 !!! This is just a single example.In this way my application looks buggy sometimes. What's the reason for this wrong result?In my application I don't want to round the numbers .
View 5 Replies
Feb 9, 2009
I was wondering whether it would be possible to perform operations on Filters, specifically the DropShadow filter, such as resizing it. Are there any known ways to do it?
View 7 Replies
Nov 1, 2009
I'm doing a lot of lineTo() operations within a sprite but now I need to draw a line WITHOUT anti-aliasing applied. I assumed it would be easy enough to disable anti-aliasing either for a single draw operation, or in the very least for the entire sprite - but I'm really struggling to work out how to do that.
View 6 Replies
Jun 21, 2010
I have a psd that is to be the background of a flash site that i'm working on. I've tried every combination of exporting from photoshop and flash but the end result (in the browser) is always significantly brighter.Does anyone know what the best prossess for keeping the colour of imported raster content accurate in swf while keeping the size moderate?
View 1 Replies