views:

24

answers:

1

WHat is the standard method for say a server to update an already loaded SWF on the client browser, i.e. something analogous to how an html page is partially updated via ajax (though I don't know a lot about ajax yet either.) Would the mechanism be the same if user-initiated.

I assume the .SWF should have public functions that can be invoked, then you'll use javascript to access the swf from the html page its in, then invoke a public function of that swf.

Just the specific terms or functions I need to search for to get a primer on this would be great.

ALso, How would one go about testing the public functions of an swf that is already loaded in a browser (wihtout having a full Adobe devleopment suite for example).

+1  A: 

This is quite a vast subject actually. This is the whole RIA concept. Flash can look after itself in terms of communicating with a server , you don't necessarily need Javascript. You only need a server side language to communicate with.

Since it all can happen within the swf , public functions don't really come into it. A User initiates an action in the movie that triggers a call to a remoting service which in turn sends a response which consequently updates the movie.

A few areas you can look into, in no particular order:

For testing purposes , try MonsterDebugger http://gotoandlearn.com/play.php?id=109

Edit:

Flash can use PHP to retrieve a XML , then parse the XML & change the data inside the SWF according to the data retrieved in the XML

http://gotoandlearn.com/play.php?id=90

In case of a link, the concept is a bit different, because depending on the type of link this may cause a page refresh. The approach in the above tutorial could be user initiated by clicking on a swf element, entering text in a text input box etc... this is what I meant by the RIA concept. It's quite standard now in Flash that user interaction will introduce changes in your SWF by making calls to the server.

PatrickS
Sorry, I originally was thinking this was an answer, but its not. In my case all I want the client to do is request a "page" from the server (i.e. a user click a link in the swf) and in response the server updates the existing swf, by (for example) sending down a new data xml file and then presumably (?) calling a public function of that swf and passing as a parameter to this public function the name of the xml file that ws just downloaded. The server is running a templating system like Django or ASP MVC
Mark
I don't go into details of a specific operation but this is what the answer is about. Check the edit
PatrickS