A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Post News | Announcments script ?

  1. #1
    Webmaster Johnny Shiro's Avatar
    Join Date
    Jan 2002
    Location
    Norway |Trondheim
    Posts
    713

    Post News | Announcments script ?

    I am desperate after a news script. Go to the main page of FlashKit and take a look at "Announcements" There you have one small thumbnail picture and the text alongside . Anyone know how to do that ? Maybe any php scripts out there ?

  2. #2
    Registered User
    Join Date
    Feb 2001
    Posts
    13,039
    Hi,

    should not be too complex...
    You would have a database with fields
    image,
    newstext (html formatted)
    id and / or posting date

    The script just fetches entries from the database, newest first, and adds a little html to put the image and the text side by side
    Of course it is assumed that images are prepared in the proper size

    It will get a bit more difficult if you want to do the same in flash rather than html

    Nusicman

  3. #3
    Webmaster Johnny Shiro's Avatar
    Join Date
    Jan 2002
    Location
    Norway |Trondheim
    Posts
    713
    Yeah i know..but i am not sure on how to even begin to start though :O You don't have any examples ? Dreamweaver MX makes it quite easy to fetch data from a database, but i am not sure on how to have images in the database. I am running mySQL on my webserver ...

  4. #4
    Registered User
    Join Date
    Feb 2001
    Posts
    13,039
    Hi,

    supposing a database with image and news entries and mysql's insertion id, you could show a html news page lika FK's news from the database with

    $result = mysql_query("SELECT news, image FROM news ORDER BY id DESC");
    print("<table>\n");
    while($entry = mysql_fetch_array($result))
    { print "<tr><td width=40 valign=top><img src={$entry[image]} width=40 height=40></td><td valign=top>{$entry[$news]}</td></tr>\n";
    }
    print "</table>";

    If you want to do something like that as a flash movie, please post back...

    Musicman

  5. #5
    Webmaster Johnny Shiro's Avatar
    Join Date
    Jan 2002
    Location
    Norway |Trondheim
    Posts
    713
    Actually it has to be in flash now The layout demanded it ...

  6. #6
    Registered User
    Join Date
    Feb 2001
    Posts
    13,039
    Hi,

    you have two options, a pure actionscripted approach and a server based approach.
    The actionscripted way would pass news texts and image locations to the movie in response to a loadvariables request, i.e. the database query would return
    news1=Santa Claus revealed...&image1=santa.jpg&news2=the grinch stole...&image2=grinch.jpg
    Once the data are completely received, the actionscript would start to attach emty movieclips and load the images in them. It would also attach text fields to the movie with the autoSite property set to "left", and fill them with the messages
    After every text box is added, take the max of the image height and textbox height to determine placement of the next news item.
    Like in traditional html, all the images will be loaded separately. Also if you want to use specific fonts that the viewer might not have, you have to embed all of them into the movie. This approach requires flash player 6 on the receiving end
    The server-based approach would build a movie in response to a loadmovie request, with all the images embedded into that movie, and likewise all text created as static text. So even if multiple fonts were used, only the characters actually required would be sent This would also allow special behaviour of links inside the text not yet possible with html text fields, e.g color change on rollover) The resulting movie could be made F4 compatible (viewable on cellphones

    Musicman

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