PDA

View Full Version : SWF parameters


samflores
09-09-2004, 07:13 AM
I have a SWF movie (made in Flash MX 2004) with an ActionScript variable that i used to set passsing a query string to the movie through the HTML file published. Take a look at HTML markup below:

...
<object ...>
<param name="movie" value="movie.swf?var=value"/>
...
<embed src="movie.swf?var=value" .../>
</object>
...

The question is: how can I set that variable if I load that movie as a resource in a LZX code?

antun
09-09-2004, 08:37 AM
This kind of ActionScript <-> LFC interaction is not supported. SWFs can be used as resources and as animations, but you can't have ActionScript inside of them. There's a number of reasons for this, not the least of which are that it's virtually impossible to support, and the next runtime that Laszlo supports might prohibit this.

What is it about the functionality of the SWF that's preventing you from building that in LZX?

-Antun

samflores
09-09-2004, 09:05 AM
The SWF movie uses that variable to load an image into it.

I know i can load the image directly into the LZX code through <resource> tags, but the SWF have a shape with alpha set to 50% that partially cover the iamge loaded.

What do you think can I do?

antun
09-09-2004, 09:13 AM
Originally posted by samflores
... but the SWF have a shape with alpha set to 50% that partially cover the iamge loaded.

What do you think can I do?

You could have two views, one on top of the other:

- The lower view would be the view you load the image into using setSource().
- The upper view could have the shape as a resource and have its opacity set to between 0 and 1.

Does that make sense?

-Antun

samflores
09-09-2004, 09:46 AM
I've ever thought about that, but the other way would be great once I have the SWF movie already done. :)

The LPS is a wonderful tool, but the ActionScript functionalities whould make it perfect.

I'll do that...

thx a lot.