Results 1 to 5 of 5

Thread: php and flash

  1. #1
    Join Date
    Jul 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question php and flash

    Hi, as you know every book has a unique ID - so called ISBN number with 10 digits. You can find this ID on every back side of a book. If I want to see a flash animation for book 1234567890 then the Flash file is loading the images from this book and includes the images in the animation. If I want to see another book, then the flash file is loading the images from another book.

    All pages of a book are saved in a folder: structure like this:

    Books:
    - Book 1234567890
    --image 1
    --image 2
    --image 3
    -- ...
    - Book 2345678901
    --image 1
    --image 2
    --image 3
    -- ...

    I have to make a PHP program that can generate Flash files dynamically. Example: I open PHP script with ID of book 1234567890

    example: flashbuilder.php?ISBN=123456890

    then PHP script opens Flash animation and includes automatically images from folder 1234567890. Then I can open the book and turn pages in this book like above in task1. When I open book with this link flashbuilder.php?ISBN=123456890 then front cover is opened and when I open book then inside pages are loaded.

    Very important: book pages are saved on other server. Script has to load pages via Internet. This means: script cannot download whole 400 pages for this book. My idea (maybe there is better solution): script loads always 2 pages in "cache". When I turn page forward then already 2 pages in cache loaded and animation can work very fast - no waiting for downloading pages from server.

    Also I have to include function to open page in middle of book:

    example: flashbuilder.php?ISBN=123456890&page=220

    When I open book with this link then script loades automatically page 220 on the right and page 219 on the left (because always shown 2 pages: even number is right, odd number is left on screen). In cache is loaded automatically page 217 and 218 and page 221 and 222 (when I touch page 219 then I go back to last pages without waiting for loading images from server because already in cache, when I touch page 220 then loaded page 221 and 222 from cache very fast.)

    "page" - this will be document-ID - in the future all files have this ID as name

    If someone has any ideas please help me. Here is the flash book I made: http://iliyanedelchev.hit.bg/

    Thank you!

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Well, I'm not a Flash guy (pun only slightly intended) so I don't understand half of this, but have the PHP Ming documentation. I strongly suggest you ignore the chap at the bottom with the dodgy email address, His Simpeler PHP Libary, and even His Mate, Matt, Who Dosent Know Much PHP.
    Last edited by Twey; 07-02-2006 at 12:57 AM. Reason: Never rely on the code of someone who hasn't yet mastered fourth-grade spelling. Trust me on this.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    I think you have it backwards, and need to have Flash generate it's own images, called from a PHP script that is inside the swf.

    You will save load time, and wont block people on a dial up, or those who disable cookies, clear cache hourly, or don't want to wait for each loading time.

    Working like a highscore list, in essence, where the POST and VIEW are set to FLASH, instead of HTML. This will show the "image" or "table" or whatever else, inside the swf. You can write the PHP to load the next image and have a small button or mouseOver event on the edge of the virtul pages. When clicked or scrolled over, it will execute the POST methods to the PHP script telling which image to load, pretty simple to keep a base value (the ID of the current book)

    You can have Flash set the ID on a button. Say at the main page of the site, the visitor clicks which book to read, when the link is clicked set var id = 1234567890, then on mouseOver of right page id = _root.id + 1 ( - 1) for the left side.

    The Flash swf will tell the php which image (based on id #) to pull out, then POST to FLASH and the image will show.

    Then basically all you have to rely on for the user is they have the version of Flash player installed and active.


    Even another option since you are going through the trouble of making each page an image anyway, import them to the library, and make them all MCs, then use the mouseOver function to load MC with the next corresponding ID #.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  4. #4
    Join Date
    Jun 2006
    Posts
    182
    Thanks
    0
    Thanked 14 Times in 14 Posts

    Default

    Flash also supports the "GET" method, you can put a flash into document like this: somefolder/flashmovie.swf?isbn=1234567890
    You can then acces this number with: _root.isbn

  5. #5
    Join Date
    Jul 2006
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    mmm. That's good DimX. Thanks. If there are any other suggestions write them down, pleace.

Bookmarks

Posting Permissions

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