
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";
}
}
}
Kommentare zu diesen Handbüchern