PDA

View Full Version : Using Flash when SWF needs to load files



Lee_Benson
11-29-2003, 02:03 PM
Hey dudes,

Got a quick Q, regarding Flash in AMS 5.

I'm using Camtasia Studio 2 to record/capture screen recordings, and encode them as SWF files.

All is great - except, Camtasia outputs 5 files for each SWF file.

If my video was called "newtest", the following files would be output:

- newtest.html (the HTML to load the Flash. Not needed in AMS, obviously)
- newtest.swf (the actual encoded video file itself)
- newtest_preload.swf (the screen that preloads the main video)
- newtest_controller.swf (the SWF that's first loaded by the HTML, to control it all)
- newtest_config.xml (An XML file that newtest_controller.swf loads, to find out the file paths to each of the SWF files, and other config settings)

The following code is output in the "newtest.html" file:



--- newtest.html

<head>
<title>Macromedia Flash (SWF) Movie Created by Camtasia Studio 2</title>
</head>
<body bgcolor="#FFFFFF">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"

codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#ve

rsion=5,0,0,0" width="800" height="617" id="myMovieName">
<param name="movie"

value="newtest_controller.swf?csConfigFile=newtest_config .xml">
<param name="quality" value="high">
<param name="bgcolor" value="#FFFFFF">
<param name="FlashVars" value="csConfigFile=newtest_config.xml">
<embed src="newtest_controller.swf?csConfigFile=newtest_config .xml"

FlashVars="csConfigFile=newtest_config.xml" quality=high bgcolor=#FFFFFF

width=800 height=617 type="application/x-shockwave-flash"

pluginspace="http://www.macromedia.com/go/getflashplayer">
</embed>
</object>
</body>
</html>

---


And the following is in "newtest_config.xml"



--- newtest_config.xml

<config>
<AutoStart>1</AutoStart>
<MovieWidth>800</MovieWidth>
<MovieHeight>600</MovieHeight>
<BackgroundColor>FFFFFF</BackgroundColor>
<MovieURL>newtest.swf</MovieURL>
<ShowLoadingMov>1</ShowLoadingMov>
<LoadingMovURL>newtest_preload.swf</LoadingMovURL>
<ScaleLoadingMov>1</ScaleLoadingMov>
<LoadingMovPercentToLoad>20</LoadingMovPercentToLoad>
<LoadingMovMinDuration>2</LoadingMovMinDuration>
<ControllerColor>C0C0C0</ControllerColor>
<ShowFFRW>1</ShowFFRW>
<ShowAbout>1</ShowAbout>
<AboutBoxText>Just a test movie, for now!</AboutBoxText>
<TimeDisplayFormat>MM:SS</TimeDisplayFormat>
<ShowDuration>1</ShowDuration>
<ShowElapsedTime>1</ShowElapsedTime>
<TimeDisplayFont>Arial</TimeDisplayFont>
<TimeDisplayFontColor>000000</TimeDisplayFontColor>
</config>

---


Now, I'm having a bit of trouble loading these files into AMS 5.

I tried inserting "newtest_controller.swf" as a new Flash object, and then using the Flash.SetFlashVariable action to set "csConfigFile" to "newtest_config.xml" inside the Flash object. But that didn't work. Nothing happens.

You can see the HTML and XML that is being used above, that works fine when all the files are in the same directory, and the HTML is called directly from a web browser. How would I translate THAT over to AMS 5?

How do I load query string variables, like the web browser does, into a Flash file? Is that done with the Flash.SetFlashVariable action, or do I use something else? Where do I set it - OnFSCommand, or OnLoad in the page?

Corey, you're the Flash whizz - do you have any ideas mate?

Thanks a lot!

AaronCooper
11-30-2003, 06:59 PM
If I understand what it outputs, it appears that it is configuring the files for WEB.

One possible fast work around is to have Autoplay open a local URL pointing to the html file.

I have not used Camtasia Studio 2, is there a setting to have it export it as one flash file?

Corey
11-30-2003, 07:21 PM
Sure, we can figure something out. Try this first:

Place the loader .swf and the movie .swf in the same directory, i.e. your project's AutoPlay\Flash folder and then add the loader .swf to your project as a Flash object. Try that and let us know if it works, probably should.

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)

Lee_Benson
12-01-2003, 06:45 AM
Hey,

Thanks for your suggestons guys - unfortunately, none of those seem to
work. I had tried both prior to your replies.

Firstly Aaron, I *could* make a Web Window - but that kind of seems overkill
to what I want to do. Although IE's interface/engine is built into all parts
of Win XP (or at least seems to be), I don't want to additional overhead of
loading a browser inside the window, if all I'm going to do is run Flash.

Secondly, it takes away an element of control - if I run it within the web
window, then I can't do Flash.SetFlashVariable, or Flash.Play, etc. I would
like to build a custom interface around some of my Flash files, and have
full access to control it.

Corey - I also tried what you suggested (simply loading the newtest_controller
SWF file as a Flash object, and moving the other Flash files to the same
directory). The screen is just black - which means the controller file is
loaded, but it wasn't able to run newtest_preload.swf or the newtest.swf video
file itself.

I also tried adding this line:

Flash.SetFlashVariable("Flash1", csConfigFile, newtest_config.xml);

To both OnFSCommand (in the Flash object's "Actions" window), and also as an
OnShow page action for when the page first loads. The former does nothing, the
later produces an error.

I've zipped up all the Flash files and uploaded them to the web. If you could
spare a few minutes looking at this, I'd really appreciate it.

The file size is 1.35mb (just slightly too high to attach to this board), and
you can grab it at:

http://omaclub.com/dev/files/newtest.zip

Try unzipping the files to any directory, first of all, and double-click on
newtest.html. You should see the Flash file. That's basically what I'd like
to be shown in an AMS 5 project.

If you could somehow find a way to let that be shown inside of AMS, without
going the Web Browser object route, that would be awesome - I'd owe you one.

Thanks guys!

Corey
12-01-2003, 06:59 AM
Well in this case, to deploy that particular .swf I think it would have to be done via a web object, since it doesn't load in a Flash Player. Someone else may know something I don't though. In general you can only insert Flash objects which play properly when launched in a standalone Flash player, i.e. if a .swf doesn't play properly in standalone player you may have difficulties inserting it as a Flash object. Wish I could offer more...

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)

Lee_Benson
12-01-2003, 08:02 AM
Thanks Corey - looks like I'll have to use the Web Object then.

Thing is, whenever I created an object window of 800x600 size for an 800x600 video file, scroll bars appear.

How many pixels (height and width) do I need to add to remove the scrollbars? I'd like the page to fit the video exactly, so there's no formatting issues. Any ideas?

(I'm talking about a web object, of course)

Cheers!