Welcome to Mediasparkles

News : Flash

Web services are all the rage these days. At least that's what I hear. After reading this tutorial, I dabbled with web services in Flash myself. If you would like to get an idea of what kind of web services are available, take a look around XMethods. Unfortunately, not all of them will work with Flash. It took me a few tries to find that one that does. I ended up creating a little interface that uses a temperature conversion service. It converts Centigrade to Fahrenheit and vice versa. Nothing too impressive or elaborate, but this is just the tip of the ice berg.
All you need to know are the web service's method names and expected parameters. In the case of the temperature conversion service, the methods are ctoF and ftoC. Here is the ColdFusion code generated in Dreamweaver which tells you so:


<cfinvoke
webservice="http://developerdays.com/cgi-bin/tempconverter.exe/wsdl/ITempConverter"
method="ctoF"
returnvariable="ctoFRet">
<cfinvokeargument name="temp" value="enter_value_here"/>
</cfinvoke>
<cfinvoke
webservice="http://developerdays.com/cgi-bin/tempconverter.exe/wsdl/ITempConverter"
method="ftoC"
returnvariable="ftoCRet">
<cfinvokeargument name="temp" value="enter_value_here"/>
</cfinvoke>


In Flash, you call the ftoC method like so:

myService = gateway_conn.getService("http://developerdays.com/cgi-bin/tempconverter.exe/wsdl/ITempConverter", this);
myService.ftoC({temp:your_inputfield_variable});


You then need to create an event method called ftoC_Result that is invoked when data is returned from the server. Check out the .fla for this example to see just how easy it is to connect to a web service. All you need is Flash Remoting, the wsdl URL -- in this case http://developerdays.com/cgi-bin/tempconverter.exe/wsdl/ITempConverter -- and the method and parameter names the web service expects. Unfortunately, since I don't have a dedicated server at home and the server on which this website is hosted does not offer Flash Remoting, all I have to show for myself for now is a screenshot.

 posted by Vera Fleischer (4/2/2003 10:35:40 PM);




Today at work I installed Flash 4, just for old time's sake. It got me all nostalgic. It felt like visiting an old friend who I hadn't seen in a while. I had completely forgotten that Actions was once a tab on the Frame properties panel, along with Tweening and Labels. Can you imagine? All of the available Actions fit on one popup menu. Remember when you had to call a frame label instead of a function? One thing I couldn't find though is Get Property. Set Property is on the popup menu, but Get Property is not. I could have sworn we had both.

 posted by Vera Fleischer (4/2/2003 06:10:54 PM);






Souvenir from Flash Forward. But remember: I don't really work at the University of Virginia. And I'm not really German either. But that is my real name.

 posted by Vera Fleischer (4/2/2003 10:40:09 AM);




You may have heard that Flash Communication Server MX 1.5 just came out. If you want to know all about its new features, check out Phillip Kerman's article at DevNet.

 posted by Vera Fleischer (4/1/2003 12:30:37 PM);





When I read Advanced PHP for Flash, I was first introduced to local shared objects in Flash and have been in love with them ever since. Last night I set up a shared local object for my electronic music quiz to give users the option of remembering their login information. It is very, very simple to do this. During login state initialization, I have this code:

login_so = SharedObject.getLocal('quizLogin');
if (login_so.data.username != undefined) {
username_txt.text = login_so.data.username;
password_txt.text = login_so.data.password;
}


First, I access the shared object ("so"), whether it already exists or not. If the so's data contains a variable named username, I fill in the username and password information that has been stored previously on the user's machine.
At login, I store in the so the username and password the user entered to be accessed the next time the user visits. This is done like so:

login_so = SharedObject.getLocal('quizLogin');
login_so.data.username = username_txt.text;
login_so.data.pass = password_txt.text;
login_so.flush();


And that's it! You might want to put in some conditionals and let the user decide whether to save the login data to a shared object or not. But the shared object code alone really is that simple.

 posted by Vera Fleischer (3/31/2003 09:44:10 PM);




My friend Starrie had the great idea to greet my site visitors with updates on what I am up to professionally. Enter MediaSparkles version 3.0. I have set up a mini blog to which I will post projects I am working on and my thoughts on Flash and related technologies. If you're looking for the old cubes and bubbles that used to live here, they have moved here.

 posted by Vera Fleischer (3/30/2003 05:21:21 PM);