A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Creating embeddable SWF's

  1. #1
    Junior Member
    Join Date
    Nov 2007
    Posts
    1

    Creating embeddable SWF's

    Hey mates,

    I have a simple PHP page that I want to make into an embeddable....

    It contains an input box for people to type some text (this saves into a DB). Then, on the right side, there is a flash SWF that pulls the text from the DB and makes the text look fancy.

    These are two elements that need to be enclosed into 1 embeddable for a few of my friends to place on their blogs for fun.

    I know most embeddable are just one clean swf file, but how would I integrate a SWF and it's surrounding PHP into one embeddable without having to do either of these last-resorts:

    a) iframe the whole thing ... technically feasible, but not ideal.
    b) remake the entire thing into one SWF (which takes a lot of work and re-design)

    Any JS methods to make the embeddable code clean? (just a guess)


    Thanks so much to anyone who may know....

    Even if you don't, a good starting point on customizing embeddables would be wonderfully helpful!

  2. #2
    Senior Member
    Join Date
    Nov 2003
    Location
    Las Vegas
    Posts
    770
    Why not just have the input box in the same SWF as the resulting "fancy text"? You use loadVars to send the text typed in to your PHP script, and it returns what you need for your "fancy text".

  3. #3
    Official FK nice guy and MOD 3PRIMATES's Avatar
    Join Date
    Apr 2002
    Location
    Portland Oregon
    Posts
    1,645
    Hi there. Well I would suggest you host the php and Database on your server and then just call to it from the movie that is embedded on another domain.

    You will need to add a crossdomain policy to the root directory of the server that will be holding the script though.

    Create an xml file called crossdomain.xml and add the following:

    Code:
    <?xml version="1.0"?>
    <!DOCTYPE cross-domain-policy 
      SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
    <cross-domain-policy>
      <allow-access-from domain="www.someRemoteHost.com" />
      <allow-access-from domain="someRemoteHost.com" />
    </cross-domain-policy>
    
    //If you wish to allow acces to all subdomains on a certian host you would add:
    <allow-access-from domain="*.someRemoteHost.com" />
    //or if you want to allow everyone to have script access
    <allow-access-from domain="*" />

    then you would just call the php file from your swf on a different server to access the script and the database.

    Hope it Helps.

    3P

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