Internet Commerce

Partners & Affiliates

Developer Channel


Featured Flash FLA
Gallery Downloads 11401 Flash Movies | 5 New Flash Movies Added
What's New | Top 100

Featured FLA

»  Author Miguel Panos
»  Title: Tarta
»  Description: It is a circle graph or pie chart that takes the data entered by user
»  More by Miguel Panos


Random FLAs | Add Flash Movie
Featured Flash Site
Gallery Downloads 4839 Flash Sites | 1 New Flash Links
What's New | Top 100 Flash Site

Featured Site

»  AuthorDeft Creative Ltd
»  Link: Home Page
»  Description: Portfolio site for .DeftCreative Ltd. A UK based web design studio specialising in flash websites, games and interactive CDROMs. With an emphasis on making things different.


Random Links | Add your own Flash Related Links
Flash Tutorials 1484 Tutorials 7 New Tutorials Added!
What's New | Top100

» Making Automatic Training Screen Capture Easily
» Create Undersea Life Animation
» Making Deinterlace Video with a low bitrate Easily
» How To Make A Simple Animation Using Christmas Clips
» Simple Step by step flash game tutorial Spot the diffrence
» How To Make A Moving Text Slide
» Create Flash Banner With Text Float Effect
» How To Make Zoo Photos Slideshow
» How To Make A Dolphin Photos Slideshow
» Unknown Tag: Title10
Random Tutorial | Add Site


Tutorials Home What's New Top Rated Submit myTutes Random!

Search Tutorials


Tutorials Tutorials » Audio

Categories Flash MX Sound Object Tutorial
Author: Kenny Bellew

 
Page 19
«prev ... 8 9 10 11 12 13 14 15 16 17 18 19 20 21 next»

How to Load an External MP3 from a Text Input Box

If you want to be able to type in the file name of an MP3 file into a text box, and press a button to have that file play, the following could be used:

Fig. 18: Example of loading an external MP3 file from a text input box
  1. Create an input text box and give it a variable name like "songInput" (as shown below).
  2. Place a button on stage and put the following code on the button:

    on(press) {
    if (songInput!=nul && playing!=true) {
    playing=true;
    myInputSound = new Sound(myInputSoundMc);
    myInputSound.loadSound(songInput);
    myInputSound.start(myPausePosition,0)
    }
    }

    Fig. 19: Example of input-text box properties, showing variable name location
  3. Place another button on stage for stopping the sound with the following:

    on(press) {
    //Stop Button
    mySound.stop();
    myInputSound.stop();
    playing=false;
    myPausePosition=0;
    }

This is one case in which you have to break the rule of defining all sound objects in the same location. When the button is pressed, the value of "songInput" is inserted during the sound object definition.

«prev ... 8 9 10 11 12 13 14 15 16 17 18 19 20 21 next»

» Level Intermediate

Added: : 2002-08-13
Rating: 9.11 Votes: 663
Hits: 3054
» Author
Kenny Bellew is a technical writer in Minneapolis, MN. He's currently interested in becoming involved in other writing-related Flash projects.
» Download
Download the files used in this tutorial.
Download (6170 kb)
Get conversion and unzipping tools for PC and Mac here!

» Forums
More help? Search our boards for quick answers!

Please rate this tutorial, 10 is the top rating, you can also click the comments link to read/write a review.
10 9 8 7 6 5 4 3 2 1
Read or Post Comments