Forums

ASP

This topic is locked

Real time Dynamic Data with NO refresh

Posted 06 Jan 2003 14:00:39
1
has voted
06 Jan 2003 14:00:39 David Stoltz posted:
I've just written a large report which processes a lot of data and displays it in a browser (using ASP)

I'm curious, is it possible to display this data without having to refresh and requery the database? So as the data changes, it is reflected onscreen, without having to refresh.

Can I have a realtime connection? How? Can I use a component?

Any advice appreciated!!!

Thanks.

Replies

Replied 06 Jan 2003 15:44:30
06 Jan 2003 15:44:30 Dave Blohm replied:
I can show you how to do it with Flash... <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>

Doc
Rangewalk Digital Studios
Replied 07 Jan 2003 17:24:11
07 Jan 2003 17:24:11 David Stoltz replied:
Really. Flash can do this?

I would need it to connect to either an AS/400 or SQL 2000 database and
"monitor" a ton of fields....

Is flash the only way? I'm somewhat familiar with Flash - but definitely
a newbie...

Thanks for any info.



<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
I can show you how to do it with Flash... <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>

Doc
Rangewalk Digital Studios
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Replied 07 Jan 2003 23:01:40
07 Jan 2003 23:01:40 Dave Blohm replied:
Flash can do it. I'm sure it can be done other ways, but I already have enough junk floating around in my head to fill it with another programming language.

Besides, Flash is small and portable.

If you're interested, I will post some how to info...

Doc
Rangewalk Digital Studios

Edited by - on 07 Jan 2003 23:02:28
Replied 08 Jan 2003 14:12:16
08 Jan 2003 14:12:16 David Stoltz replied:
That would be great!

Thanks!!!
Replied 08 Jan 2003 22:59:25
08 Jan 2003 22:59:25 Dave Blohm replied:
I'm going to write out all the ActionScript in here, but looking at the files will be much more useful...I would let you DL them off my server, but my DSL company has decided it is no longer in their best interest to provide fast access...that being said, my servers are shut off from the world until I make the switch (hopefully just a few more days)...I will zip them up and email them to you for you to pick apart.

The example I created does not use a connection to a DB...I'm assuming you know how to do that. I just loaded up a variable with some text that is passed to the flash movie.

Here's how it works in a nutshell...

Flash calls the variable up from an asp page (which in turn does the work of getting your stuff out of a DB but is never displayed to the user) , displays it then loops back to the first frame...this continues as long the html page (the page that the .swf is embedded in does not have to be an .asp file) is displayed in the browser. I have written this Flash movie to run @ 20 frames per second and it is 10 frames long...that means the data displayed in the Flash movie is current as of 1/2 second ago...you can tinker with this to make it faster or slower.

ok, here's how to do it (I'll try my best to put this down in a coherent fashion):

(BTW-I'm writing this in FlashMX, but will work with player 4 and up)

1. create a new movie
2. in your new movie create a New Symbol (Movie Clip) and name it anything you want - in the example file I am sending you I have named it herehere
3. in your new movie clip insert a text box the size you want it to appear on screen
4. set the Text Type to Dyanmic Text
5. set Variable to the name of the variable you will set in the ASP page you are puling your data from - in the example file I am sening you my variable is called mytext
6. go back to the scene you're working in - the default scene name is Scene 1 and this is the name of the scene in the example file
7. drag the symbol 'herehere' from the Library to Scene 1
8. set the Instance Name - in the example I called the Instance herehere as well...I hope this doesn't confuse you
9. in the first frame of your timeline insert the following ActionScript:

loadVariables("www.yourdomaingoeshere.com/flashme.asp", "herehere";

10. ActionScript is case sensative...change the URL to reflect your domain...the asp file I am including in the example (which the Flash movie will get the values from) is called 'flashme.asp'
11. that the ActionScript above does is get the variables from the specified file and sends them to the Instance (not the Symbol) 'herehere'
12. on frame 10 create a Keyframe and in it load the following ActionScript:

gotoAndPlay(1);

13. the example has a counter in it just to show that the movie is looping...that's not necessary and is only there for demonstrative purposes
14. set the FPS rate to 20

That's it on the Flash side...

On the ASP side, the only thing that you have to do is make sure there is a Response.Write for your variables...dunno why, but Flash gets its data from what is displayed on screen...there for Response.Write "&mytext=hi" will get the data in your Flash movie.

I think that's about it...like I said I will email you the zip file.

If anyone else is interested in getting the examples for this, post a message in here...as I mentioned above, my servers are cut off from the world...including my mail server...

Hope this helps

Doc
Rangewalk Digital Studios
Replied 09 Jan 2003 13:56:16
09 Jan 2003 13:56:16 David Stoltz replied:
Great info - thanks a million....

I'll fool around with it this week!
Replied 09 Jan 2003 17:36:39
09 Jan 2003 17:36:39 Scott Burkett replied:
Dave,

I'd appreciate your forwarding the code to me as well. I'm in the middle of a project that looks like it would benefit greatly from this!!

Thanx, man.
Scott B.
Replied 10 Jan 2003 20:45:32
10 Jan 2003 20:45:32 Dave Blohm replied:
I do a lot of dynamic Flash/ASP stuff so if you ever have any questions don't hesitate to get in touch (except the week of FEB 01, 2003 -- I'll be in Crested Butte skiing and if I so much as see a computer I'll go postal <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle> )

Doc
Rangewalk Digital Studios
Replied 10 Jan 2003 21:06:12
10 Jan 2003 21:06:12 David Stoltz replied:
My problem is, I do alot of ASP, but not Flash....

So a better solution for me would be a third party component that I could register on my server....say, somekind of grid component or the like that allows for realtime updating without refreshing the page...

But your solution has wet my appetite...

Thanks for any other info!

-Dave
Replied 10 Mar 2004 19:27:04
10 Mar 2004 19:27:04 Dan Berdusco replied:
Does anyone know a way to do this without using Flash?

Thanks...

Replied 27 Aug 2007 18:31:27
27 Aug 2007 18:31:27 Nathan Dawson replied:
Can you send me the example files?

BionicTiki

Reply to this topic