Results 1 to 7 of 7

Thread: integrating php includes with flash

  1. #1

    integrating php includes with flash

    Hi. I am having a hard time finding the answer to my question in other threads, so I've just created my own.

    I am doing a website for a band, the header (the logo, bandname and menu) is all going to be in flash. And each of those elements have some tweens on them doing different effects (ie. changing color at a certain time, sliding in and out of view, etc).

    What I'd like is to be able to click on the menu and have a php include load above the flash movie. But when you use php includes, it basically reloads the page with different information, which means that the flash movie header I made would start over again, instead of being paused at the point it was when the menu item was selected. Am I confusing??

    Anyway.. I want to know if I can use includes, and still have the movie stop at a certain spot when the page is reloaded with the include.

    If I can't do that, can someone give me REALLY BASIC and simple instructions on how to pull data from an external php file to appear in the flash movie. I don't know how to make a mysql table and stuff... um... I don't think.

    Sorry for rambling. Thanks for the help!!

  2. #2
    What is it that you are actually trying to do? There is probably a way to achieve it without using PHP includes.

  3. #3
    Maybe you could use frames and load the php files in them?

  4. #4

    Yeah I thought of using frames, but I think I kind of want to avoid using them if I can. The thing I like about php includes is that they're easy for to maintain.

    I could do something if I knew how to display php within the flash movie. I tried using a tutorial, but I don't know how to build a mysql table. I don't understand that part. I think I need simpler instructions haha.

    I guess I'll just drop my question in my original post and instead ask: Can someone help me load my site content from external phps? I don't know what I'm doing... at all.


  5. #5
    I use this code to load stuff into flash from php
    PHP Code:
    var new_lv:LoadVars = new LoadVars();
    new_lv.onLoad = function(success:Boolean):Void  {
     
    sending._visible false;
     if (
    success) {
      
    trace(new_lv.theVariable);
      
    statusmsg.htmlText new_lv.theVariable;
     } else {
      
    statusmsg.htmlText "Error opening phpfile";
     }
    }; 
    Partial php code, the echo part does the sending back
    PHP Code:
    $writeItfwrite($file$xmlString);
       if (
    $writeIt){
        
    $sendBack "&theVariable=Your text has been saved&"
        echo 
    $sendBack
       }else{
        
    $sendBack "&theVariable=Error saving file&"
        echo 
    $sendBack;
       } 

  6. #6
    Okay. I'll give that a try. Thanks!

  7. #7
    Okay when I try to do that I get some syntax errors back:

    **Error** Scene=Scene 1, layer=text box, frame=1:Line 2: '{' expected
    new_lv.onLoad = function(success:Boolean):Void {

    **Error** Scene=Scene 1, layer=text box, frame=1:Line 10: Unexpected '}' encountered
    };

    Total ActionScript Errors: 2 Reported Errors: 2



    So..... where exactly does the expected '{' go?
    I'm using MX 2004... does that make a difference in the code?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012