ActionScript 3.0 :: Use To Identify Bottlenecks In The Code?
Sep 23, 2009I'm writing a graphics-intensive game in Flash CS3 / ActionScript 3. Is there any code profiler I can use to identify bottlenecks in the code?
View 4 RepliesI'm writing a graphics-intensive game in Flash CS3 / ActionScript 3. Is there any code profiler I can use to identify bottlenecks in the code?
View 4 RepliesMy Flex web application is almost ready for launch. I'm currently optimizing as much as I can in order to make sure even low-end clients are able to run it fluently. The problem is, I have no idea where to optimize more than I've already optimized. My question is, what are the usuals suspects regarding bottlenecks? What tips and experiences do you have when it comes to Optimizing a Flex app?
View 4 RepliesI'm working with Flashpunk to make games using Flex and FlashDevelop (highly recommended, amazing lib and IDE). Since performance varies so much from system to system, I want to find where slowdowns are occurring and only fix those bits. Flashdevelop has a built in tool called Profiler, but it only shows the number of objects and the memory they are using, not the execution time. Grant Skinner wrote a great tool called PerformanceTest, but it seems suited to writing very specific optimization comparisons, not automatically profiling your code.
What I'm trying to find is a tool that will automatically analyze the program while it's running and tell me which functions are taking the longest to execute. I've heard that CS5 has this built in, but I'm wondering if there are any alternatives.
Therefore, my concepts is I have webcam. My webcam is able to catch a image. Whereby, the flash will calculate the overall of the color. And it will resize and place it to the nearest color of the main background color.
View 2 RepliesI'm retrieving variables from a DB via PHP via the URLRequest, and the formatting is set to variables (URLLoaderDataFormat.VARIABLES) and matches the structure "myVarName=myValue&myOtherVarName=myOtherValue&... ".
My question is; is there a way, within Flash, to identify the variables and their values, without having to know their names?, are there methods within the loader class that allow this?, such as the variables count etc?
(I can access the variable "copyrightTxt." via the syntax: loader.data.copyrightTxt because I know its name, but I'd like something like
loader.data.variableSent[45].name = "copyrightTxt"
and
loader.data.variableSent[45].value = "@ 2009"
and
loader.data.variableCount = 98
I have the following:
function ShowSlide(event:TweenEvent) {
m= getChildByName("tag"+slideIndex+"_mc");
m.visible = false;
if (slideIndex < 4) {
slideIndex++;
[Code] ....
And I want to do for "tagInitW" the same thing I do for "m" being given that I already have "created tag1InitW", "tag1InitH", "tag2InitW", "tag2InitH..." So is there anyway I can dynamically target a variable? This was easy in AS2, but because of the strict dataType the vars have in AS3, I can't do it like I was doing it in AS2.
in ActionScript 3, if I loop through the children of a movie clip, it will return a DisplayObjectContainer, which is a list of DisplayObjects. However, the AS3 typeof cannot identify MovieClip as MovieClip is now an object, instead of a data type. How can I correctly identify MovieClip?I found 3 solutions online: First set the MovieClip name to a specific name, then in the iterate process, check the name of children using child.name.indexOf("specificName") > -1
Solution 2:use child.hasOwnProperty("numChildren") to identify a MovieClip
Solution 3: use 3rd party plug-in like FlashDevelop
I am creating a lot of dynamic flex components like RadioButton, Combo Box, CheckBox.
[Code]....
When i click on Submit finally i need to get all the selected Values in each question. All the components are dynamically created at runtime.
How do we identify the user's web browser in flex ? Based on the browser I have to display some text in my flex application.
View 3 RepliesBasically, I'm making a very simple turn based battle game using ActionScript 2.0. I'm VERY new to code, with only very limited Visual Basic knowledge, so I'll happily admit I don't really know what I'm doing. I've got a start, but I decided to rewrite the entire thing because I wouldn't be able to cycle enemies and levels easily.I've spawned the same enemy twice using _root.attachMovie, and identified them as Enemy1 and Enemy2. After spawning them, I tried to make them identify themselves with:
_root.Enemy1.identify = "Enemy1"
_root.Enemy1.identify = "Enemy1"
Using the debugger, this apparently works (within the movieclip, they have a variable called identify which correctly labels them), yet when I try to use an if statement so I can put them in their own individual positions, it simply does not work; it skims straight over. The code I have within the movie clips is:
if (identify == "Enemy1") {
function poschange() {
[code]....
The poschange functions works fine for the player characters, it's just this if statement to identify which enemy it is apparently fails. So my question is: is there any easier way for a movie clip to identify its own ID so I don't have to use this method, or is there just something wrong with my code?
How can I get to know that the device is iphone or ipad using actionscript3.0?
View 1 RepliesI have three buttons on stage (type button) How can i identify wich button i have clicked.
[Code]...
We'll call it "song" for the sake of example...song has the attributes artist, title, album. upon makign all the objects, i put them in an array.[code]...
whether i want to find one object that has a unique attribute (like "london bridge", maybe) or multiple objects that might have the same attribute (like an artist or album), is there a more efficient way?
I am developing a Flash application which should initially (before launching the main application) identify the internet bandwidth available on users system and display low or high bandwidth content accordingly.If the user has dialup concetion then I need to display only images else if it is broadband concetion then I need to display swf's along with the audio.
View 1 RepliesFurther to my earlier posts about identifying and manipulating clips and subclips created in a for loop, I'm sure I'm still not using the best methods of identifying any given clip or it's nested subclip. The following works, but I understand that naming clips and using getChildByName are not best practice.
However it seems to me that using getChildAt could be cumbersome to keep track of, particularly if clips were to be added, removed or swapped during the course of the program.
I expected that clipArray[2].weeBox would have been sufficient to target that subClip in the object referenced in the third slot in that array, but that's clearly not the case. Is this it, or is there a better approach?
[Code]...
i saw that my app after some time, it becomes slow.. so i guess i have a memory leak? How could i be sure about that and track it down?
View 2 Repliesfor (var i:int = 1; i <= 8; i++) {
this["b" + i].visible=true
}
I am wondering whether I can set all b1,...b8 movieclip to visible except b7?should I identify each movieclip to visible each or a script can be written in 1 line?
I have an app that uses several Loader objects to load extenral swf files. Things go well except for one point. I have a quiz element that's loaded through a loader named 'quiz'. When the quiz is done, I remove the quiz element with removeChild(quiz). The quiz disappears from the screen every time except for one question. I can't identify what's going on differently for that question. I've debugged this and can see that my quiz object is set to null, but I can plainly see the quiz still onscreen.
To further confuse me, I use the same loader object multiple times through the app, and just add it and remove it from the display list with addChild and removeChild. When my one problem question comes up and fails to go away, the app continues to the next question, and I can see that there are now 2 quiz objects stacked on top of each other. I have no idea how this can happen when I'm using the same loader object for all the questions.
[Code]...
I'm trying to make a vote/poll application in Flash using Actionscript 3. Is there any way to generate a specific ID that is unique to each user? The only other option I can think of is using the IP address, which is less than ideal in many cases (college campuses, shared Internet access, etc.). It needs to be the same number every time it is run on the same PC, but different for each user.
View 1 RepliesI have tilelist, which is dynamically loaded XML file with pictures,How do I do that would be when you click on a picture in the Label gave her name?
<mx:TileList id="tileList"
alternatingItemColors="[#FFFFFF,#EEEEEE]"
dataProvider="{xmlListColl}"
[code]......
I am trying to retrieve mysql data using php(products.php) and return the data in xml format to ADobe flash as3; but i am getting following error.[url]...
I have WAMP installed; which works fine as i have many other php projects working here.[code]...
As in Java I want to know if my reference is declared as Interface.
function foo(classRef:Class){
if(classRef.isInterface(){
//something
[code].....
I have written a script where a MovieClip instance is created at the mouse cursor position. It creates the instance and everything is fine.
ActionScript Code:
function createMarker(event:MouseEvent)
{
var newMarker:marker_mc = new marker_mc();
[Code]....
But I would like to drag and drop those markers after creation. Also identify them. Because currently the have all the same name. Is there a way to give them an dynamic id?
In my case I have 6 movieclips and 6 corresponding text fields (all 12 objects are on the main timeline) and the movieclips are named thumb1_mc, thumb2_mc, etcetc, and the text fields are named text1, text2, etcetc.I have a method:mcl_mcl.onLoadProgress = function (targetMC, loadedBytes, totalBytes)in which I need to change the appropriate text file's text depending on which movieclip is targetMC.The trouble is I can't find a way to distinguish which mc it is, so I can't pick which text file to change.I tried using properties but that doesnt work because everything about the movieclip gets obliterated the moment I load something into them.
View 4 RepliesHow I should get started to achieve two things. I am creating a map with places and routes between those places.
Objective 1: When a visitor hovers over a place name, I want a tooltip to show, which they can select to be taken to another html page to display information on that place.
Objective 2: When a visitor hovers over a line or path connecting two places, a tooltip shows to identify that route, and again when the tooltip is clicked, the visitor is taken to the route details html page for further information. I want the tooltip to show up anywhere along the path which is hovered over.
I want to know, how I should start to design this and what elements will be required to achieve this, especially the tool tips. And how easy is it to make a path highlight, like a button, when hovered over, can a path have different states?
Here is a image done in Fireworks of my objectives.
I've coded a 2000 line game on one actions layer (facepalm*) and I just recently learned about the GC (garbage collector). I've looked around a bit and can't, how to trace the source of it. There is an interesting article that mentioned event listeners and for every addEventListener there should be a removeEventListener. My game has 60 adds and only 15. What I can't make sense is that the mc's that have the event listeners are never removed, but just moved off of the stage. Others are just made invisible. So if the event listener is added once, why would the memory keep growing? (I'm using the Windows Task Manager to monitor this). Another point was to remove objects so that the GC can do its work. What I did was create an object, add it to an array then null it.
_object1 = new _barrel();
_object1.x = objectPosition;
_object1.y = _defaultFloorBoundary.y;
instanceArray[objectNumber] = _object1;
_object1 = null;
Then removed the object from the array.
for ( var ii:int = 0; ii<instanceArray.length - 1; ii++ ) {
stage.removeChild(instanceArray[ii]);
delete(instanceArray[ii]);
instanceArray[ii] = null;
}
I'm using BlazeDS to send messages in Flex. Inside the UI component, I defined a producer like the one below:
<mx:Producer id="producer"
destination="chat"
fault="faultHandler(event);"/>
I was wondering inside faultHandler how I'm able to identify what message causes the error. As it seems there's no way to get the reference to the original message.This is the code snippet how the message is constructed and sent.
private function sendMessage():void {
var message:AsyncMessage = new AsyncMessage();
message.body = userName.text + ": " + input.text;
[code]....
I have a flash movie that loads pdf files in a new browser window when a button is selected. As some of the files are quite large I need to keep the attention of the user while it is loading and to this end I thought a progress bar would be suitable. My problem however is that I do not know if it is possible to identify from flash when the document has loaded. Are there any methods in ActionScript to achieve this?
View 3 RepliesI'm a designer, not really a programmer, but I've been asked to research this and hope you ppl can help me out.
We have a series of Flash banners that will be hosted on various sites and when clicked, we want to somehow id in the URL which site it came from, so they get credit for the click.
we can't produce dozens of versions of the same movie so is there a way to do this more dynamically? like append the end of the url somehow?
I have a page with multiple flash objects which are written by a third party and thus can't be changed. They call a JS function but don't seem to pass any identifying parameters. Is there any way to determine inside the function which flash object called it?
View 2 Replies