|
|||
|
Hi this is Syeef....
i have a problem with AS3 and SWFKitpro..... First of all, is AS3 supported by SWFKitpro, if not sorry for this post ! I made a MP3 Player with SWFKitpro and Flash 8 and it works great. Now as spectrum analyzer is available with Flash 9 AS3, i downloaded the new beta Flash 9 software from adobe ( FLASH 9 preview AS3 public alpha ) and made a spectrum analyzer for my MP3 Player. it too works file. ( as a swf format ) But now i cannot make SWFkitpro to open the dialogbox so that i can open a MP3 file and play it in the exe format. The codes that i used before while i was using Flash 8 for opening the dialogbox was like this: ( AS2 ) import SWFKit.*; Open.onPress = function() { PL = Dialogs.fileOpen("MP3 Files(*.mp3)|*.MP3", "", "", false); if (PL !== false) { my_sound.loadSound(PL, false); my_sound.play() } } Now my new AS3 codes of Flash 9 are like these : ( But i did try Flash 8 codes first, ....it didn't work ) import SWFKit.*; addEventListener ( 'mouseDown', OPEN) function OPEN(event:Event) { PL = Dialogs.fileOpen("MP3 Files(*.mp3)|*.MP3", "", "", false); if (PL !== false) { my_sound.load(new URLRequest(PL)); my_sound.play() } } oh yes..... i just found out it doesn't even play songs............ then again, how come SWFkitpro says it supports Flash 9 !! Please help me out !! - Syeef. |
|
|||
|
There are some small differences between actionscript2 and actionscript3 wrapper classes. The main difference is that actionscript3 classes have no static methods, so your code should be:
Code:
var d = new Dialogs;
PL = d.fileOpen("MP3 Files(*.mp3)|*.MP3", "", "", false);
if (PL !== false) {
...
}
d.Release();
|
|
|||
|
I'm sorry, i did couldn't figure it out....
and i got a bigger problem now, i'm unable to play mp3 songs with the following AS3 : var snd = new Sound(); snd.load(new URLRequest("song.mp3")); snd.play(); it works fine with flash player 9 but swfkit is not responding. please can i see an example of mp3 playback with flash 9 AS3 and swfkit, and if possible please include a dialog box to open the songs. thanking you, - syeef. |
|
|||
|
1. you must add the wrapper classes to the actionscript 3 classpath, the typical path of the wrapper classes is
C:\Program Files\SWFKit Pro 3\Classes 3\SWFKit 2. call the wrapper classes in actionscript 3 Code:
import SWFKit.*;
function onClick(obj)
{
var dlg = new Dialogs();
var filename = dlg.fileOpen("MP3 files(*.mp3)|*.mp3|", "mp3");
if (filename)
{
var snd = new Sound();
snd.load(new URLRequest(filename));
snd.play();
}
dlg.Release();
}
btn.addEventListener("click", onClick);
|
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|