Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Can't Find New AS2 Remoting Classes



Hi,

I've installed the new AS2 remoting components, and am creating an application using the new Service object. In the documentation, it says to import the classes, and create the Service object as follows:


Code:
import mx.remoting.Service;
import mx.remoting.PendingCall;
import mx.rpc.RelayResponder;
import mx.rpc.ResultEvent;
import mx.rpc.FaultEvent;

var dates:Service = new Service("http://localhost/flashservices/gateway", null, "myfile", null, null);
var pc:PendingCall = dates.getMonthEvents(9, 2004);
pc.responder = new RelayResponder(this, "getMonthEvents_Result", "getMonthEvents_Fault" );

function getMonthEvents_Result(rs) {
trace(rs);
}
function getMonthEvents_Fault(rs) {
trace(rs);
}
I've done it exactly as the documentation says, but everytime I try to compile it says it can't find the classes. I've also looked in the mx.remoting folder, and there is no files there, just the debug package.

Is there something that I'm missing here? I've done apps before with AS1 components, but this update is turning out to be not entirely straight forward.

thanks,
Marcus.



ActionScript.org Forums > Supporting Technologies > Flash Remoting
Posted on: 09-06-2004, 08:24 AM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Suggest A Good Tutorial For CFMX And Flash Remoting Using Remoting Component Classes?
Does anyone know of a good tutorial that will take me through the v2.0 way of utilizing remoting through the Flash Pro remoting component classes (or the RemotingConnector component - either/or)? It seems like the docs are inconsistent in their variable naming from one section to another so its hard to tell what each object placeholders and properties correlate through out the process in their descriptions and examples.

Im thinking a tutorial is more geared to learning this new style than the docs are at this point . . . .

Unable To Load Remoting Classes After Installing AS2 Remoting Components
hi, I have a problem, after i've installed the AS2 Remoting components, I ran a syntax check on the code below and got these messages =>
**Error** C:Inetpubwwwrootgraciousimageservicescms.as: Line 16: The class 'mx.remoting.Service' could not be loaded.
service = new Service("http://localhost/gi/gateway.php", null, "user", null, new RelayResponder(this, "onLoginResult", "onLoginFault"));

**Error** C:Inetpubwwwrootgraciousimageservicescms.as: Line 19: The class 'mx.rpc.ResultEvent' could not be loaded.
function onLoginResult(res:ResultEvent){

**Error** C:Inetpubwwwrootgraciousimageservicescms.as: Line 22: The class 'mx.rpc.FaultEvent' could not be loaded.
function onLoginFault(fault:FaultEvent){

**Error** C:Inetpubwwwrootgraciousimageservicescms.as: Line 25: The class 'mx.remoting.Service' could not be loaded.
}

**Error** C:Inetpubwwwrootgraciousimageservicescms.as: Line 16: There is no method with the name 'Service'.
service = new Service("http://localhost/gi/gateway.php", null, "user", null, new RelayResponder(this, "onLoginResult", "onLoginFault"));

**Error** C:Inetpubwwwrootgraciousimageservicescms.as: Line 25: The class 'mx.rpc.RelayResponder' could not be loaded.
}

**Error** C:Inetpubwwwrootgraciousimageservicescms.as: Line 16: There is no method with the name 'RelayResponder'.
service = new Service("http://localhost/gi/gateway.php", null, "user", null, new RelayResponder(this, "onLoginResult", "onLoginFault"));
code:
import mx.remoting.Service;
import mx.rpc.RelayResponder;
import mx.rpc.ResultEvent;
import mx.rpc.FaultEvent;

class cms extends GForm{
private var service;
function cms(){
//start debugger
mx.remoting.debug.NetDebug.initialize();
}
function initUI():Void{
childForms.loginForm.addEventListener("login", this);
}
function login(evtObj:Object){
service = new Service("http://localhost/gi/gateway.php", null, "user", null, new RelayResponder(this, "onLoginResult", "onLoginFault"));
service.verifyUser(evtObj.credentials.UID, evtObj.credentials.Password);
}
function onLoginResult(res:ResultEvent){
trace(res.Name+" "+res.accessLevel);
}
function onLoginFault(fault:FaultEvent){
trace(fault.fault.faultString);
}
}
Basically, I cannot import any of the remoting classes, i looked into the First Run/Classes folder and was unable to locate any of the remoting classes except for the Debug package

The remoting functions work fine with Remoting Version1 but I need to use the forms functionality and I have no idea how to include the version1 remoting scripts into the classes

I've uninstalled the Remoting Components as well as Flash and reinstalled them but the problem persists!!

Can't Find Flash Remoting Components
I just stumbled across flash remoting last week and must say I could of used it already in a ton of different applications I've been working on.
But My problem is that I can't find the Components anywhere. I went to http://www.macromedia.com/software/f...ds/components/ and there links have been broken since then.

What I'm trying to do is run Flash and PHP with amfphp I know my server is set up correctly with php but when I try to run a sample flash I get errors saying that it can't find my included files. NetDebug.as and NetServices.as
If anyone can help me with this It would be greatly appreciated As I really want to start utilizing the incredible potential of flash remoting with php .
Thanks.
Mike

Trouble Loading AS 20 Remoting Classes
I am having trouble loading the remoting classes in Flash MX Pro 2004. This is the code i am using

[code]
import mx.remoting.Service;
import mx.remoting.PendingCall;
import mx.rpc.RelayResponder;
import mx.rpc.FaultEvent;
import mx.rpc.ResultEvent;

var dataService:Service = new Service("http://localhost/ZenGarden/gateway.aspx", null, "FlashRemoting.ZenGarden", null, null );

var pendingCall:PendingCall = dataService.Test();

pendingCall.responder = RelayResponder(this, "onString" "onFault");

function onString(resultEvent:ResultEvent):Void
{
trace(resultEvent.result);
}

function onFault()
{
}[/cod

heres the errors i get:

**Error** Screen=form1, layer=Layer 1, frame=1:Line 7: The class 'mx.remoting.Service' could not be loaded.
var dataService:Service = new Service("http://localhost/ZenGarden/gateway.aspx", null, "FlashRemoting.ZenGarden", null, null );

**Error** Screen=form1, layer=Layer 1, frame=1:Line 9: The class 'mx.remoting.PendingCall' could not be loaded.
var pendingCall:PendingCall = dataService.Test();

**Error** Screen=form1, layer=Layer 1, frame=1:Line 11: The class 'mx.rpc.RelayResponder' could not be loaded.
pendingCall.responder = RelayResponder(this, "onString" "onFault");


Flash remoting is installed right, but it seems as though the classes are not being found. TIA for any help you can offer.

Where To Find Classes?
So i'm finally confident enough with my AS 3 skills to start deploying pre-written class files. What's a good source to look for people who provide public class files for re use?

Cant Find Classpath Of Downloaded Classes
I've downloaded some classes for the papervision 3D interface and can't seem to get Flash to see them in my fla project. I've followed the instructions on the papervision wiki to the letter but the error browser showed a some sort of conflicting definition message. I spent all day doing this and no classes to be found!

Where Can I Find Source Code For Built-in Classes?
For example, the StyleSheet class. I wish to fix overload one of it's functions to fix a small bug, but don't wish to write the function from scratch.

Any idea?

Flash Remoting Weird Issue / I'm New To Remoting
Hello All, I'm new to remoting and I'm having some issues. I started with the Macromedia Tutorial and called HelloWorld.cfc and everything was great. So I started a project and I've got logging in and creating a new user working great but now i'm trying to save some data and i can't get it to work. Basically, if you log in, you are not able to use the 'addscore' function. No errors get returned, but no results get returned either. If you skip the log in, you can add your score just fine. So my question is, do i have to 'reset' something or why won't one function work after a different one has been called?

I know this may be confusing, so as may questions as you need. I really appreciate any help.

[F8 & Remoting] Simple Question Dealing With Remoting
Ok I'll post my code and explain, this is using flash remoting and amfphp

main.fla / main.swf

Code:
// ==============================
// SETUP
// ==============================
var rootId:Number = 0;
var itemArrayCall:itemsClass = new itemsClass();
trace (itemArrayCall.getItemsList(rootId));
stop();
itemsClass.as

Code:
// ==============================
// IMPORTS
// ==============================
import mx.remoting.*;
import mx.rpc.*;
import mx.utils.Delegate;
import mx.remoting.debug.NetDebug;
// ==============================
// CLASS CONSTRUCTOR
// ==============================
class itemsClass {
// Gateway
private var gatewayUrl:String = "http://xfuzion.local/%7Exfuzion/finalproject/flashservices/amfphp/gateway.php";
// Service
private var service:Service;
// == SETUP FUNCTION
function itemsClass() {
NetDebug.initialize();
this.service = new Service(this.gatewayUrl, null, "itemsClass");
}
// == getItemsList FUNCTION
function getItemsList(rootId) {
var pc:PendingCall = service.getItemsList(rootId);
pc.responder = new RelayResponder(this, "handleGetItemsList", "handleRemotingError");
return "It will return these values but will not initialize the net debugger AT all or anything";
}
// == RESULT HANDLER FUNCTION
function handleGetItemsList(re:ResultEvent) {
return "it worked";
}
// == ERROR HANDLER FUNCTION
function handleRemotingError(fault:FaultEvent):Void {
NetDebug.trace({level:"None", message:"Error: "+fault.fault.faultstring});
}
}
My problem is the fact the class works, everything works inside of it EXCEPT the remoting. It wont even initialize or run the NetDebug and it's bugging me because I have no way to debug this because of it.

Any help on why it isn't transfering or whatever would be very useful.

I get NO output errors at all, so all the MX components are on the stage correctly and amfphp is set up perfectly fine ( this whole thing works fine if I use it inline rather than class ).

Thanks!

No Remoting Template After Installing Remoting
I installed Remoting for Flash yesterday and am a Certified Dummy in this area. I have only had ColdFusion installed for a few days now and in study using Ben Forta & Raymond Camden's Macromedia book "ColdFusion MX7 - Web Application Construction Kit, chapter 26 addresses Flash Remoting using Flash MX 2004. I have Flash 8 (and all of Studio 8). I downloaded and installed Flash Remoting and it showed up on my "Add-Remove Software" as a separate program, successfully installed. The book tells me to start Flash and choose File>New from Template and select Remoting. It is not there and I don't know how to generate it. I am sure this is a simple step for many of you.
Would you please help me? I have made it to chapter 26 in this book and made most of the coldfusion pages work so far, but I can't get past this without Flash Remoting.
Thanks ahead of time,
Mike

Custom Classes: One Class Tracks Multiple Other Classes?
I'm working on a coloring that allows kids to place objects on a scene and then color them so the image can be printed out. So assume you have sky background, the child can select a bird object, drag it into place and once they have it in place, color everything on the page (with a given palette of colors.)

So far it going great. However I want to track what objects have been added to the drawing on the fly. I have a potential solution using arrays but I'm thinking this is perfect opportunity to start using custom classes.

I'm thinking that I'd create a new instantiate a copy of the object class each time an object is added to the scene. However to track the objects added to the scene I'm thinking I'll also use an listing class to track them.

What I'm not sure about is the would the listing class simply contain an array of object identifiers? Any thoughts on the structure of the listing class?

I'm very new to oop as I've mainly been doing procedural programming up to this point but I'm eager to give this a shot.

Thanks!

Using Flex Classes In Classes Linked To Symbols
Hi all

I have a fla file where I link a symbol to an action script class. This action script classes references mx.collections.ArrayCollection; so when I attempt to publish the fla file, I get the error message:
1017: The definition of base class ArrayCollection was not found.

I then tried to add a class path (this folder contains the mx... classes):
C:Program FilesAdobeFlex Builder 3sdks3.0.0frameworksprojectsframeworksrc

and the the above error 1017 wasresolved, but now I get the error:

Version.as, line 18 1004: Namespace was not found or is not a compile-time constant.

So now I am pretty much stuck. What do I need to do for this to work ? Please note that the code compiles fine in flex, so it is not som basic coding error ?

My 'find' Won't Find Empty Lines And } Now
on 750 buttons I'm trying to go from:
{
Sound01

}

}
}

to:
{Sound01}

by deleting the empty lines and these } using find & replace - and when I hit replace all - it says none found, even though I copy directly from button code...

Is possible this happened by earlier having copied code from AS window - pasting it onto main stage to hold it while busy doing something else - then later double-clicking it and copying it into the find/replace window - which strangely puts little squares in wherever there was a carriage return??? Help please.

Instantiating Classes Inside Classes
I have a class called spaceship in which i have instanciated another class weapon. However, when i call on a method of weapon (which at this point is just simply trying to trace "hello"), it doenst work and the object basically doenst exist. It's delcared in the class as:

Code:
private var ShipWeapon:weapon;
Note that when I instantiate a weapon class on the main timeline the thing works and "hello" is printed to the output panel. However, nothing at all happens when instantiated the weapon class inside my spaceship class. Both traces come up "undefined". Do i need to declare the class as some sore of special class or somethings? Thanks in advance

[classes] Best Method To Communicate Between Classes
Here's the scenerio:

I have a component that is associated with a class. Inside the component is an empty movieclip.

-component (part of a class)
  -mc

The main component's class upon init will load a movie from a remote server into the mc movieclip. System.security.allowDomain is in there...

Now, inside the swf that gets loaded into the mc is an empty movieclip that's associated with it's own class:

-component (part of a class)
  -mc (contains loaded movie)
    -mc (part of a separate class)


Now here's the challenge... I need to have the loaded movie > mc's class be able to communicate with the main component's class.

What's the best setup to be able to communicate between the two classes directly? That is, if I don't have loaded movie > mc > class inherit from the component's class.

thanks in advance...

Nathan

Best Flash Classes (Taught Classes)
I think this site is great for newbies in the flash world to Advanced flash developers. I am an intermediate flash designer/developer and I have been using flash since 1998. My strengths are more on the design side for sure. I am just curious what your experience is with going to a week long flash class. I have been to several classes and my last one was a week long one with Joshua Davis on advanced actionscript in NYC a while back. This was still coding in AS1 with dot syntax so only some of it is relevant to what we are doing today. I am wondering what are the best classes out there today and what your experiences are if you have been to any. I wish another event like this: grant skinners FITC flash 8 workshop or this Colin Moocks actionscript bootcamp were available but I can't find anything like it. My friend went to Colin's workshop a while back and mentioned how he went into design patterns with AS2 and it would be great to learn about that. ANyhow any suggestions would be great. Post your thoughts.

Instantiating Classes Inside Classes
I have a class called spaceship in which i have instanciated another class weapon. However, when i call on a method of weapon (which at this point is just simply trying to trace "hello"), it doenst work. The compiler obviously didn't flag anything, but i also get "undefined" for all my weapon class varibles. Do i need to declare the class as some sore of special class or somethings? Thanks in advance

Accessing Classes From Classes
ok something I don't get. In as2 I used to have a main class, which I created an instance of my Useful.as Class in. And then when I created say a monster instance from my monster class, I used to pass it a reference to the main class, so I could access the Useful instance from a function in my monster class like this


Code:
main.Useful.RandomNumber(1,100);


But this doesn't seem to work in as3

It just gives me a reference error, even though when you look with debug mode the Useful instance is sitting there in the main class, and there is also a reference inside my monster instance to the main class. I found that if a pass a direct reference to the Useful instance to the monsters constructor, and setup a var called Useful inside my monster instance then I can just do this


Code:
Useful.RandomNumber(1,100);


but why doesn't the old AS2 way of things work?

Accessing Classes From Other Classes
Two Classes: Tile, Map

I know Tile works and is accessible from the main timeline because I can create and object and trace properties, so the timeline is able to import it.

When placing the same import statement in the Map class I get: 1046: Type was not found or was not a compile-time constant: Tile.

Here is code


ActionScript Code:
package layout
{
    public class Tile
    {
        public var filename:String;
        public var myX:int;
        public var myY:int;
        public var ext:String;
        public function Tile(sFilename:String)
        {
            filename = sFilename;
            var nPos1 = sFilename.indexOf('_');
            var nPos2 = sFilename.indexOf('.');
            myX = Number(sFilename.substring(0, nPos1));
            myY = Number(sFilename.substring(nPos1+1, nPos2));
            ext = sFilename.substring(nPos2, sFilename.length);
        }
    }
}




ActionScript Code:
package layout
{
    import flash.display.*;
    import flash.net.URLRequest;
    import flash.events.Event;
    import layout.Tile;
    public class Map extends Sprite
    {
        // tiles[y][x]
        public var tiles:Array = new Array();
        public function Map()
        {
            if (map == false)
            {
                var map:Sprite = new Sprite();
                this.addChild(map);
            }
        }
        public function AddTile(sFilename:String)
        {
            var Tile:Tile = new Tile(sFilename); //This line causes issue
            tiles[Tile.myY] = new Array();
            tiles[Tile.myY][Tile.myX] = new Array(Tile, false);
        }
    }
}

Using Classes Inside Of Classes
I have created a custom sound class called MySoundClass that extends the Sound class... it is declared as class com.stickyMatters.WineGlassPiano.MySoundClass. I also have another class called SongPlayer that is declared as com.stickyMatters.WineGlassPaino.SongPlayer... my question is.. how do i use the MySoundClass inside of the SongPlayer class... when I try to import it says I cannot use the import statement inside of a class file. I know in AS3 you can use the package keyword to create packages and do that... but as far as I can see there is no package keyword in AS2... because I tried, and it just tells me htere is a syntax error on the line with the package declaration... can you use one custom class inside another? and if so... how?

P.S. just to be sure... i am using flash CS3 and writing AS2 files. Thanks!

Classes In Mx 2004 (new To Classes)
hi everyone, Im Nubis, from Argentina.
Iīm new to woking whit classes, Im using flash mx 2004 pro.

Ive created a class, that works correctly, it creates a square, a textbox, and uses a variable to pupulate the textbox.
(im sorry for my english)

in my library i have a MC (an empty MC) that is linked to that class.

I use this script to place the clip on the stage
attachMovie("card", "card", 1)
iknow the class works fine, but, I dont know where to pass the parameters to the class.

And if I use : Card = new MyCard("this Cardīs Name or label ")
both the clip and the textbox are not created.

could anybody please help me?

thanks in advance :)
(feel free to make comments about my code)

this is my class code:
// MyCard
class MyCard extends MovieClip {
var thisCardName:String;
//method for creating the square
function gen_sqr (){
this.createEmptyMovieClip("Square",2);
with(this["Square"]){
beginFill (0x0099FF, 100);
lineStyle (1, 0x003399, 100);
moveTo (0, 0);
lineTo (100, 0);
lineTo (100, 70);
lineTo (0, 70);
lineTo (0, 0);
endFill();
}
}
//method for generating the textfield
function gen_txt(my_text){
this.createTextField("mytext",3,0,0,50,20);
with(this["mytext"]){
text = my_text;
multiline = true;
html = true;
}
}
//constructor
function MyCard (thisName:String){
//set the name or label for the card
thisCardName = thisName;
//
gen_sqr()
gen_txt(thisName)
//
trace("newclass Created")
trace(thisCardName)
}
}

Importing Classes In To AS3 Classes?
I am not sure how to import multiple classes into an AS3 class. Also I am bit confused on how "package" works now.

This is currently what I have and its wrong:


Code:
package {
import flash.display.*;
import flash.net.URLRequest;
import flash.events.Event;

class LoadImage {

public function LoadImage() {
var container:Sprite = new Sprite();
addChild(container);

var pictLdr:Loader = new Loader();

var pictURL:String = "catfishSMv.jpg"
var pictURLReq:URLRequest = new URLRequest(pictURL);
pictLdr.load(pictURLReq);
pictLdr.contentLoaderInfo.addEventListener(Event.COMPLETE, imgLoaded);
function imgLoaded(e:Event):void {
container.addChild(pictLdr.content);
}
}
}
}
How should I actually do this?

Thanks

Classes In Mx 2004 (new To Classes)
hi everyone, Im Nubis, from Argentina.
Iīm new to woking whit classes, Im using flash mx 2004 pro.

Ive created a class, that works correctly, it creates a square, a textbox, and uses a variable to pupulate the textbox.
(im sorry for my english)

in my library i have a MC (an empty MC) that is linked to that class.

I use this script to place the clip on the stage
attachMovie("card", "card", 1)
iknow the class works fine, but, I dont know where to pass the parameters to the class.

And if I use : Card = new MyCard("this Cardīs Name or label ")
both the clip and the textbox are not created.

could anybody please help me?

thanks in advance :)
(feel free to make comments about my code)

this is my class code:
// MyCard
class MyCard extends MovieClip {
var thisCardName:String;
//method for creating the square
function gen_sqr (){
this.createEmptyMovieClip("Square",2);
with(this["Square"]){
beginFill (0x0099FF, 100);
lineStyle (1, 0x003399, 100);
moveTo (0, 0);
lineTo (100, 0);
lineTo (100, 70);
lineTo (0, 70);
lineTo (0, 0);
endFill();
}
}
//method for generating the textfield
function gen_txt(my_text){
this.createTextField("mytext",3,0,0,50,20);
with(this["mytext"]){
text = my_text;
multiline = true;
html = true;
}
}
//constructor
function MyCard (thisName:String){
//set the name or label for the card
thisCardName = thisName;
//
gen_sqr()
gen_txt(thisName)
//
trace("newclass Created")
trace(thisCardName)
}
}

Accessing Classes From Classes
Hi... I'm having some trouble with these bits of code... I got some help before from wangbar to sort it out when the var stored was in a class of its own. But trying to access it from another class isn't working...

class Ipa{
var c : Settings;
function Ipa() {
}
}

class Settings {
var currSubs:Boolean;
function Settings (s:Boolean) {
currSubs = s;
}
function getSubsOn ():Boolean {
return currSubs;
}
function setSubsOn (s:Boolean):Boolean {
currSubs = s;
return currSubs;
}
}

then at root level:
var dpp : Ipa = new Ipa();
dpp.c.setSubtitlesOn(false);

and level 3:
_global.subtitles = _level0.dpp.c.getSubtitlesOn();

