Ask a Question related to Macromedia Flash, Design and Development.
-
Jatin #1
ActionScript 2.0 class scripts may only define class or interface constructs.
I have the following class with the name "Service.as".
#include "NetServices.as"
class Service
{
var GATEWAY_URL:String =
"http://localhost:7001/flashservices/gateway";
var gatewayConnection:NetConnection;
var client;
function Service(argClient)
{
//establish the remote connection only for the first time
if(gatewayConnection === null)
{
NetServices.setDefaultGatewayUrl(GATEWAY_URL);
gatewayConnection = NetServices.createGatewayConnection();
}
this.client = argClient;
}
function get airFrameServiceDelegate()
{
return gatewayConnection.getService("com.flash.HelloWorld ",
this.client);
}
}
I am trying to instantiate this class from a flash document. I tried
the following
1) myFlashDocument.protoype = new Service();
2) #include "Service.as"
myFlashDocument.protoype = new Service();
3) myFlashDocument = new Service();
i am getting the following errors here. I have pasted the first and
last message.
Total ActionScript Errors: 62 Reported Errors: 62
**Error** D:\Documents and Settings\jatin\Local Settings\Application
Data\Macromedia\Flash MX
2004\en\Configuration\Include\RsDataProviderClass. as: Line 15:
ActionScript 2.0 class scripts may only define class or interface
constructs.
RsDataProviderClass.prototype.init = function()
**Error** D:\Flash\code\Service.as: Line 3: ActionScript 2.0 class
scripts may only define class or interface constructs.
class Service
Can anybody help me out here.
Thanx
~ jatin
Jatin Guest
-
What's the easiest way to..user define class...datagrid..paging..sorting..
I have a large number of user define class objects and want display in a datagrid and able to perform paging and column sorting. It seems using... -
#39403 [NEW]: A class can't implements interface implemented by implemented interface/classes
From: baldurien at bbnwn dot eu Operating system: Irrelevant PHP version: 5.2.0 PHP Bug Type: Feature/Change Request Bug... -
How to Trans transmit my define class with Metthod args in Webservices.
Example: namespace aa { public class myobject { public string Value1 = ""; } } -
Is it possible to put the instance of ASP user define class into the session
This is my user-defined class class ABC public CC end class I make a instance of it and store it at the session set ee=new ABC ee.CC="hi"... -
Define a class using an XML file?
Dear Sirs, I'm looking for a way to define a class using an XML file. Since I'm building a Web Service to be used by several customers I want to... -
Phil #2
Re: ActionScript 2.0 class scripts may only define class or interface constructs.
> **Error** D:\Flash\code\Service.as: Line 3: ActionScript 2.0 class
This problem is probably caused by the fact that you are using> scripts may only define class or interface constructs.
> class Service
in AS2 you should be using:> #include "NetServices.as"
import NetServices;
The following is also illegal in an AS2 file:
but can't really tell you what you should be using as we cant see the> RsDataProviderClass.prototype.init = function()
RsDataProviderClass actionscript.
Hope this helps you on your way.
P.
Phil Guest
-
Hemendra Singh #3
Re: ActionScript 2.0 class scripts may only define class or interface constructs.
Hi,
Use
import Service.as;
instead of
#include "Service.as"
as to instantiate class in Actionscript 2 or MX 2004 this is the
syntax.This should do, for other errors please post your code for the
file where you instantiate the Service class.
Hemendra Singh Shaktawat
Mindfire Solutions
[url]www.mindfiresolutions.com[/url]
[email]japshere@hotmail.com[/email] (Jatin) wrote in message news:<5b79e941.0406010703.1b1a702e@posting.google. com>...> I have the following class with the name "Service.as".
>
> #include "NetServices.as"
> class Service
> {
> var GATEWAY_URL:String =
> "http://localhost:7001/flashservices/gateway";
> var gatewayConnection:NetConnection;
> var client;
>
> function Service(argClient)
> {
> //establish the remote connection only for the first time
> if(gatewayConnection === null)
> {
> NetServices.setDefaultGatewayUrl(GATEWAY_URL);
> gatewayConnection = NetServices.createGatewayConnection();
> }
> this.client = argClient;
> }
>
> function get airFrameServiceDelegate()
> {
> return gatewayConnection.getService("com.flash.HelloWorld ",
> this.client);
> }
> }
>
>
> I am trying to instantiate this class from a flash document. I tried
> the following
>
> 1) myFlashDocument.protoype = new Service();
>
> 2) #include "Service.as"
> myFlashDocument.protoype = new Service();
>
> 3) myFlashDocument = new Service();
>
> i am getting the following errors here. I have pasted the first and
> last message.
>
> Total ActionScript Errors: 62 Reported Errors: 62
>
> **Error** D:\Documents and Settings\jatin\Local Settings\Application
> Data\Macromedia\Flash MX
> 2004\en\Configuration\Include\RsDataProviderClass. as: Line 15:
> ActionScript 2.0 class scripts may only define class or interface
> constructs.
> RsDataProviderClass.prototype.init = function()
>
>
> **Error** D:\Flash\code\Service.as: Line 3: ActionScript 2.0 class
> scripts may only define class or interface constructs.
> class Service
>
> Can anybody help me out here.
>
> Thanx
> ~ jatinHemendra Singh Guest



Reply With Quote

