SunQuest
 
       Flash
  Home arrow Flash arrow Page 4 - Basic Flash ActionScript for Designers
IBM developerWorks
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Dedicated Servers  
Actuate Whitepapers 
VeriSign Whitepapers 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
FLASH

Basic Flash ActionScript for Designers
By: Adi Reddy Mora
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 109
    2005-06-01

    Table of Contents:
  • Basic Flash ActionScript for Designers
  • Buttons, Movie Clips, and Making them Draggable
  • Navigating, URLs, and Loading Images
  • Loading External MP3 Files

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
    Iron Speed
     
    ADVERTISEMENT

    At the virtual BlackBerry Technical Seminar 2008, you can ask your development questions directly of Research In Motion® (RIM) experts, and take advantage of learning opportunities designed uniquely for BlackBerry solution developers. Register Today!

    Basic Flash ActionScript for Designers - Loading External MP3 Files


    (Page 4 of 4 )

    As far as audio files, Flash player supports only the MP3 file format. To load MP3 files at runtime, you need to use the loadSound() method of the Sound class. First, you need to create a Sound object, as shown in the following sample where "song1" is the instance of the sound object:

    var song1:Sound = new Sound();

    Then you need to use the loadSound() method of the sound object to load an event or a streaming sound. Event sounds are loaded completely before being played; streaming sounds play as they are downloaded. The isStreaming parameter of loadSound() can specify a sound as an event sound or a streaming sound.

    After you load an event sound, you must call the start() method of the Sound class to make the sound play. Streaming sounds begin playing automatically, so you don't need start().

    song1.loadSound("lastchristmas_wham.mp3", false);song1.start();

    In the above sample, the first parameter is the mp3 file path and the send parameter is the isStreaming value, either true or false.

    I recommended setting the isStreaming parameter to true, especially when you are loading large sound files so that the file starts playing as soon as possible.

    To determine when a sound has completely downloaded, use the Sound.onLoad event handler. This event handler automatically receives a boolean value that indicates whether the file downloaded successfully.

    song1.onLoad = function(success){
    };

    “Success” is the parameter which returns either true or false.

    This article has covered most of the basics for adding interactivity to Flash movies for designers who don’t have any previous ActionScript knowledge. However there are a lot more features available for designers to learn, given enough ambition and patience.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · Sir my name is "GagandeepCheema", Since few days I am trying to get forward with...
     

    FLASH ARTICLES

    - Using XML and ActionScript with Flex Applica...
    - Interfaces and Events with ActionScript and ...
    - Manipulating Data with ActionScript in Flex ...
    - ActionScript Syntax for Flex Applications
    - ActionScript in Flex Applications
    - A Closer Look at Apollo`s File System API
    - Using the File System API
    - ActionScript 101
    - Flash Buttons
    - Advanced Flash Animation
    - Creating Your First Animated Movie with Flas...
    - Flash: Building Blocks
    - Building Preloaders
    - Fun Things to Do with Movie Clips in Flash MX
    - Referencing Movie Clips in Flash MX


    Iron Speed





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway