Re: cs3 - UILoader Component
Thanks for your fast response, dzedward.
Here goes...I hope you'll bear with me. Since I don't know what type of
background info you need, I'll explain in detail.
Background:
I'm creating a flash presentation that we can display on a large monitor at a
tradeshow. The presentation will simply play from a connected laptop and loop,
without the need for user navigation (no buttons). This is my first time
creating such a long file (I anticipate that this will play for 3-4 minutes
straight) so I thought it would be best if the main timeline were to call and
load successive smaller, stand-alone swfs at selected times, based as the
playhead moves through the timeline in a single pass. I'd be able to minimize
the size of the main file in this way.
Trouble Using AS3:
As a newbie, I don't have much experience with AS3. Using an AS3 script found
online I've been able to load a single swf into the timeline of my main movie
successfully, but when I try to load another later on in the main timeline,
neither swf plays....most of the scripts and forum answers I've come across
over this past few days deal with AS2 or earlier versions, so I can't use or
learn from them.
Using the UILoader Widget:
Thats when I saw reference to using Flash CS3's UILoader Component for this
purpose (accessed via Window>Components menu). What it does is create an empty
container into which you can load an external swf, jpg, or png file. You first
simply drag and drop the widget onto the stage from the component window. Then,
from the container's property window, you choose its dimensions and placement
on the stage. Via the container's parameter window you tell it whether to
autoload the content, maintain aspect ratio, and/or scale the content, as well
as provide the name of the source file you want to load. It seems pretty simple
- even I can do it and can get it to work when I load a jpg or selected swf
file. Upon testing the movie, the jpg or swf plays back INSIDE the container,
scaled down or up based on the container's size as it relates to that of the
source file. So far so good.
You'll see from this widget that you only need to specify "true" or "false"
for the autoload, maintain aspect, and scale content questions. I've done this
inside the widget as I'm not sure how to accomplish this with the scaleContent
and scaleAspectRatio parameters you mention using actionscript.
Problem When Using UILoader Widget:
Here's the problem I'm having. As I mentioned, I've created a short 20-frame
animation output to swf showing a white box that grows in size and changes
shape against a black background, using the same frame rate (30fps)_and
dimensions as my main movie. The animation is a simple shape tween, with no
actionscript other than a stop ( ) ; placed on the last frame of an
actionscript layer to prevent looping. It plays as desired on it's own.
However, when I load it into the UILoader container that is centered on the
stage of my main timeline and then test the movie, two problems occur.
Firstly, the animation does not play inside the container; instead, the upper
left corner of the loaded swf animation shows up where the lower right corner
of the container showed up on the stage (hence I only see one corner of the
animation). Secondly, the animation is cropped; the visible outer edges of the
morphing white box are cut off meaning that I lose the visual effect of the
shape tween.
I saw reference online elsewhere to the possible need to position the
container on the stage such that it's lower right corner is where you want the
upper left corner of the animation to be placed, but this doesn't make sense to
me (it's likely that I misunderstood what I read). I did try this however, and
while doing so allowed me to more correctly center the external animation
within the main movie, it's edges are still cropped. To me it should have been
placed inside of the container and scaled.
I'd love to be able to do this using actionscript 3.0, but I'm having even
more trouble with this and haven't found any comparable tutorials or forums
explaining how to load and unload multiple swfs into a main timeline without
the need to control using buttons or a mouse. I'd like to be able to specify on
the main timeline when a particular swf is played, then do so again later on in
the same timeline with another swf file, and so on.....
I don't know if this explanation will make anymore sense. I could send you the
fla or even screenshots showing what I see during playback of the short
animation inside of my main flash file you can provide me with your address and
feel that it would . It looks like I can only post code from this forum.
Thanks for reading through this and for your possible !
|