ActionScript 3.0 :: Benchmarking Results Keep Changing?
Feb 6, 2011
I wrote a program to benchmark different version of functions(bitshifting vs integer math) against one another. I thought I had dealt with some inaccuracies that seemed to crop up when you run two functions in the same cycle, but now the answers are changing greatly depending on how the programs is run.
If I run it from Flash CS5, it says bitShifting is better.
If I run it from just FlashPlayer 10, is says bitShifting is bad.
If I run it from FireFox, it says bitShifting is really really bad.
In the end I imagine what happens in the internet browser is what should go, because 9 out of 10 times that's where people will be loading my stuff.
But....What is is going here? I thought my program was fairly solid and by looking at the % of differences between two functions I was taking in to account the time of the for loop itself used to run the tests. This is really really really really freaking annoying. The only thing I can fathom it is; is something to do with the load of each individual program that is running and what resources each function needs.Here is the base code from the benchmarking program I made.If you copy and paste it to Flash, you will need to create:
- decent sized text Field with the instance name "tOut" for Output
- a small text Field with the instance name "tLoop" for # of loops to run
- a MC/text Field with the instance name "btnBegin".
It's setup to easily add to functions, just add vars as needed.
Code:
import flash.utils.getTimer;
var avgTimeA:Number = 0.00;
var avgTimeB:Number = 0.00;[code].............
View 1 Replies
Similar Posts:
Dec 8, 2010
The text shows up, but it needs to display bigger than it is. It's showing up consistently at about size 10, no matter what I set the size to, even "size = 100" .
public function StimLetter(data:Object) {
// format
var format:TextFormat = new TextFormat();
format.font = "Verdana";
[Code].....
View 4 Replies
Sep 1, 2009
Is it common knowledge that distributing an event to 1000000 listeners is twice as slow as manually calling these listener functions for each such listener in 1000000 loop? This is what my conclusion is, I just cooked up some code benchmarking this. How is the native API useful then (aside from in retrospect when it probably will get more effective), if anyone can replicate it using non-native code, that will be a couple of kilobytes worth of extra code, and one can potentially achieve much greater speeds.
View 4 Replies
Nov 8, 2010
I've run into a new problem, this time with positioning. I've narrowed down the line that's causing it--"block.y = block.y + block.height;" in SetOfBlocks.shiftDown. When I take it out, no problem. But with it in, instead of just dropping each block down by a block height, the affected blocks sometimes move up, and also often move about randomly within the X axis--although their new positions always keep them lined up with the 'grid', which is to say, within multiples of the block height and widths.
[Code]...
View 3 Replies
Aug 14, 2009
How do I change the corner radius of a Label component in Flex. Tried applying style name, and the setStyle('cornerRadius',9) methods, but doesn't work. How can I change the arrow image in the combo box control to a different image?
View 4 Replies
Aug 31, 2009
I want to create another button on the main menu of my flash site. I want to take one of the existing buttons (which are set as movie clips) and modify it to show a different menu name and page link. BUT when I go into my library and "duplicate" my movie clip, change the instance name, drag it to the stage and attempt to modify it, the original changes as well. I need to keep the original the same and create a new one with the same code, frames, etc but with different static text. I keep going in circles
View 1 Replies
Feb 1, 2006
basically when you load the .swf it changed everytime u re-load it , i want it to keep on changing even when the user hasnt reloaded the image
[Code]...
View 1 Replies
Mar 10, 2007
i made a quiz in flash using actionscript:
At the end I have to sum the answers and show the result to the user but I can't get it.
Here is the code (I'm kind of new to actionscript, sorry if the code it's too long):
Code:
var p1=0;
var p2=0;
var p3=0;
[Code].....
View 5 Replies
Jan 12, 2011
server the scripts it has to load from the server, but if i call it like it will not load and will get stuck. i remember there was a parameter for the player about allowing it to read only local scripts or something like that, and i plan to test it with this (or if according to the problem description, somebody else has a different theory, all is welcome), but at least in dreamweaver it does not appear the parameter for flash objects, and i dont remember where i saw that parameter or what was its name, what is the parameter to allow a flash movie to read scripts from different servers (even though the situation is kinda weird, since dnses are pointed correctly, or it would not load at all with my and how do i edit the parameters value? do i have to edit it by hand in all pages, in all occurrences?
View 3 Replies
Dec 7, 2011
I'm trying to loop through the results of an httpservice, it is xml. This is how I try to do it, but this does not work.
protected function getArtistsSucces(event:ResultEvent):void {
var artistList:XMLList = XMLList(event.result);
var artistXML:XML;
for each(artistXML in artistList.artists) {
var artistName:String = artistXML.artist.name;
[Code] .....
View 3 Replies
Apr 15, 2011
I recently made a drag and drop game that gets users to rate a word 1 - 5, nothing fancy just event listeners that have many (many) if statements that push the selection into an array at an index.However now that I have this preference list im kinda stuck as I dont know what to do with it now.In java I could save it to a file but from everything ive read there are things to stop flash/as3 from accessing your hard drive(security issues)Basically im trying to find a a way to put this array into some sort of use such as saving them to a file on my hard drive.Also as an aside if there any good tutorials on how to make a scoreboard?ay if a player gets 3 of them 'right' they'd get 3 points and be placed accordingly.
View 1 Replies
Apr 27, 2010
I have a movie that is connected to a database. It pulls info, stores it in an array and displays it. We also have buttons that are coded to send a search query (selected from the data pulled from the database) back to the website to be displayed. Weirdness happens. Here is the button code.
PHP Code:
on (release) {
getURL("http://www.mysite.com/mySiteBuilder.php?tagged=true&UpdateSearch=update&myRouteResults="+_global.taggedRoutes[0][6]+"", "_self");[code]....
All is good here accept for the 1414,2626,2525,1919,1212. These should be 14,26,25,19,12! Checked it and it does perform correctly.
View 21 Replies
Jan 23, 2011
Basically, I have a function that when called will display a menu of options that the user can click on. The menu is dynamically generated from the script and each menu item has it's onPress handler setup to call a dynamically generated function that which has access to the index of the menu item (or any other data I choose to pass it).What I would like to happen is that when a menu item is clicked on, the value is somehow passed back to the function (which built the menu), so that it can return it to it's caller. I've got everything but this last bit functioning.The approach I've tried is to give the onPress handler access to a field in the class which holds the menu building function. Then when it's clicked on, it can set the field to it's value. Meanwhile, a while loop in the menu function is waiting for the field to change, and will then return the new field value as it's result.
However, this doesn't work and the reason is obvious. Any sort of busy waiting while loop locks up the flash player. Therefore, it ceases to handle events and so the user cannot click on the menu item (or do anything else for that matter).What would be ideal is some sort of sleepAndHandleEvents function I could call from the while loop, but from what documentation I've searched, I can't find something like that. I've googled around, but so far I haven't found anything.The reason I want the menu selection returned from the function (rather than the usual method of using callbacks) is that it's called from some procedural code. I know I'm going a little bit against the paradigm of flash (which is mostly event oriented), but some things are just procedural in nature and I don't want to split my code into a million little pieces and turn it inside out.
View 1 Replies
May 30, 2011
im doing a color mixing game.. i have 6 buttons.. with shows the color whn u click on the button.. how to i mix them??
[CODE]....
View 2 Replies
Nov 1, 2010
I built this simple form basically following a template.Everything is working fine but I'm not receiving any results. write the code so that the results will be sent to my email adress .(My site is hosted by FatCow).
send_btn.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_7);function fl_MouseClickHandler_7(event:MouseEvent):void{ var allVars:URLVariables=new URLVariables(); allVars.name=theName.text; allVars.email=theEmail.text; allVars.message=theMessage.text; var mailAddress:URLRequest = new URLRequest("http://www.fatcow.com/scripts/formemail.bml"); trace(theName.text); trace(theEmail.text);[code]...
View 1 Replies
Nov 27, 2010
would go about setting up flash to display results returned by a SQL query one at a time.I can work out the query and PHP, but want I want to know is how to make flash take each one and animate it, including pausing and clearing the screen when full, then continuing on a 'new' screen. It's basically for displaying a list of events in a database.
Blank screen
Event 1 (pause)
Event 2 (pause)
[code].....
View 1 Replies
May 18, 2011
I want to have an input text box with the instance name "answer1_input."If the user types in "one" I want it to go to frame 2.If the user types in anything else, I want it to go to frame 3.
View 8 Replies
May 31, 2011
I searched the whole internet and I could not find a solution for this.I'm trying to load XML, parse values into global array, and use that global array later in my code... this is not working.
_global.autoid=Array();
function ParsingXML(){
var pokXML:XML = new XML();
[code]......
View 6 Replies
Aug 21, 2011
We're seeing very different results from the same files being packaged for iPhone verses iPad. Not having a lot of luck getting things to run smoothly on the iPad when they work great on the iPhone. The iPhone versions also run great on the iPad even though it has to scale down all the retina quality images. I feel like I'm missing some important difference between the two?
View 3 Replies
Dec 15, 2009
I have been looking for a tutorial that shows or explains how to display the contents of a search engine like 'Google' or 'Youtube' inside Flash. No luck so far...
View 1 Replies
Mar 6, 2010
I have a library that provides a reflection API on top of describeType() (a method that returns an XML object with all the specs of a class or instance). Since this library is used in several other libraries and frameworks.
The problem I'm facing is that I'm not sure about the best approach to refactor this libraries' code and make it possible to test and compare the results. I could easily add timers to the code, log the ouput and compare the results, but it seems like a lot of work to do this manually.How did you test and compare the results of the changes?Is there perhaps any testing framework (also non-actionscript) that helps in performance testing in such a scenario?
View 3 Replies
Jun 10, 2010
Why is encryption algorithm may give different results in AS3 and PHP? In AS3 I use library from [URL].And in PHP I use RC4 Cipher.
View 3 Replies
Sep 3, 2010
I think this is just a matter of fine tuning some different elements, but I'd like to know your take. I've got a Flex app, using the Flex 4 data services, communicating with Zend AMF services. One of the services returns all the results in a database using SELECT * FROM table there are ~1200 rows (140KB package size).
My problem is the response time, it's rage inducing. Total duration is always between 7-8 seconds. All but about 150ms of that is latency. I broke up the PHP to figure out exactly where the latency was and turns out return $rows is eating up ~6.8sec latency. I can deal with 1-2sec, but when I start waiting around for 8sec I feel kinda dumb. I cross checked the query response speed directly from the database, and just like I was expecting the total query time is 45-60ms.
PHP, this is basically just the generated Flex data service code, although in production it isn't the same:
public function getAllProject_entries() {
$stmt = mysqli_prepare($this->connection, "SELECT u.*
FROM $this->tablename u");
[code]....
View 1 Replies
Mar 17, 2011
I'm working on a batch process script that's executed from Flex. The batch script is in a .aspx Page and returns partial results through the following class:
public class ResponseLogger
{
private HttpResponse _response;
public ResponseLogger(HttpResponse response)
[Code].....
In my Flex application I'd like to show the result as soon as it's flushed on server side. Can this be done using Actionscript?
View 1 Replies
Jan 22, 2010
I have a function that returns an array of search results. I have a limit of 7 per page. When they hit 'next' I want to show the next 7 results in the array. How can I do this?
View 8 Replies
Aug 18, 2010
I have a problem that is driving me nuts. I have been googling for the last two days now, but I still haven't found the solution to my problem.
I'm creating a list of courses for an LMS where the data is pulled in from an XML file. All that works perfectly well.
The user should be able to filter the list based on a number of parameters and I have been able to get some of it working (the very simple filters) but other things just wont work.
For example - I am able to filter the results based on the node values that are located directly under the main "course" node. However each of these main course nodes also contain a "sub-node" called "Categories". What I really need is to be able to filter based on the content found in that categories node as well.[code]...
View 0 Replies
Jan 29, 2011
I have a function that when called will display a menu of options that the user can click on. The menu is dynamically generated from the script and each menu item has it's onPress handler setup to call a dynamically generated function that which has access to the index of the menu item (or any other data I choose to pass it).
What I would like to happen is that when a menu item is clicked on, the value is somehow passed back to the function (which built the menu), so that it can return it to it's caller. I've got everything but this last bit functioning.
The approach I've tried is to give the onPress handler access to a field in the class which holds the menu building function. Then when it's clicked on, it can set the field to it's value. Meanwhile, a while loop in the menu function is waiting for the field to change, and will then return the new field value as it's result.
However, this doesn't work and the reason is obvious. Any sort of busy waiting while loop locks up the flash player. Therefore, it ceases to handle events and so the user cannot click on the menu item (or do anything else for that matter).
View 0 Replies
May 31, 2011
I'm new in flash scripting and this is driving me crazy I searched the whole internet and I could not find a solution for this. I'm trying to load XML, parse values into global array, and use that global array later in my code... this is not working.
[Code]...
View 0 Replies
Apr 15, 2010
When I use it with either byteArray or Vector as the input and either as the output, it returns the first few results correctly, then gives me either nonsense values or zeroes. The following shader takes values, returns the second number plus the third for the first value, a zero for the next, and the output coordinates for the last two numbers. The channel size is therefore 4. The length of data is 56 (divisible by 4).here is what I have in the evaluatePixel function:
Code:
dst = sampleNearest(src, outCoord());
dst.r = dst.g + dst.b;
dst.g = 0.0;
[code]....
and then, as you can see, fine again after 47. Changing the length of data to 80 is the same, only after 31, the values remain nonsense instead of eventually correcting themselves.That list is just a trace of input and output.
View 8 Replies
Mar 2, 2005
How can I limit the amount of records in an array to be displayed?Then when you click on a "Next" button go to the next 6?[code]This is a more EXACT explanation of what I need to do which is continued from this thread, which i will delete to not clutter the forums.URL...
View 9 Replies