Normally when you run your application through a browser like Firefox you don't get to see Trace output like you would when previewing the app through the Flash Authoring Tool.
Solution
Someone built a firefox plugin to show Flash trace output. Go to the below link and install it in Firefox, it works perfectly.
http://www.sephiroth.it/firefox/flashtracer/
When you develop applications inside the Flash IDE you can see all the trace output inside Trace panel of IDE. However, there are lots of cases when you need to test your applications in browser and not as a standalone application. This makes impossible reading trace output and makes debugging your applications hard.
Solution
To see trace output outside the Flash IDE you need external application. In this article we will use applications called Vizzy.
What if you are creating an application that compile size matters and you want to use JSON strings to get data into your application. JSON stands for JavaScript object notation, it is a more condense data format then XML and is able to define different types of data not just Strings. You can use the Adobe Core Lib classes to parse this information but these classes add a little extra weight to your application and in some apps this isn't ok but there is another way.
Solution
Because JSON is just a subset of JavaScript objects ExternalInterface can just send these objects as Strings to JavaScript within your browser and the JavaScript interpreter will send an ActionScript Object back to you with the correct types. I have also noticed that this information is parsed faster and more reliably then the standard version but remember that this is only helps you with decoding. If you would like to create a JSON string from an Object you will have to use something else.
When you develop applications inside the Flash IDE you can see all the trace output inside Trace panel of IDE. However, there are lots of cases when you need to test your applications in browser and not as a standalone application. This makes impossible reading trace output and makes debugging your applications hard.
Solution
To see trace output outside the Flash IDE you need external application. In this article we will use applications called Vizzy.
What if you are creating an application that compile size matters and you want to use JSON strings to get data into your application. JSON stands for JavaScript object notation, it is a more condense data format then XML and is able to define different types of data not just Strings. You can use the Adobe Core Lib classes to parse this information but these classes add a little extra weight to your application and in some apps this isn't ok but there is another way.
Solution
Because JSON is just a subset of JavaScript objects ExternalInterface can just send these objects as Strings to JavaScript within your browser and the JavaScript interpreter will send an ActionScript Object back to you with the correct types. I have also noticed that this information is parsed faster and more reliably then the standard version but remember that this is only helps you with decoding. If you would like to create a JSON string from an Object you will have to use something else.
Normally when you run your application through a browser like Firefox you don't get to see Trace output like you would when previewing the app through the Flash Authoring Tool.
Solution
Someone built a firefox plugin to show Flash trace output. Go to the below link and install it in Firefox, it works perfectly.
http://www.sephiroth.it/firefox/flashtracer/
If you have two ActionScript Arrays and you want to merge them together into one Array containing the contents of both of them the first thing that comes to peoples mind on how to do this is they loop over all of the items in one of the Arrays and push the items into the other Array.
Solution
Looping over all of the items is not very elegant. By using the built in apply method that is on every Function in ActionScript you can do the same thing with out the need to loop over anything. The apply method takes two arguments, the scope which we can pass null and an Array of arguments that is going to be injected into your method. In this case we want to use the push method on Array.
This site is produced in partnership with
O'Reilly.