MACROMEDIA FLASH REMOTING MX-USING FLASH REMOTING FOR FLASH MX 2004 ACTIONSCRIPT 2.0 Spezifikationen Seite 29

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 40
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 28
This is the Title of the Book, eMatter Edition
Copyright © 2003 O’Reilly & Associates, Inc. All rights reserved.
Hello World
|
27
Enter the code shown in Example 1-5 and compile the DLL using VS.NET’s Build
Build Solution option, which creates HelloWorld.dll in the following directory:
projectpath/bin/Debug
Copy HelloWorld.dll into the flashservices/bin directory on your .NET web server at:
webroot/flashservices/bin/
The DLL contains a class with one function, sayHello( ), which returns a string. The
service path within Flash is determined by the DLL’s namespace plus the class con-
taining the method being called. By setting the namespace to the same as the direc-
tory structure for our other examples, we will not have to change the
myServicePath
variable within our client-side ActionScript. Using a unique namespace also protects
your DLL from namespace collisions with other DLLs.
Figure 1-6. Visual Studio .NET project setup screen with settings for HelloWorld DLL
Example 1-5. C# code for HelloWorld.cs
using System;
namespace com.oreilly.frdg {
public class HelloWorld {
public String sayHello ( ) {
return "Hello World from ASP.NET DLL";
}
}
}
Seitenansicht 28
1 2 ... 24 25 26 27 28 29 30 31 32 33 34 ... 39 40

Kommentare zu diesen Handbüchern

Keine Kommentare