if ( _global.subtitles == false){
_level3.speech._visible = false;
};


 And nothing happens...subtitles still showing...
Thanks in advance for help.
     silverswim


 


AS1 Classes And AS2 Intrinsic Classes
Anyone ever mess around with writing an AS1 style class (so that it can be used prior to your class export frame) and writing an intrinsic AS2 class to go along with it, to enable compile-time checking?

It's working well, at least for instance members. (The trick is you need to define your constructor like so:Code:

var MyAS1Class = function... and NOTCode:

function MyAS1Class...)

But for static members, I can't seem to get the compiler to recognize the AS1 static members as validating against the AS2 intrinsic classes static members. In other words:

Code:

import the.intrinsic.class.Foo
#include "the/actual/as1/class/Foo.as"

var myFoo:Foo = new Foo();

// This cause the compiler to complain:
myFoo.nonExistentProperty = "moo";

// This goes by undetected:
Foo.NON_EXISTENT_STATIC_PROP = "moo";

// This gets caught:
the.intrinsic.class.Foo.NON_EXISTENT_STATIC_PROP = "moo";
// But doesn't help because it's referencing the intrinsic class, which
// doesn't actually have any code and never gets compiled
(obviously the properties mentioned are not defined in this example intrinsic class)

It's apparently a problem of the actual AS1 class being a var on the timeline and the AS2 intrinsic class existing in a different namespace.

I've tried putting my AS1 class in the _global.the.intrinsic.class.Foo variable, like it would if it were a regular AS2 class.

I've tried Object.registerClass("_global.the.intrinsic.class.Foo", Foo), which I thought would work, but maybe I'm doing it wrong.

So far the best workaround is this:
Code:

Foo.__resolve = function(name:String):Void {
    trace("Oops, the member you've accessed, " + name + ", does not exist");
}Which at least provides run-time checking, but not compile-time checking, which is obviously why I'm doing this intrinsic thing at all.

I know this is a very esoteric question...any suggestions?

PS
Man, I do NOT miss writing AS1 OOP! I tend to forget how great AS2 OOP is when I use it exclusively. But coming back to AS1 OOP...<napoleonDynamite>Gawh!</napoleonDynamite>

Using Custom Classes Inside Of Custom Classes
I have created a custom sound class called MySoundClass that extends the Sound class... it is declared as class com.stickyMatters.WineGlassPiano.MySoundClass. I also have another class called SongPlayer that is declared as com.stickyMatters.WineGlassPaino.SongPlayer... my question is.. how do i use the MySoundClass inside of the SongPlayer class... when I try to import it says I cannot use the import statement inside of a class file. I know in AS3 you can use the package keyword to create packages and do that... but as far as I can see there is no package keyword in AS2... because I tried, and it just tells me htere is a syntax error on the line with the package declaration... can you use one custom class inside another? and if so... how?

P.S. just to be sure... i am using flash CS3 and writing AS2 files. Thanks!

Using Custom Classes Inside Of Custom Classes
I have created a custom sound class called MySoundClass that extends the Sound class... it is declared as class com.stickyMatters.WineGlassPiano.MySoundClass. I also have another class called SongPlayer that is declared as com.stickyMatters.WineGlassPaino.SongPlayer... my question is.. how do i use the MySoundClass inside of the SongPlayer class... when I try to import it says I cannot use the import statement inside of a class file. I know in AS3 you can use the package keyword to create packages and do that... but as far as I can see there is no package keyword in AS2... because I tried, and it just tells me htere is a syntax error on the line with the package declaration... can you use one custom class inside another? and if so... how?

P.S. just to be sure... i am using flash CS3 and writing AS2 files. Thanks!

Remoting
can make right pls help.. i have a dynmic txt

in my movie :

#include "NetServices.as"
#include "NetDebug.as"
_root.info = "remoting.....";

function Result()
{
//receives data returned from the method
this.onResult = function(result)
{
_root.info = result;
}

this.onStatus = function(error)
{
_root.info ="error";
}
}

NetServices.setDefaultGatewayUrl("http://localhost:8500/flashservices/gateway");
var gw = NetServices.createGatewayConnection();
var server = gw.getService("remoting.run", new Result());
server.sample();



my cfc:

<cfcomponent>
<cffunction name="sample" access="remote">
<cfquery name="cool" datasource="casino">
SELECT cPW FROM casino_users where cUN ="test1"
</cfquery>

<cfreturn cool>
</cffunction>
</cfcomponent>


cant seem to pass variable coming from a remote database.


thanks,
cid

Remoting
remoting
can make right pls help.. i have a dynmic txt

in my movie :

#include "NetServices.as"
#include "NetDebug.as"
_root.info = "remoting.....";

function Result()
{
//receives data returned from the method
this.onResult = function(result)
{
_root.info = result;
}

this.onStatus = function(error)
{
_root.info ="error";
}
}

NetServices.setDefaultGatewayUrl("http://localhost:8500/flashservices/gateway");
var gw = NetServices.createGatewayConnection();
var server = gw.getService("remoting.run", new Result());
server.sample();



my cfc:

<cfcomponent>
<cffunction name="sample" access="remote">
<cfquery name="cool" datasource="casino">
SELECT cPW FROM casino_users where cUN ="test1"
</cfquery>

<cfreturn cool>
</cffunction>
</cfcomponent>


cant seem to pass variable coming from a remote database.


thanks,
cid

Remoting
remoting
can make right pls help.. i have a dynmic txt

in my movie :

#include "NetServices.as"
#include "NetDebug.as"
_root.info = "remoting.....";

