Video tutorial: Use the Flex webservice component in Flash CS4 projects
In this video, I’ll show you how you can use the webservice component from the Flex framework in your Flash CS4 projects. If you’re missing the webservice component in Flash, just use the one in the Flex framework.
UPDATE: My sincere apologies. There is an error in my code which I did not explain in the video.
Line 10 should not read myWebService.load but myWebService.loadWSDL.
I do remember we recorded this one twice and I fear that that’s where the mixup happened. Please download the working FLA below.
Download the FLA file.







Just a suggestion but something we’ve been using for some time and would prob be interesting to Flash peeps who are not aware its possible at the mo. Using Flex data binding in Flash.
That said unless your building something small (banner or smaller parts of a larger HTML driven app), I really don’t understand why people persist with Flash. They are making things very long winded and difficult for themselves.
Tink said:
> I really don’t understand why people persist with Flash. They are making
> things very long winded and difficult for themselves.
Tink, I actually moved from Flex to straight flash, but I do still use the Flex IDE to do all my coding.
If you are saying that the kinds of projects ‘you’ write would be more long winded in Flash as opposed to Flex, then I can’t dispute that because I don’t know what you are writing. Likewise, you don’t know what other people are writing and with all due respect, your statement is a nonsense statement.
Firstly, I don’t need any of the flex components. None. Zero. I don’t need grids, charts, buttons, listboxes, panels, automatic layout… nothing. That doesn’t leave a whole lot of reason to use flex, but it does leave good reasons not to use flex. Much faster loading times spring instantly to mind. I also use PureMVC which cures many negative aspects of using straight flash.
As Adobe themselves say, use whatever is appropriate to what you are doing. If I need Flex again, I’ll most certainly use it and am planning to keep on upgrading it. I love Flex. It’s amazing, but not everyone is ‘you’ and the flash world is highly diverse.
A very useful video. Thanks a lot .
JESUS CHRIST MAN! you work for the flash team and do a video and the code doesn’t work until you pull a fast one and swith the code at the end!!!! I dare you to use the same code in the first part of the video like i did and see if it works! I was spinning my wheels for over an hour trying to get it to work.
He then does the old switch and the code CHANGES after 8 mins into the movie, Pauae the movie here and see! After he get the errors!
I finaly had to do a frame by frame and do the correct code he switches to! then it works! Dude stop being so lazy and explain it right with good code and explanation in the from scratch video and dont swith to your good code when you code breaks! thousands of people are probablty trying this and saying forget it…sad…
Ya I see that, he makes a mistake on the
myWebService.load(“http://www.webservicex.net/country.asmx?WSDL”);
it’s suppose to be
myWebService.loadWSDL(“http://www.webservicex.net/country.asmx?WSDL”);
thats the oly differnce from it working and not working
not cool on switching code at the end…I can see how that could confuse a lot of people.
@Justin @David: I’m really sorry about that one guys! I remember we recorded this one twice and fear that that’s where the mixup happened. I’ve added the FLA for download. I really do apologize for this mixup.
I downloaded the updated .fla file with the correct line
“myWebService.loadWSDL(“http://www.webservicex.net/country.asmx?WSDL”);”
but flash tells me that there is a problem opening this URL. The URL exist, so I am quite stuck about this problem.
Can you help me with this issue?
daniel
Okay, got it working….was an firewall issue!
I’m calling a WebService but it requires a parameter. How do I code the parameter into the get operation?
Thanks
I’m having the “Error opening URL,” can anyone offer some guidance?