AS3 :: C - Implementation Of Upper Power Of Two Algorithm
Mar 1, 2011
I have been trying to implement the Round Up Power Of 2 algorithm outlined in the following link in AS3.
[Code]...
The algorithm works great for most of the values I've tested. It is mentioned that this will return 0 when given an input value of 0 which is technically incorrect but I'm ok with that output. What I'm not ok with is when given an input of 1 I get and output of 1. I'm thinking that this must be a caveat of AS3 and its wonky uint implementation but I can't seem to figure it out. I have also tried using the >>> logical shift operator to the same result. My C is a little rusty, but I'm not sure how this would even return 2 in C. Can someone explain to me whats going wrong here? I assume if an input of 1 was a special case it would have been mentioned in the above link.
View 1 Replies
Similar Posts:
May 24, 2011
The question is simple; I need the fastest way to calculate power 2. I need that for this formula which calculates distance between 2 points.var Dist:int = Math.sqrt( (mmx - ox) * (mmx - ox) + (mmy - oy) * (mmy - oy) );
View 2 Replies
May 13, 2003
why aren't they working? need any more details?
View 3 Replies
Mar 27, 2009
why aren't they working? need any more details?
View 1 Replies
Sep 6, 2009
I've been wanting to learn to work with Flash for awhi l e and decided to start learning by attempting a game. I found a decent tutorial for a space shooter and used it to create the basic code (firing, etc...) and now I've been figuring out how to add other elements (splash screen/scrolling screen).now I'd like to add power-ups but can't figure out how.I've created a graphic, turned it into a movie clip, but can't think of what to define for its actions.
View 2 Replies
Sep 3, 2011
I have a problem with the sound capture of my Microphone in Actionscript 3.0.Particularly I would like to capture the "power" of sound, better if in decibel.Does a method / attribut of class Microphone exist.
View 6 Replies
Jun 6, 2010
I have a set of data (in ArrayCollection) and I need to fit a power function { f(x)= B + x^alpha } to it, before display in LineChart. As result I need the alpha and B paremeter.
View 1 Replies
Nov 4, 2002
I have an MC that occurs many times on the stage, and each one has a motion, and random scaling script in it. Would I save computing power by not having a script in each MC but rather assign them all to a prototype?
View 14 Replies
Dec 10, 2008
I need a good Flash strategy for creating an ordinary PowerPoint presentation. We always need very media-rich presentations (PP is weak in this area). So far we have relied on embedding a Flash object in PP. This turned out to be a bad move because many of our clients deal with the Defense Department and are not allowed to D/L and install the latest Flash player. I have found that publishing a Flash movie projector (.exe) that advances slides like a PP is a good solution. The problem is that I have to put buttons on each slide and write unique functions to advance the slides I would like to be able to simpley click the mouse or use the arrow keys (like PP) for navigation. Should I use the "Flash Slides Presentation" template?
View 2 Replies
May 20, 2010
I'm making a 3D program and I've already made the back end which calculates where each object's polygons should be. However, I can't seem to find a quick way of drawing them without having to remove and redraw them each time, which I'm sure would take a lot of processing power, knowing the way that Flash does things. So is there a way to draw a shape (a quad in this example) and then alter the shape's color and the position of all of its corners in the next frame without taking a huge load of processing power? I would really like to be able to do this to at least 20 polygons, hopefully more, within the span of one frame at 20 fps.
View 3 Replies
Dec 31, 2011
I'm doing a prototype game like Worms and I would like not only to shot, but also see the whole projection curve where my shot will travel before it hit the ground. The only information given by the player is an angle and a power. There is also some level elements like wind and gravity.
Can I have a code for the projection curve? its like a parabola I think. I research about parabola but I had some difficult to apply these math formulas into the programming code.
View 1 Replies
Apr 9, 2006
How can I make Flash calculate the value of the function y= (1 - x^2)^3 where x is the user input value?
View 3 Replies
Mar 18, 2009
Do you usually set the registration point in the upper-left corner ?I usually have always troubles with the registration point in the center.. or is maybe useful in any situation ?
View 1 Replies
May 2, 2010
I have this little crumby thing I'm working on. And in it, I draw a circle with a radial gradient fill. Then I add that circle to the array: "colourSplodeArray"
I have another circle that bounces around and hits walls, "creating" the previously mentioned circles. (So I have one that is not in the array, the rest are)[code]...
View 2 Replies
Aug 26, 2011
[URL]I'm trying to make an animation of electricity going through power lines.. (and just drawing lines in general) and I like how it was done in this video. I'm just not sure how to go about doing it.
View 1 Replies
Jul 23, 2010
I have two layers in my flash cs4. Lower layer contains pink color random brush strokes. The upper layer contains black rectangle. I am able to see the pink color brush strokes through my black rectangle as if I have reduced the alpha of the rectangle?
View 2 Replies
Oct 21, 2009
Lets say I do this in one of my classes[code]...
how could I from _shader call a method in this class (where _shader was instantiated)?
View 6 Replies
Apr 25, 2010
I'm using a gallery maker called "flash slideshow maker professional" , but when it loads, the hole stage goes to the upper left corner!
View 3 Replies
Jan 21, 2003
I have a flash menu (125 px x 600 px) on the left of a webpage. It consists of (15) buttons each of them havin' a onMouseOver-->getURL. When the mouse enters the flash movie (that is the menu) there is a mask button that moves along the y axis and when you move to a button in the menu the mask moves to that point. When you click on it it opens the URL in your browser. Now the problem is that when you leave the flash movie (menu) I want the mask to go to the upper part of the movie (menu).How can I do that?
View 3 Replies
May 24, 2005
I've got a few text boxes address1, address2 etc which I've restricted using
address1.restrict = "A-Z 0-9";
All seems well if you input your address manually, but also there is an automatic feature on the web catalogue I'm working on, where you can enter your postcode and the relavent addresses will be generated in a scrollable list box. You can select an entry from this list box and click OK to confirm this is your address, which will then conveniently fill in all your address1, address2 etc input text fields.
But, when the addresses are generated in the list box they are not displayed in caps for example 92 Green Lane, Moston, Manchester. Like this... and so when you confirm your address each text box is filled in the same case, NOT in Uppercase like I've specified. Anyway to correct this once it passes the address variables into the text fields?
View 1 Replies
Sep 21, 2006
Is there a way to convert the display of the TextInput to upper case? Like this:
type h ===> displays H
type e ===> displays HE
type l ===> displays HEL
type l ===> displays HELL
type o ===> displays HELLO
I tried using the following, it traces but it doesn't display
Code:
keyListener = new Object();
keyListener.onKeyUp = function() {
// var myText = mainTXT.text;
myText.toUpperCase();
trace(myText.toUpperCase());
}
View 8 Replies
Jan 6, 2005
I'm reading a AS-book for a week now, and now it's about fscommands. But I noticed they use both lowercase & uppercase to start the boolean values (true/True & false/False).
Code:
fscommand("fullscreen", "true");
fscommand("allowscale","False");
Is that a mistake or does it just not matter?
View 1 Replies
Oct 30, 2008
I want to make a function like y= (1 - x^z), where both x and z are user input values. How is that possible?
View 1 Replies
Feb 20, 2010
I want to change the case of text in the text field what I have to do. Shall I use
textField = textField.toLowerCase();
View 1 Replies
Oct 29, 2011
How can I change the first letter of an input textField so that it is always in upper case ? For instance if my_txt.text= "hello", it would become my_txt.text = "Hello".
View 4 Replies
Aug 27, 2006
I'm sure that many of you already saw things like this ( eg: when winning at FWA S.O.T.D., you get a little "logo" and many sites have it aligned in the upper left corner), so this is what i want to do, let us say i make a MovieClip ( dimensions doesn't matter, but it's quite small ), and i want to align it to the upper left corner of the stage... The thing is that the movie/stage is set to auto-scale, so whenever i scale the browser window then that MC should "refresh" its position and stai at the upper left corner again.
View 3 Replies
Mar 19, 2009
I cannot find any information anywhere on how to change my layout or even the ruler layout in Flash. The stage is stuck in the upper left-hand corner of the pasteboard. If I could get the zero point of the rulers to move (like to the right and down), then I could reposition the stage, but I can't. There is no edit ruler function. The zero points are right in the upper left-hand corner together.I can't see items which I need positioned to the left or above the stage at all. Does anyone know how to change the stage position on the pasteboard or ruler layout?
View 6 Replies
Nov 20, 2007
Please provide the feature to disable the system screensaver & power saving features while a video object is currently playing a video. I get this request all the time when developing video players and now that the netflix player provides this feature it is becoming a must have in the online video market. If you know other solution which does not require .net, silverlight , or any other browser plugin besides flash please let me know.
View 1 Replies
Apr 22, 2010
I'm building a website where I hook people up so that they can anonymously vent to strangers. You either choose to be a listener, or a talker, and then you get catapulted into a one-on-one chat room. The reason for the app's construction is because you often can't vent to friends, because your deepest vulnerabilities can often be leveraged against you later on. (Like it or not, this is a part of human nature. Sad.)
I'm looking for some insight into how I should architect everything. I found this neat tutorial, [URL], which suggests using python & stackless + flash. Someone else suggested I should try using p2p sockets, but I don't even know where to begin to look for info on that.
View 4 Replies
Nov 28, 2011
Basically there will be a club and a ball. You can control the power and angle to hit the ball. How do I go about implementing this? Is flash the easiest way to go? I want to implement this as a facebook game. Any game libraries specific to this I can use to quickly implement a basic version? I am comfortable with Java and PHP.
View 1 Replies