View Full Version : Embedding Flash into ASPX
Potemkyn
12-30-2008, 09:38 PM
I'm finally getting some work done in VS2005 and the fella working with me asked if we could simply change the flashloader.html to flashloader.aspx. So I tried it, and it and the swf seems to be working fine.
I'll be attempting to add a VB function soon to see if Flash can call it. There's already several javascript functions in this file that flash calls, just wondering if there are any issues getting the swf to communicate with it's ASPX file and its VB functions.
:confused:
Mike
yell0wdart
12-30-2008, 11:18 PM
Not really, since your VB methods will be on the server, and not on the client (like the JS functions). Your best bet would be to write some VB in your code behind to output JS to the aspx page, or just write the JS directly on the page itself.
Potemkyn
12-31-2008, 01:32 PM
So when I need to make a call to the SQL database, how would this best be accomplished? I've used plain ASP pages to fetch data and hand it over to Flash.
Thanks
Mike
yell0wdart
12-31-2008, 04:00 PM
There are several ways to do it. You can actually use the ASP.NET AJAX library to do it directly from JavaScript if you want to, or you can do it like you would with PHP and send the request to your aspx page and have your aspx page write the data back via the response stream (Response.Write()), or you could set up a web service with a web method that returns the data via XML or JSON.
Potemkyn
12-31-2008, 04:40 PM
That's a lot of options - and all new to me. I'll get with my .NET co-worker and see what he'd prefer. He's looked at my ASP code and said it looks like the code-behind files. He also said that's the hard way of doing things in .NET since Visual Studio will create most of the code needed for all this.
I think we have AJAX available and since I am a bit familiar with JavaScript, that may be the first method we pursue.
I'll keep you informed of how things go
Thanks! ;)
Mike
yell0wdart
12-31-2008, 05:03 PM
Yea. On future projects, I'm looking at making heavier use of web services. MS did some really cool stuff with RESTful web services and WCF along with the ability to call those services from the client via their AJAX library.
Potemkyn
01-05-2009, 02:28 PM
Ah, WCF, I'm going to take a long look at that one of these days...
Mike
mattb
01-16-2009, 10:35 PM
I would suggest using a remoting system such as FluorineFX. Essentially you write your code in .Net classes and call them directly from Flex/Flash using RemoteObject. That way you don't have to mess with JS or AJAX.
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.