tags:

views:

56

answers:

2

Hi I'm new to adobe flash/flex so please forgive me if my question isn't too clear. I'm developing a website with a flash object that dynamically generates its content and I want the flash object itself to be embeddable into other website like how youtube does it. I have no clue how to approach this and any help would be really appreciated.

+4  A: 

You need two things:

1) Distribute the url or embed code for your swf online somewhere (like done in youtube). You get the code by publishing your flash object and then copy paste the html embed tags.

2) If you're dynamically loading stuff into the flash object you will need to allow data loads from all hosts. Lets say that you have a source file at www.domain.com that the flash object loads. Some one takes the Flash application and puts it on their site at www.otherdomain.com. This application then tries to do a cross domain data load www.otherdomain.com <- www.domain.com. That will fail unless you have you explicitly allow cross domain loads for www.domain.com. You do this by adding a crossdomain.xml file to your websites root or preferably the folder where the source file is kept. If you put in the webroot then all content hosted there will be available to load from anywhere. The xml file should contain all the domain that are allowed to load anything from your domain (in this case it should just contain a * to allow any domain to load from your domain).

Here's a basic example that allows any domain to load data

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM
"http://www.adobe.com/xml/dtds/cross-domain-policy.dtd"&gt;

<cross-domain-policy>
    <allow-access-from domain="*"/>
</cross-domain-policy>

More info on that (http://www.adobe.com/devnet/articles/crossdomain_policy_file_spec.html)

Matti
A: 

The above answer is better than this one, but if you're brand new to Flash and Flex you might want to look into Adobe's distribution servies - http://www.adobe.com/flashplatform/services/distribution/ - I'm not sure if it will do everything you want but for a newbie it might not be a bad way to go.

=Ryan [email protected]

ryanstewart