function Result()
{
//receives data returned from the method
this.onResult = function(result)
{
_root.info = result;
}

this.onStatus = function(error)
{
_root.info ="error";
}
}

NetServices.setDefaultGatewayUrl("http://localhost:8500/flashservices/gateway");
var gw = NetServices.createGatewayConnection();
var server = gw.getService("remoting.run", new Result());
server.sample();



my cfc:

<cfcomponent>
<cffunction name="sample" access="remote">
<cfquery name="cool" datasource="casino">
SELECT cPW FROM casino_users where cUN ="test1"
</cfquery>

<cfreturn cool>
</cffunction>
</cfcomponent>


cant seem to pass variable coming from a remote database.


thanks,
cid

Remoting
when i ever i query a database using remoting the result always return :[ object, object]

whats will i do ?

thanks

Xml Remoting
Hello to all,

I am creating a Full Flash eCommerce site (Flash 8 Pro) and I need a few pointers. I have only used XML for simple tasks like Photo Gallery. Here is what I would like to use for the site....

1. PayPal Merchant Account
2. Flash Xml Remoting v3.1 by Shane McCartney
3. Flash Component PPCC 1.2 by ANYRD&D

...BUT i have no idea how to use the Xml Remoting and the documentation confuses me? Ideally I would like to have the product information i.e. (cost, description, image) in the XML file and then have flash import that. Then use the Flash PPCC component for the eCommerce stuff.

I have installed the Flash Xml Remoting Component and Downloaded the SAMPLE File... all that is on the stage is the component with instance of "xmlComm" when i test the movie i get an empty screen... the Flash Output window displays:
typeName
3

Anyone know how to use the Flash Xml Remoting Component v3.1 created by: Shane McCartney??

The Sample XML file looks like this...

<itemsList>
<items>
<label>The Amazing Description</label>
<value>12.15</value>
</items>
<items>
<label>Again an Amazing Title</label>
<value>22.50</value>
</items>
<items>
<label>Finally an Amazing Title</label>
<value>28.50</value>
</items>
</itemsList>

Here is the ActionScript:

var evtObj:Object = new Object();
evtObj.loaded = function(e:Object) {
trace(e.name);
trace(e.data.itemsList.items.length);
};
evtObj.error = function(e:Object) {
};
//
xmlComm.addListener("loaded", evtObj);
xmlComm.addListener("error", evtObj);
xmlComm.call("sample.xml", "typeName");

What am i missing?
ANY HELP would be greatly appreciated.

Remoting In Cs3 With .net
I did a search here on cs3 remoting and read that it is supported with the netconnection object. Unfortunately I've not done remoting before and I can't seem to find any examples that use .net. So, does anyone know how to set this up in both flash and .net? I have my .net classes compiled to a dll, I'm just not sure how to use the netconnection class to call the dll and how to set up the dll in IIS. Thanks!

As3 Remoting From .net?
Hi guys I was wondering if one of you could help me understand how I write the connection to .net functions using as3? I followed a few tutorials but I'm stuck in how to target the page with the function.

The problem is that say my structure is this:

swf file location:http://www.domainname.com/folder1/fo...er2A/flash.swf

service location: http://www.domainname.com/folder1/fo...B/service.aspx

So when i want to call a function from the service how can I write it so that I go out one folder and then go into the other one??


Code:

connection.call("????",responder)
If anyone could help me I would really appreciate it.

Remoting Help
Hello People,
I have been reading in the Forums for some time now, and I find it very helpful, you guys do a great job here!!!
Now, I decided to post some because I need some help with a remoting result...
I have a flash form with an application form and 3 child forms. One of the child forms is called menus and it uses a custom class called "MenuCode".....
here is the "MenuCode" code:

import mx.remoting.Service;
import mx.services.Log;
import mx.remoting.PendingCall;
import mx.rpc.RelayResponder;
import mx.rpc.ResultEvent;
import mx.rpc.FaultEvent;
import mx.remoting.RecordSet;
import mx.screens.Form;
import mx.remoting.debug.NetDebug;

