We Recommend

Essential ActionScript 3.0 Essential ActionScript 3.0
The book focuses on the core language and object-oriented programming, but also adds a deep look at the centerpiece of Flash Player's new API: display programming. Enjoy hundreds of brand new pages covering exciting new language features, such as the DOM-based event architecture, E4X, and namespaces--all brimming with real-world sample code.


Posted By

Roshambo on 06/14/07


Tagged

url parameters params flashvars arguments


Versions (?)


Who likes this?

5 people have marked this snippet as a favorite

copyleft
fukami
gismo
shoffa
Akuma99


Get document's URL arguments and FlashVars (a.k.a. parameters)


Published in: ActionScript 3 


  1. function getParams(documentRoot):Object
  2. {
  3. try {
  4.  
  5. var params:Object = LoaderInfo(documentRoot.loaderInfo).parameters;
  6. var pairs:Object = {};
  7. var key:String;
  8.  
  9. for(key in params) {
  10. pairs.key = String(params.key);
  11. }
  12.  
  13. } catch(e:Error) {
  14. return {};
  15. }
  16.  
  17. return params;
  18. }

Report this snippet 

You need to login to post a comment.