开发者

How to make embeddable flash content?

Hi I'm new to adobe flash/flex so please forgive me i开发者_运维百科f 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.


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">

<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)


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 ryan@adobe.com

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