class MenuCode extends mx.screens.Form
{

private var menuItemHolder_mc:MovieClip;
private var menuItemHolder2_mc:MovieClip;
public var buttonNames:Array;
public var buttonNames2:Array;
private var promotionalProd_btn:Object;
private var awards_btn:Object;
private var Category:Object;
//private var myResponder:RelayResponder;
private var categoryService:Service;
private var subCategoryService:Service;


function MenuCode()
{
this.addEventListener("load", this);
mx.remoting.debug.NetDebug.initialize();
}

private function handleEvent(evtObj:Object):Void
{
switch (evtObj.type)
{
case("load"):
formLoad();
break;
}
}

private function formLoad():Void
{
categoryService = new Service("http://localhost:8500/flashservices/gateway", null, "mcaeiro-store.flash.msite.Categories", null, null);
var pc:PendingCall = categoryService.GetPromoCategories();
pc.responder = new RelayResponder(this, "onPromoCategoryData", "onPromoCategoryDataFault");

var nc:PendingCall = categoryService.GetAwardCategories();
nc.responder = new RelayResponder(this, "onAwardCategoryData", "onAwardCategoryDataFault");
}


// handles the results from the GetPromoCategories() call
function onPromoCategoryData (re:ResultEvent):Void
{
_parent.promotionalProd_btn.onPress = function():Void
{
_root.createEmptyMovieClip("menuItemHolder2", 0);
_root.menuItemHolder2._x = 40;
_root.menuItemHolder2._y = 50;
var loTween_x = new mx.transitions.Tween(_root.menuItemHolder2, "_xscale", mx.transitions.easing.Strong.easeOut, 20, 100, .4, true);
var loTween_y = new mx.transitions.Tween(_root.menuItemHolder2, "_yscale", mx.transitions.easing.Strong.easeOut, 20, 100, .4, true);

var rs:RecordSet = RecordSet(re.result);
var promoCategoryArray:Array = new Array();

for (var i=0; i<rs.getLength(); i++)
{
var record = rs.getItemAt(i);
promoCategoryArray.push({name:record.Nombre, Id:record.Id_Categoria});

_root.menuItemHolder2.attachMovie("menuItem_mc", "mcCategory" + i, i);
var mcNewClip = _root.menuItemHolder2["mcCategory" + i];
mcNewClip._x = 0;
mcNewClip._y = i * 17;
mcNewClip._alpha = 70;
mcNewClip.menuItemName_txt.text = /*record.Id_Categoria + " " + */record.Nombre;
mcNewClip.idCategory = record.Id_Categoria;

mcNewClip.onRollOut = function():Void
{
this._alpha = 70;
this._parent._visible = false;
}

mcNewClip.onRollOver = function():Void
{
this.backgroundColor = 0x003399;
this._alpha = 100;
this._parent._visible = true;
}

mcNewClip.onRelease = function():Void
{
trace(this.idCategory);
var catHold = this.idCategory;
subCategoryService = new Service("http://localhost:8500/flashservices/gateway", null, "mcaeiro-store.flash.msite.SubCategories", null, null);
var pc:PendingCall = subCategoryService.getPromoSubCategories({Id_Categ oria:catHold});
pc.responder = new RelayResponder(_root.application.menus, "onPromoSubCategoryData", "onPromoSubCategoryDataFault");

function onPromoSubCategoryData (rp:ResultEvent):Void
{
trace("got it Pal.");
}

function onPromoSubCategoryDataFault (rp:ResultEvent):Void
{
trace("got the fault response for SubCategories.");
}

}
}
}
}

function onPromoCategoryDataFault (re:ResultEvent):Void
{
trace("got the fault response for Categories.");
}

Now.... I am having trouble with the onPromoSubCategoryData function and I have no idea how to fix it now.
I get the result from the getPromoSubCategories Service but my responder function does not do anything, or maybe I am just blind... anyway 4 eyes are better than 2 so if someone has time and feels like going through my code, and happens to find where the flaw is, that is great....

How Remoting REALLY Looks Like... ;)
Hi all,

Thought of giving away a "disassembly-hour" report of mine (i am sure the gurus already did the same discovery on their own long time ago), which have to do with discovering what lies beneath the 'NetServices.as' library and all its offspring, including the newer AS 2.0 Remoting classes like Service etc, and uncovering the true nature of Flash Remoting..

For those of you who wonder what the Remoting is like on the most basic level, a NATIVE-only level of interpreting, a little tutorial:


ActionScript Code:
var gateway_nc:NetConnection = new NetConnection;

gateway_nc.connect("http://localhost/flashservices/gateway.aspx");

var responder = {};

responder.onResult = function(r)
{
    for(var i in r) trace(i + ":" + r[i]);
};

gateway_nc.call("MyService.MyFunction", responder, "someParameter");

What it does is it creates a NetConnection object, which establishes a connection between the client and the Flash Remoting Gateway (essential part of Flash Remoting) be it on a .NET, CFusion or a Java server. You dont have to wait for a successful connection, because, apparently since 'http' is a stateless and non-persistent protocol, the state of the NetConnection object after the 'connect' call allows for immediate calling of service functions. Remember that in case of connecting to a Macromedia Flash Communication Server MX thru the RTMP protocol, which IS persistent keep-alive protocol, you have to actually wait for the connection to be available before doing anything with the NetConnection object. Ok, so back to the script: calling then a service function requires that you specify a responder object which will asynchroniously receive the results of your particular remote function call - so you have to create an object which defines a 'onResult' method - the so-called 'responder' object. Results arrive by the Flash player calling the 'onResult' method with the results returned, be it a single or several parameters, depending on the nature of your remote function. The actual call of the remote function happens by using the NetConnection.prototype.call method (simpler put the 'call' method of your NetConnection object), and here some explanation is required. First, since the connection to the gateway is a general all-purpose multi-service connection, the call of 'call' method needs BOTH the service name and the name of the service function. You do that by supplying a string as the first parameter which identifies the remote function across the whole gateway - service name followed by dot followed by function name (in case for .NET, which I cover here). Second parameter is the 'responder' object which tells where to return the call return values, and starting from the third parameter are the parameters to your actual remote function, which may or may not be present at all (i.e. the 'call' method can have only two parameters - the function string and the responder object). That's it

I know the practical use of doing everything the 'native' way is not so popular, since the Macromedia classes present a more user friendly scripting interface, but in case of small projects or where one simply wants to do Remoting another way, by building his/her own programming interface, this should explain little bit more than the basics.

Comments are welcome, criticism as well

Remoting Help
Any body have simple remoting project with ASP.NET

Explanation:
I just want to enter user id and password in Flash, It will call ASP.NET bussiness logic using flash remoting. then specific user information will be appeared in flash. Anybody can help me.

I am awaiting to your reply.

Regards
Shahzeb

Remoting
I have small doubt in Flash remoting, it is possible to use the Flash 8 As2 remoting component for Action script version 1? I have installed Flash8 As2 components but in my project everthing wrote in action script 1.

any one help me how can i use the flash8 components in Actionscript1?

Im new to flash remoting..i have to convert as1 to as2 for using flash8 components?

thx and regards
thil

Remoting
how does remoting help in multiplayer game.
is it only integrated with cf.
help me with links and tutorials.

