FORUMS: list search recent posts

.swf with skin from timeline

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Emily Carmichael
.swf with skin from timeline
on Oct 12, 2010 at 7:07:06 pm

So, I make these movies which I usually output to quicktime (which is of course not very fun.)

I would like instead to publish them as .swfs, so I can host them here:

(This page is embedding from the file hosted here:

so it's basically working, but what I want is a .swf that

-doesn't autoplay or loop
-is larger than the native size of the flash document it comes from.

I have read this tutorial:

So having a skin with play controls on my .swf sounds perfect, but most instructions out there seem to only apply to .swfs created from .flvs. Mine are created from animation that exists in the timeline.

I can't get AME to encode my .swfs into .flvs, and anyways that doesn't seem to be the right way to do it.

Again, the main goals are:
1. Swf does not autoplay or loop
2. I have control over the scale of the swf

Preferably the .swf is nice and small, like a .swf, and not comparatively large like an .flv.

I am using CS4 but I also have and use CS3.

Return to posts index

demetri tashie
Re: .swf with skin from timeline
on Oct 13, 2010 at 4:38:43 am

hi emily

a swf accessed directly from the server - such as your :
will scale to whatever size the browser is, and will keep scaling larger or smaller as the browser is scaled.
once a swf is placed into a html file, it will be placed into the file at whatever the stage size was when creating the swf( its 'native' size) - unless of course you choose to overide those dimensions yourself. the same is pretty much true for a swf loaded into another swf.

if your swf is timeline based, you will need a means to prevent the timeline from playing - usually by placing a stop(); command on the first frame.

that stop action would also prevent it from looping- it would stop again on the first frame after it had played.
if you need it to stop on the last frame you either need a stop action also on the last frame, or if hopefully all your code is kept on the first frame, then you need an Enter_Frame event listener to register when the last frame has been reached and to execute a stop command. we can help you with that if that is the way you choose to go....

i am concerned that there might be confusion when talking about a 'skin' to control playing the swf , that you are refering to flv player 'skins' which of course play video format files, not swfs, which could be played either directly by buttons in that swf, or by buttons in another swf/loader which control the playing of an externally loaded swf.

of course video 'skins' are just specialized swfs.......

hope that helps rather than confuse : - )

Return to posts index

Emily Carmichael
Re: .swf with skin from timeline
on Oct 13, 2010 at 5:25:17 am

Oh my gosh, okay, I think I understand. So I add my stop command so it doesn't autoplay.

But then how does it play? Do I need to design my own buttons? (I actually tried laying one of the Adobe skins on top of the timeline on its own layer--which of course did not work.)

I didn't quite understand the bit about stopping on the last frame--why would I need it to do this?

And you mention overriding the native dimensions--that's exactly what I want to do! How do I do that, exactly? Oh does it have to be in the html? I don't have a lot of control over that since it's being hosted at a webcomic site...

Thank you so so much for this response! This makes so much more sense now!

OH!! Could I make a new FLA which is the size I want, then import the tiny .swfs, scale them up and export again? (.swf-within-a-.swf?)

Return to posts index

Brodd Nesset
Re: .swf with skin from timeline
on Oct 13, 2010 at 7:38:59 am

By default, any .SWF will go into a 'play' state as soon as it has loaded enough of itself. It makes sense, somehow. To stop this, you need to write that little stop(); command.
By default, any Movieclip is set to loop as well. The Stage is, technically speaking, a MovieClip too, so it will have the same behaviour. It means you need the stop(); at the end as well.
Video can be set to different behavoiurs using f.i. the playback skin (component), it will issue the commands needed for you, somewhat hidden.

You will likely need a button, and a corresponding script. Demetri wrote a basic button script in a previous post:

btn.addEventListener(MouseEvent.CLICK, playMe);
function playMe(e:MouseEvent):void
play(); //lots of different commands can go here

Now, just about any element can act as a button; Movieclips and dedicated buttons, even imported little .swf's - including the video playback controls available. What you need to do is to always name the instance: click on it on Stage, give it a name in the Properties panel.
Here you give it the name 'btn' - it is absolutely required that it's the same name which is found in the script right before .addEvent... - concider them a pair. You can alter name-pairs pretty freely, as long as the name before .addEvent... is equal to a named element actually present on the Stage.
I estimate that 98% of all errors in Flash are because this is overlooked or simple misspellings, so get this concept under your skin NOW.
Please observe that if you go for an imported video playback skin, any progress bar won't work. By default it works on video only, but it's totally feasable to link it to a frame count in an .swf instead.

You can import your animation into a new FLA and scale to fit, like you suggest.

Not everything that can be counted counts, and not everything that counts can be counted.

Return to posts index

Emily Carmichael
Re: .swf with skin from timeline
on Oct 13, 2010 at 1:21:57 pm

Oh, thank you Brodd, also!

I've done buttons before and that all makes sense!

Unfortunately importing a .swf into a .fla DOES NOT WORK. None of the internal movies play (I have exactly the same problem when exporting image series) and it insists on .jpg compression, which looks awful for this type of image.

So I totally have a grasp on the play thing now, but I'm still working on the size thing.... hoping I can make it inherent to the .swf itself, since the coding on the webhost is pretty hard for me to understand. But I can crack it if I have to.

Thanks again for your help!

Return to posts index

Emily Carmichael
Re: .swf with skin from timeline
on Oct 13, 2010 at 2:57:27 pm


Okay so what I'm doing is making a new, larger .fla, making a movie clip for each scene, pasting the frames and layers from the scene into the movie clip, scaling the movie clip up on the stage and making buttons for it. Also that's good because I think it's easier to write buttons for a clip than for the whole timeline.

So far so good!

(haven't written the buttons yet.)

Return to posts index

Brodd Nesset
Re: .swf with skin from timeline
on Oct 14, 2010 at 1:47:19 pm

Sure, you should import the SWFs into individual MovieClips. Then scale those, easily. Sometimes I don't visualilze the whole picture.

Not everything that can be counted counts, and not everything that counts can be counted.

Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 All Rights Reserved