PDA

View Full Version : Newbie trying to connect


Lleoun
02-19-2008, 06:12 PM
Hi all,

I'm trying to connect to Flash Media Server 3, but I don't know how. Please help!!
Below is waht I've done so far .. but I don't know if it's correct.

Thanks a million in advance!



myConnection = new NetConnection();





myConnection.connect("rtmp://localhost");




myConnection.onStatus = function(infoObj) {

switch (infoObj.code) {

case "Netconnection.Connect.Success" :

trace("success");

case "NetConnection.Connect.Failed" :

trace("failed");

case "NetConnection.Connect.Rejected" :

trace("rejected");

case "NetConnection.Connect.InvalidApp" :

trace("Invalid App");

case "NetConnection.Connect.Closed" :

trace("Closed");

case "NetConnection.Connect.AppShutDown" :

trace("AppShutDown");

}

};

redeath
02-20-2008, 01:35 AM
Hi Lleoun, I not much of an expert in FMS but i think what u got wrong is the netConnection.connect part.

myConnection=new NetConnection();
myConnection.connect("rtmp://localhost/app_name");

Lleoun
02-20-2008, 10:24 AM
Thanks a lot redeath .. but I'm still so new to this .. I have my fla with the connecting code then I call rtmp://localhost/app_name .. what should it be in app_name? What is what app_name does exactly? Why Flash Player thinks the application is not secure when I publish the connecting code? Where can I configure this?

I guess I'm still totally lost with Flash CS3: actionscript and design can be together in the same fla or should I call an external file containing the actionscript code?? If so, how can it be called?

Many thanks once again!

redeath
02-21-2008, 02:03 AM
Lleoun, you may wan to reference to this site to help u.
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/index.html

It help me a lot looking at the examples they provide, but some u need to becareful as there are some typo and bad examples though.

Anyway app_name is ur application name in ur FMS.

in ur FMS installed folder there is a "applications" folder so in those folder are all ur applications. By default there are 2 folders live and vod. So if u are connecting to live application for instance ur code will be something like this:

myConnection.connect("rtmp://localhost/live");

As for the design of flash, i'm no much of an expert to tell u, I jus started on AS and flash for 1 week only. :P and i'm mainly doing on server-side AS more. But for the only player i written the source contain of a FLA and an AS. In CS3 as long as ur AS has the target set to the FLA then it is link sorry i dun remember how i got it to link.

Lleoun
02-21-2008, 09:16 AM
Thanks very much redeath, it helps a lot !!!

redeath
02-22-2008, 01:59 AM
no problem :D