Remoting In Cs3 With .net
I did a search on cs3 remoting and read that it is supported with the netconnection object. Unfortunately I've not done remoting before and I can't seem to find any examples that use .net. So, does anyone know how to set this up in both flash and .net? I have my .net classes compiled to a dll, I'm just not sure how to use the netconnection class to call the dll and how to set up the dll in IIS. Thanks!

Remoting In CS3 ?
Well although Remoting in Flash was always easy, it started to get harder in flash8.
Reason: you had to crawl the macromedia website to find the components which were not installed and do the installation manually.

Now, a nice surpirse in Flash CS3: Maybe I am blind, but I just can't find any of the components for AS3.
I did install the components for AS2. But, if I open an old .fla (Flash8) and compile it, it simply doesn't work:
no 'mx.data.types.RecordSet' found in package 'mx.data.types'

Of course, no documentation can be found. So.... should I install flash8 again do edit my projects?
Bad one Adobe...

</marker>

Remoting And CS3
Anyone been able to get a remoting app working (written in AS2, Flash 8) after being compiled with CS3 (Flash 9)? Or has anyone found a working example of a remoting connection written in AS3?
Cheers,
Rob



























Edited: 03/02/2008 at 09:47:36 PM by YukonRob

Remoting From FMS
I've been trying to create a NetService object and use that to call and get the reply of my AMFPHP remoting gateway, but for some reason this isn't working.

I've read all the documentation I've found (not much -- apparently most want to do remoting client side, not server side), but it's not really clear how to debug the process...

Any help is greatly appreciated.

The code on the FMS main.asc file is as follows, and I've verified that the gateway does indeed work from another application (non-flash):

quote:
load("NetServices.asc");

application.onConnect = function(newClient, userKey) {
this.acceptConnection(newClient);

newClient.msgFromClient = function(msg) {
msg = '<b>'+userKey+":</b> "+msg+"<br>";
application.history += msg;
application.users_so.send("msgFromSrv", msg);
};

application.users_so.send("msgFromSrv", "rawr");
gc = NetServices.createGatewayConnection("

FMS Remoting
Hi All,
Can anyone please send me an example of FMS Remoting i.e. how to connect to an App Server from FMS.
Thanks

Php Remoting
i installed the AMFPHP Project from adobes website and i'm kinda stuck right now... i can define a variable in the actions panel and trace it as well as loops and stuff, but i can't execute any mysql. i have i feeling i'm seriously missing something, i just don't know what.

here's some code:

$dbconnect=mysql_connect($dbhost,$dbuser,$dbpass);
mysql_select_db("awards", $dbconnect);

$selectaward=mysql_query("SELECT * FROM teacher");
while ($r = mysql_fetch_array($selectaward)){
trace($r['award']);
}

knowledge on the subject will be seriously helpful, greatly appreciated, and i'll e-mail you a pizza.

Xml Remoting V3.1
Hello to all,

I am creating a Full Flash eCommerce site (Flash 8 Pro) and I need a few pointers. I have only used XML for simple tasks like Photo Gallery. Here is what I would like to use for the site....

1. PayPal Merchant Account
2. Flash Xml Remoting v3.1 by Shane McCartney
3. Flash Component PPCC 1.2 by ANYRD&D

...BUT i have no idea how to use the Xml Remoting and the documentation confuses me? Ideally I would like to have the product information i.e. (cost, description, image) in the XML file and then have flash import that. Then use the Flash PPCC component for the eCommerce stuff.

I have installed the Flash Xml Remoting Component and Downloaded the SAMPLE File... all that is on the stage is the component with instance of "xmlComm" when i test the movie i get an empty screen... the Flash Output window displays:
typeName
3

Anyone know how to use the Flash Xml Remoting Component v3.1 created by: Shane McCartney??

The Sample XML file looks like this...

<itemsList>
<items>
<label>The Amazing Description</label>
<value>12.15</value>
</items>
<items>
<label>Again an Amazing Title</label>
<value>22.50</value>
</items>
<items>
<label>Finally an Amazing Title</label>
<value>28.50</value>
</items>
</itemsList>

Here is the ActionScript:

var evtObj:Object = new Object();
evtObj.loaded = function(e:Object) {
trace(e.name);
trace(e.data.itemsList.items.length);
};
evtObj.error = function(e:Object) {
};
//
xmlComm.addListener("loaded", evtObj);
xmlComm.addListener("error", evtObj);
xmlComm.call("sample.xml", "typeName");

What am i missing?
ANY HELP would be greatly appreciated.

Flash Remoting
G'Day all,

Everytihing I read tells me that I need Cold Fusion MX to be able to use web services however I'm not convinced. Does anyone have a real life example of Flash Remoting to a web service that does not use Cold Fusion? and if so can they give me a few pointers?

Flash Remoting & Ado.net
Hi, As Im wanted to learn more about using serverside scripting with flash, and found out about the "flash remoting" and dreamweaver mx, I installed dreamweaver mx. So I opend the tute called "Introduction to Flash Remoting for .NET Tutorial > Creating the ADO.NET data binding", and it all looks very simple and practic. But what I dont understand is the database connection thing. As it appears ,I dont see any database files that the "asp.net" saves the data to. My previos and first attempt in serverside scripting was writing and reading to and from an Acces database trou asp and flash. This is the first time I hear about this "asp.net" thing, so I wonder if anyone can make it clear for me about how it works, and what files are included. Does it make flash store and read data to a singel asp file?

Flash Remoting
Must I upgrade my Coldfusion server to MX before I can use flash remoting? I just bought ColdFusion 5 for one or two months only. Can I integrate with coldfusion 5 instead and how do i do it?

Copyright Đ 2005-08 www.BigResource.com, All rights reserved