advertisement
Premier Club Log In/Registration
  Include Code  Search Tips
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   SKILLBUILDING  |   TIP BANK  |   SOURCEBANK  |   FORUMS  |   NEWSLETTERS
Browse DevX
Partners & Affiliates
advertisement
advertisement
advertisement
Rate this item | 0 users have rated this item.
Email this articleEmail this article
 
Extending Flash MX 2004, Part 2: Using Classes and Scripts in JSFL
If you're experienced with ActionScript—or even JavaScript—JSFL won't be a stretch. There's just a few idiosyncrasies you need to know about. Find out how to write and execute your own JSFL scripts.  

advertisement
n this article I will discuss the similarities and differences between ActionScript and JSFL. We will also briefly show you how to write your own JSFL scripts and how to execute them. As with ActionScript, JSFL has a set of predefined classes, containing methods and properties:
  • Array
  • Boolean
  • Date
  • Function
  • Math
  • Number
  • Object
  • RegExp
  • String
ActionScript coders will notice one extra class, the RegExp class. No, that isn't a mistake; you can use regular expressions in JSFL!

In JSFL, as in ActionScript, every string is an instance of the String class, every array is an instance of the Array class, every number is an instance of the Number class, etc. Which means that strings, numbers, arrays, booleans, objects, etc., are treated in exactly the same way as they are in ActionScript

All Strings have the usual String methods: 'substr,' 'charAt,' 'indexOf,' etc. All Arrays have the usual Array methods: 'splice,' 'pop,' 'push,' and so on.

So for example, you can write:
myStr="A,B,C,D";
	bits=myStr.split(","); //use a string method
Or:
myStr="abcd";
	myStrLen=myStr.length; //get a string property
In either JSFL or ActionScript the above code snippets produce the same result. For a complete list of each class's available methods and properties refer to the Netscape JavaScript API documentation.

Top-Level Properties and Methods JSFL also contains some top-level functions. These are functions that are not related to any particular object or class and thus can be used anywhere in your scripts, as is.
  • encodeURI
  • decodeURI
  • eval
  • Infinity
  • isNaN
  • Number
  • parseFloat
  • parseInt
  • alert

  Next Page: Writing a JSFL Script
Page 1: IntroductionPage 2: Writing a JSFL Script
advertisement
Advertising Info  |   Member Services  |   Permissions  |   Contact Us  |   Help  |   Feedback  |   Site Map  |   Network Map  |   About


JupiterOnlineMedia

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info


Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Solutions
Whitepapers and eBooks
IBM Whitepaper: Innovative Collaboration to Advance Your Business
Internet.com eBook: Real Life Rails
Avaya Article: Call Control XML - Powerful, Standards-Based Call Control
Tripwire Whitepaper: Seven Practical Steps to Mitigate Virtualization Security Risks
Internet.com eBook: The Pros and Cons of Outsourcing
Go Parallel Article: Scalable Parallelism with Intel(R) Threading Building Blocks
Internet.com eBook: Best Practices for Developing a Web Site
IBM CXO Whitepaper: The 2008 Global CEO Study "The Enterprise of the Future"
Avaya Article: Call Control XML in Action - A CCXML Auto Attendant
Go Parallel Article: James Reinders on the Intel Parallel Studio Beta Program
IBM CXO Whitepaper: Unlocking the DNA of the Adaptable Workforce--The Global Human Capital Study 2008
Adobe Acrobat Connect Pro: Web Conferencing and eLearning Whitepapers
Go Parallel Article: Getting Started with TBB on Windows
HP eBook: Storage Networking , Part 1
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
Webcasts
Go Parallel Video: Intel(R) Threading Building Blocks: A New Method for Threading in C++
HP Video: Is Your Data Center Ready for a Real World Disaster?
Microsoft Partner Portal Video: Microsoft Gold Certified Partners Build Successful Practices
HP On Demand Webcast: Virtualization in Action
Go Parallel Video: Performance and Threading Tools for Game Developers
Rackspace Hosting Center: Customer Videos
Intel vPro Developer Virtual Bootcamp
HP Disaster-Proof Solutions eSeminar
HP On Demand Webcast: Discover the Benefits of Virtualization
MORE WEBCASTS, PODCASTS, AND VIDEOS
Downloads and eKits
Microsoft Download: Silverlight 2 Software Development Kit Beta 2
30-Day Trial: SPAMfighter Exchange Module
Red Gate Download: SQL Toolbelt
Iron Speed Designer Application Generator
Microsoft Download: Silverlight 2 Beta 2 Runtime
MORE DOWNLOADS, EKITS, AND FREE TRIALS
Tutorials and Demos
IBM IT Innovation Article: Green Servers Provide a Competitive Advantage
Microsoft Article: Expression Web 2 for PHP Developers--Simplify Your PHP Applications
Featured Algorithm: Intel Threading Building Blocks - parallel_reduce
MORE TUTORIALS, DEMOS AND STEP-BY-STEP GUIDES