0 Replies - 3759 Views - Last Post: 05 December 2013 - 10:44 AM

#1 CodeNubee  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 22
  • Joined: 28-March 13

How Do I Use an External MP3 file Without Embedding it? (AS2)

Posted 05 December 2013 - 10:44 AM

I am using Adobe Flash CS6 with ActionScript 2.0.

I have compiled my project, and due the collection of embedded mp3 files (background music) I am using on various locations, my published swf file is over 12MB.

To reduce the size, I placed all the mp3 fiels in the same folder as the swf file and removed all reference to them from the project.

I then added this code to frame #1

import flash.media.Sound; 
import flash.net.URLRequest; 
var CreditsMusic:URLRequest = new URLRequest("NineWalkers.mp3"); 
var s:Sound = new Sound(CreditsMusic);
CreditsMusic.setVolume(50);
CreditsMusic.start(0,1);


I am getting an error that says "The class or interface 'flash.net.URLRequest' could not be loaded."

Obviously, this is not working (I would not be posting here if it was).

What am I doing wrong?

Is This A Good Question/Topic? 0
  • +

Page 1 of 1