Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-26-2007, 11:02 AM
Junior Member
 
Join Date: Jan 2007
Posts: 6
Default Flash 9... AS3 error !!

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.
Reply With Quote
  #2 (permalink)  
Old 01-27-2007, 11:47 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Flash 9... AS3 error !!

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();
Reply With Quote
  #3 (permalink)  
Old 01-27-2007, 09:46 PM
Junior Member
 
Join Date: Jan 2007
Posts: 6
Default Re:Flash 9... AS3 error !!

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.
Reply With Quote
  #4 (permalink)  
Old 01-30-2007, 06:13 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Flash 9... AS3 error !!

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);
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 04:05 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.