#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Location
    Sweden
    Posts
    3
    Rep Power
    0

    Question jsp, mySQL import into flash


    Hi all!

    I have a problem and a question. Any help is greatly appreciated.

    Im setting up a website running unix, apache, mySQL and jsp. I would like a flash frontend to the site but have a need of publishing tables of data from the database. My question is if it is possible to do this inside the flash area of the frontend.

    Im not a programmer, I just try to get information enough to take a decision on how to approach it. So in any answer please leave out the code parts ;-)

    TIA

    Jokerbabe
  2. #2
  3. No Profile Picture
    flash junkie
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2003
    Location
    CO, USA
    Posts
    172
    Rep Power
    12
    hello,

    there are no "tables" per se in flash. However, through some simple code you could take the jsp output and construct your own tables. There are also many components (the data grid for example) that are built specifically to help flash's lack of support for native tables. It's plenty possible, but will just take a little work around...

    also, what kind of data will you be displaying? the datagrid is only for textual data. If you need pictures in there, you'll need to build your own "row" element and just duplicate and allocate as you need. It will take an intermediate amount of Flash knowledge to be able to take the data and turn it into what you want (just to warn you).

    cheers,

    bret
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Location
    Sweden
    Posts
    3
    Rep Power
    0
    Okej...

    Sounds like a waste of time to get into that type of flash programming since the data partly consists of pictures.

    The thing is, Id like to show different buildings with a reasonable amount of textual data like architect, building year and stuff, and of course an undefined number of pictures of that building. Maybe the best solution is to leave the flash front end when displaying the buildings. But it would be a lot more boring...

    Thanks anyway!
  6. #4
  7. No Profile Picture
    flash junkie
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2003
    Location
    CO, USA
    Posts
    172
    Rep Power
    12
    well, i'm not saying it's not possible... there are plenty of methods you could use to integrate pictures into dynamic flash pages... it will just take a little (a lot of) work... basically you'll have to build your page, knowing the exact dimensions of every element on the page. that's not so hard, since everything has a _width and _height property, but to make a completely dynamic page would take a little effort...
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Location
    Sweden
    Posts
    3
    Rep Power
    0
    Well, its the workload Im afraid of and try to work around ;-)

    The problem is, as I understand it, that the pictures should be uploaded by a number of people (not that many, but many enough) that you cant trust to adjust pictures to a certain width and height. That means that I have little control over the sizes of the pictures and the number of pictures.

    Is the method otherwise to have actionscripts interpreting the jsp-pages or could flash actionscripts communicate directly with the sql? (Im on thin ice here, just had to ask anyway. Feel free to laugh if it was a silly question)

    I guess there is a long row of obstacles which has to be overcome, the easiest way out - even if its less fun - maybe is to display the jsp page instead...
  10. #6
  11. No Profile Picture
    flash junkie
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2003
    Location
    CO, USA
    Posts
    172
    Rep Power
    12
    you'll have to forgive me if this isn't all clear, it's about 4:30 am here...

    Flash can't directly communicate with any server side technology. What it can do is load .jsp, PHP, .asp, .pl etc. pages that format the output in a way that flash can interpret it. That basic format is as follows:

    &variable=value&variable2=value2&

    Instead of having your Java server page write out HTML, it would write out all of the data that you want to display, (or even give links to pictures that flash could load in) and then once flash loads all of the &variable=value pairs in, it could build the pages dynamically from within the Flash movie. The sizing of the pictures shouldn't be a problem because you can resize/resample them server-side, or resize them once they get loaded into flash.

    If you want to learn more of the details of the Flash side of things, i would suggest that you look at the loadVariables() and LoadVars() objects. These will be the primary methods of getting data in and out of flash.

    Your .jsp page will obviously have to change in it's formatting, as it will no longer be writing an HTML page... one thing you might consider, because it sounds like it might make your data organisation easier, is to format an XML document, instead of the &variable=value method. Flash has a built in XML parser that works pretty well, and it would be a lot clearer as to what data you were loading in. i have actually one no work with .jsp, but i know that PHP has a built in XML class, and .jsp should have the same.

    i wasn't trying to discourage you from the project, i just wanted to let you know that it will take 1) a lot of planning, both server side and client side and 2) a good understanding of dynamic data in Flash, including loadVariables, LoadVars and/or XML in flash.

    cheers,

    bret

IMN logo majestic logo threadwatch logo seochat tools logo