A Flash Developer Resource Site

Results 1 to 13 of 13

Thread: Dynamic events listing

  1. #1
    con[fuzed] designer
    Join Date
    Jan 2003
    Location
    UK
    Posts
    314

    Dynamic events listing

    I need to make a page on a site that will display upcoming events at a nightclub. it would need to display the name of the night, what it is, when it is and a flyer of the night. the client wants to be able to update this themselves. The two options that make the most sense to me would be using xml or php/mySQL. Has anyone done anything similar to this, any advice on how to go about this would be mcuh appreciated.

    Thanks.

  2. #2
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Trusting clients to update an xml file themselves?

    Most of them would even have a hard time updating a simple text file, worst if it was to be an html formated (and Flash compatible!) one!

    I'd definately go for a text file though!

  3. #3
    con[fuzed] designer
    Join Date
    Jan 2003
    Location
    UK
    Posts
    314
    Oldnewbie. as clients go they are quite computer literate having both worked in the IT industry. i do get your point though, their mistakes end up affecting my professionalism when they cause the page to fail.

    How would i go about setting up what i want just from a text file?

    Thanks.

  4. #4
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    L'exception confirme la règle!

  5. #5
    con[fuzed] designer
    Join Date
    Jan 2003
    Location
    UK
    Posts
    314
    for sure, a text file would probably be preferable, the clients know basic html aswell so basic html formatting would be possible, i could create template files for them to use anyway.

  6. #6
    con[fuzed] designer
    Join Date
    Jan 2003
    Location
    UK
    Posts
    314
    Would be easy enough to draw all info from a text file but how could i associate a particular image with a section of text so i could have a row of info and an image on the end?

    i'm currently loading the txt like this:

    Code:
    textclip.home.autoSize = true;
    loadVarsText = new LoadVars();
    loadVarsText.load("text/home.txt");
    //assign a function which fires when the data is loaded:
    loadVarsText.onLoad = function(success) {
         if (success) {
              trace("done loading");
              textclip.home.html = true;
                                    textclip.home.htmlText = this.var1;
    
         } else {
              trace("not loaded");
         }
    };

  7. #7
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    You want an image in the textfield? Are you on MX2004?

  8. #8
    con[fuzed] designer
    Join Date
    Jan 2003
    Location
    UK
    Posts
    314
    no i'm on MX, i dont want to actually display the img in a text field, (more likely a dynamically created mc), I just need to be able to pass 4 pieces of text data over(name of night, what it is, date, cost.) and somehow a means of displaying a flyer for that particular night. I would then want to be able to place this information into a table structure for display in flash. There would of course have to be multiple rows, one row for each night.

    Thanks.
    Last edited by robjmills; 01-15-2004 at 11:56 AM.

  9. #9
    con[fuzed] designer
    Join Date
    Jan 2003
    Location
    UK
    Posts
    314
    Oldnewbie, i know that you recommended a txt file but considering the nature of the data dont you think that an xml file would make more sense. i cannot see how i could pass across the information needed from a text file for multiple events listings.

  10. #10
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    I didn't recommend a text file... Only said that for a majority of clients, updating a html formated text file, was already an almost impossible task. Now if you're going to ask them to update an XML file, then IMHO, you're taking a lot of risks.
    But as you said, these particular clients could possibly do it, so use your XML file. Address the text file issue, next time, if the client doesn't feel up to updating a XML.

  11. #11
    con[fuzed] designer
    Join Date
    Jan 2003
    Location
    UK
    Posts
    314
    I suppose its just a case of trial and error at first, i'm pretty sure that they will be able to cope with a xml file as long as i keep it fairly basic for them. I havent really done much with xml in flash, once the xml is loaded have u any ideas how i could dynamically create a text box for each piece of text and an mc for each image and load this all into an mc?

    Thanks again.

  12. #12
    con[fuzed] designer
    Join Date
    Jan 2003
    Location
    UK
    Posts
    314
    Right i've got my basic xml file, events.xml:

    PHP Code:
    <?xml version="1.0" encoding="iso-8859-1"?>
    <events>
        <night>
            <name>Flex</name>
            <what>Drum and Bass</what>
            <when>21/01/04</when>
            <price>£5</price>
            <imgSrc>flex_flyer.jpg</imgSrc>
        </night>
        <night>
            <name>Seen</name>
            <what>Techno</what>
            <when>24/01/04</when>
            <price>£3</price>
            <imgSrc>seen_flyer.jpg</imgSrc>
        </night>
        <night>
            <name>Ruffneck Ting</name>
            <what>Drum and Bass</what>
            <when>27/01/04</when>
            <price>£6</price>
            <imgSrc>ruffneck_flyer</imgSrc>
        </night>
    </events>
    and i trace that file in flash using:

    Code:
    eventsXML = new XML();
    eventsXML.ignoreWhite = true;
    eventsXML.onLoad = myLoad;
    eventsXML.load("events.xml");
    
    function myLoad(){
    	for (i = 0; i < this.firstChild.childNodes.length; i++){
    		trace("Name: " + this.firstChild.childNodes[i].childNodes[0].firstChild);
    		trace("What: " + this.firstChild.childNodes[i].childNodes[1].firstChild);
    		trace("When: " + this.firstChild.childNodes[i].childNodes[2].firstChild);
    		trace("Price: " + this.firstChild.childNodes[i].childNodes[3].firstChild);
    		trace("Image: " + this.firstChild.childNodes[i].childNodes[4].firstChild);
    		trace("---------------------");
    	}
    In place of the traces i need to dynamically draw a text box for the first 4 items and then an mc to hold the image and then start a new row and repeat for all entries, any ideas?
    Last edited by robjmills; 01-15-2004 at 01:12 PM.

  13. #13
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Sorry, I've never done anything with XML myself. Somebody else will have to pick up on this.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center