[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Swftools-common] wait for SWF to be ready

From: Ian Wilkinson
Subject: Re: [Swftools-common] wait for SWF to be ready
Date: Thu, 29 Jan 2009 18:00:20 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041217

Hi Benedikt,

Here are then my follow-up thoughts...

We have had big problems with web servers (IIS particularly) and web browsers (IE particularly) caching the files when you try to loadmovie in flashplayer. We instigated several techniques, first of all place a random number after the name of the movie that you're loading, eg:

loadmovie("movie.swf?rn="+Math.random(), mc)

Secondly configure the webserver to send the expires header and the (depreciated) PRAGMA: NO-CACHE.

If you can't do this I'd recommend making your php send the content of the movie back, using php to set the caching headers.


Benedikt Quirmbach wrote:

Hello Ian,

I'm sorry that I did not explain my goals!

I want to create SWFs that contain the variabe data by themselfs.

In fact it is a web-banner workbench where you can choose a banner template (my library swf) and "inject" your personal data. After creating this swf you can download it and use it as a banner where you want.

Because you use it as a banner you can't work with url-parameters. It has to be one file and nothing else.

I wrote a Flex application with some php scripts and a database in the background.
The problem is not how to get the variable data into the banner  template.
This works fine!

The problem is, that my Flex application seems to load the newly created swfs bevor they are completed. I don't know how this can be, but it is at this moment the only explanation for what I see: When the application loads the newly created swfs some variable data are missing. When I download the very same swf a little moment later, the data are included and the banner works fine.

But if you want to create this banner, you want to have a working preview in the Flex application...

Maybe there is someone who has allready created a banner workbench like I want. And maybe there are other ways to get the data into the swf. Ofcause I could create the swfs all in SWFC without a Flash template. But there is a lot of animation in the templates what makes it very difficult to write it in a .sc-file. And I don't know whether it fixes my problem or not...


Am 23.01.2009 um 20:17 schrieb Ian Wilkinson:

Benedikt Quirmbach wrote:

some weeks ago I opened a thread here about swfc.
I am still looking for a way to find out wether a SWF is completed.
I have a swf (library-swf) made in Flash.
I want to bring some variables into this swf.
To do that I use SWFC to create a new swf with the library-swf as background image.
In the first frame i introduce an actionscript with my varaibles.
In the library-swf is more actionscript that use this variables.

Hi Benedikt,

I'm from a background of 8 years using Flash with CGI, where our software loads variables thousands of times a day (but please excuse me if I've missed the point of your post).

If all you need is to pass data to php and get it (or other data) back, then you don't need to use SWFC at all.

If you use either the loadvariables(mc,...) command or the loadvariables object you can send changes via GET or POST and have the PHP send back the what you need it to at the same time.

The first time in just call the loadvariables to load what you need and have the php only save what's required when you pass it back out.

Don't be concerned that most of the documentation around loadvariables mentions XML, we don't use any XML in our application as it wastes so much bandwidth (5KB of data we found would be 50KB+ in XML).
Use variable=value and just escape the value.

so a typical string could be:-
&productCount=3&price0=500.00&name0=Self%20Sealing %20Stembolts&price1=25.00&name1=American %20Screwdriver&price2=0.03&name2=Screw&end=1&

If you don't use the object you need to know when all the data is loaded the end=1 does that for you (just set end=0 before calling loadvariables then loop over a couple of frames until end=1), you can leave that out if you use the object, however you should always add an extra ampersand on the end of the string so flash doesn't pick up and stray spaces or enters that the php might output after the data.

Sorry if I've missed the point of your post, if I have then please don't hesitate to expand your requirements and I'll help if I can!

x10 via Web or Wap?

x10 via Web or Wap?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]