Preview / Browse SWF File


Today I have so many SWF file which I need to view it one by one, instead of double-click each SWF file to preview on browser, I search on google for a utility which can browse or preview SWF files. I found this site provide free utility which does the  job.

I also found this site, but didn’t tested the product yet, and this site too seems have the tool which does in different way. have a try…

MovieClip.createTextField


MovieClip.createTextField

Availability
Flash Player 6.

Usage
myMovieClip .createTextField ( instanceName , depth , x , y , width , height )

Parameters
instanceName A string that identifies the instance name of the new text field.

depth A positive integer that specifies the depth of the new text field.

x An integer that specifies the x coordinate of the new text field.

y An integer that specifies the y coordinate of the new text field.

width A positive integer that specifies the width of the new text field.

height A positive integer that specifies the height of the new text field.

Returns
Nothing.

Description
Method; creates a new, empty text field as a child of the movie clip specified by the MovieClip parameter. You can use the createTextField method to create text fields while a movie plays. The text field is positioned at ( x , y ) with dimensions width by height . The x and y parameters are relative to the container movie clip; these parameters correspond to the _x and _y properties of the text field. The width and height parameters correspond to the _width and _height properties of the text field.

The default properties of a text field are as follows:

type = "dynamic"
border = false
background = false
password = false
multiline = false
html = false
embedFonts = false
variable = null
maxChars = null

A text field created with createTextField receives the following default TextFormat object:

font = "Times New Roman"
size = 12
textColor = 0x000000
bold = false
italic = false
underline = false
url = ""
target = ""
align = "left"
leftMargin = 0
rightMargin = 0
indent = 0
leading = 0
bullet = false
tabStops = [] (empty array)

Example
The following example creates a text field with a width of 300, a height of 100, an x coordinate of 100, a y coordinate of 100, no border, red, and underlined text.

_root.createTextField("mytext",1,100,100,300,100);
mytext.multiline = true;
mytext.wordWrap = true;
mytext.border = false;

myformat = new TextFormat();
myformat.color = 0xff0000;
myformat.bullet = false;
myformat.underline = true;

mytext.text = "this is my first test field object text";
mytext.setTextFormat(myformat);

See also
TextFormat (object)

Source:

http://www.adobe.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary513.html

Creating an application with the FLVPlayback component


You can include the FLVPlayback component in your application in the following ways:

  • Drag the FLVPlayback component from the Components panel to the Stage, and specify a value for the contentPath parameter.
  • Use the Video Import wizard to create the component on the Stage, and customize it by selecting a skin.
  • Use the MovieClip attachMovie() method to dynamically create an FLVPlayback instance on the Stage, assuming the component is in the library.

To drag the FLVPlayback component from the Components panel:

  1. In the Components panel, click the Plus (+) button to open the FLV Playback – Player 8 entry.
  2. Drag the FLVPlayback component to the Stage.
  3. With the FLVPlayback component selected on the Stage, locate the Value cell for the contentPath parameter in the Parameters tab of the Component inspector, and enter a string that specifies one of the following:
    • A local path to an FLV file
    • A URL to an FLV file
    • A URL to an XML file that describes how to play an FLV file

    For information on how to create an XML file to describe one or more FLV files, see Using a SMIL file.

  4. On the Parameters tab in the Component inspector, with the FLVPlayback component selected on the Stage, click the Value cell for the skin parameter.
  5. Click the magnifying-glass icon to open the Select Skin dialog box.
  6. Select one of the following options:
    • From the drop-down Skin list, select one of the predesigned skins to attach a set of playback controls to the component.
    • If you created a custom skin, select Custom Skin URL from the pop-up menu, and enter, in the URL text box, the URL for the SWF file that contains the skin.
    • Select None, and drag individual FLV Playback Custom UI components to the Stage to add playback controls.
      NOTE In the first two cases, a preview of the skin appears in the viewing pane above the pop-up menu.
  7. Click OK to close the Select Skin dialog box.
  8. Select Test Movie from the Control menu to execute the SWF file and start the video.

To use the Video Import wizard:

  1. Select File > Import > Import Video.
  2. Indicate the location of the video file by selecting one of the following options:
    • On my local computer
    • Already deployed to a web, FCS, or FVSS server
  3. Depending on your choice, enter either the path or the URL that specifies the location of the video file; then click Next.
  4. If you selected a file path, you’ll see a Deployment dialog box next where you can select one of the options listed to specify how you would like to deploy your video:
    • Progressive download from a standard web server
    • Stream from Flash Video Streaming Service
    • Stream from Flash Communication Server
    • Embed video in SWF and play in timeline
    WARNING Do not select the Embed Video option. The FLVPlayback component plays only external streaming video. This option will not place an FLVPlayback component on the Stage.
  5. Click Next.
  6. Select one of the following options:
    • From the drop-down Skin list, select one of the predesigned skins to attach a set of playback controls to the component.
    • If you created a custom skin for the component, select Custom Skin URL from the pop-up menu, and enter the URL for the SWF file that contains the skin in the URL text box.
    • Select None, and drag individual FLV Playback Custom UI components to the Stage to add playback controls.
      NOTE In the first two cases, a preview of the skin appears in the viewing pane above the pop-up menu.
  7. Click OK to close the Select Skin dialog box.
  8. Read the Finish Video Import dialog box to note what happens next, and then click Finish.
  9. If you have not saved your FLA file, a Save As dialog box appears.
  10. Select Test Movie from the Control menu to execute the SWF file, and start the video.

To create an instance dynamically using ActionScript:

  1. Drag the FLVPlayback component from the Components panel to the Library (Window > Library).
  2. Add the following code to the Actions panel on Frame 1 of the Timeline. Change install_drive to the drive on which you installed Flash 8 and modify the path to reflect the location of the Skins folder for your installation:
    import mx.video.*;
    this.attachMovie("FLVPlayback", "my_FLVPlybk", 10, {width:320, height:240, x:100, y:100});
    my_FLVPlybk.skin = "file:///install_drive|/Program Files/Macromedia/Flash 8/en/Configuration/Skins/ClearOverPlaySeekMute.swf"
    my_FLVPlybk.contentPath = "http://www.helpexamples.com/flash/video/water.flv";

    The attachMovie() method belongs to the MovieClip class. You can use it create an instance of the FLVPlayback component because the FLVPlayback class extends the MovieClip class.

    NOTE Without setting the contentPath and skin properties, the generated movie clip will appear to be empty.
  3. Select Test Movie from the Control menu to execute the SWF file and start the FLV file.

———————————————————————————————-

This doesn’t work:
this.attachMovie(“FLVPlayback”, “my_FLVPlybk”, 10, {width:320, height:240, x:100, y:100});

The width and height parameters are not applied. The x and y parameters are applied correctly.

This works:
this.attachMovie(“FLVPlayback”, “my_FLVPlybk”, 10, {_width:320, _height:240, x:100, y:100});

The width and height parameters are applied correctly. The x and y parameters are applied correctly.

This also works:
this.attachMovie(“FLVPlayback”, “my_FLVPlybk”, 10, {_width:320, _height:240, _x:100, _y:100});

The width and height parameters are applied correctly. The x and y parameters are applied correctly.

Why?

It’s because the FLVPlayback is a component and extends the movieclip class?
———————————————————————————————-

I got the code to work just fine…
this.attachmovie(“FLBPlybk”, “myFLVPlybck.”, this.getNextHighestDepth());
myFLVPlybck.contentpath = _level0.datareadinfromfile;
myFLVPlybck.autoSize = true;
myFLVPlybck.autoPlay = true;

However, my problem is that this is a generalized player and each symbol may or may not play an flv, depending on need. I got this running fine by including the code in the instance of each symbol. But my bosses prefer to have it all in a class so that any changes to the code need only be done once. I have tried creating a class. It instantiates just fine but doesn’t seem to play the flv.
———————————————————————————————-

source:

http://livedocs.adobe.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00003479.html#3795136

Playing back external FLV files dynamically


You can load FLV files at runtime to play in a SWF file. You can load them into a video object or into a component such as the FLVPlayback component. The following example shows how to play back a file named clouds.flv in a video object.

To play back an external FLV file in a Flash document:

  1. Create a new Flash document called playFLV.fla.
  2. In the Library panel (Window > Library), select New Video from the Library
    pop-up menu.
  3. In the Video Properties dialog box, name the video symbol and select Video (ActionScript controlled).
  4. Click OK to create a video object.
  5. Drag the video object from the Library panel to the Stage to create a video object instance.
  6. With the video object selected on the Stage, type my_video in the Instance Name text box in the Property inspector (Window > Properties > Properties).
  7. Select Frame 1 in the Timeline, and open the Actions panel (Window > Actions).
  8. Type the following code in the Actions panel:
    this.createTextField("status_txt", 999, 0, 0, 100, 100);
    status_txt.autoSize = "left";
    status_txt.multiline = true;
    // Create a NetConnection object
    var my_nc:NetConnection = new NetConnection();
    // Create a local streaming connection
    my_nc.connect(null);
    // Create a NetStream object and define an onStatus() function
    var my_ns:NetStream = new NetStream(my_nc);
    my_ns.onStatus = function(infoObject:Object):Void {
        status_txt.text += "status (" + this.time + " seconds)\n";
        status_txt.text += "\t Level: " + infoObject.level + "\n";
        status_txt.text += "\t Code: " + infoObject.code + "\n\n";
    };
    // Attach the NetStream video feed to the Video object
    my_video.attachVideo(my_ns);
    // Set the buffer time
    my_ns.setBufferTime(5);
    // Begin playing the FLV file
    my_ns.play("http://www.helpexamples.com/flash/video/clouds.flv");
  9. Select Control > Test Movie to test the document.

For information on preloading FLV files, see “Preloading FLV files” on page 507. For information on dynamically loading FLV video into components, see Creating an application with the FLVPlayback component. For information on FLV files and the server, and FLV files and playing FLV files locally on the Macintosh, see About configuring FLV files for hosting on a server.

——————————————–

The statement that null must be passed to the connect method is confusing because it’s not always true. When connecting to the Flash Media Server to stream an FLV you DO WANT to pass a URI, for example:

var nc:NetConnection = new NetConnection();
nc.connect(“rtmp://myflashmediaserver.com/myapp”);

———————————————

source:

http://livedocs.adobe.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00001571.html#189454

Creating text fields at runtime


You can use the createTextField() method of the MovieClip class to create an empty text field on the Stage at runtime. The new text field is attached to the timeline of the movie clip that calls the method.

To dynamically create a text field using ActionScript:

  1. Select File > New and then select Flash Document to create a new FLA file.
  2. Type the following ActionScript on Frame 1 of the Timeline:
    this.createTextField("test_txt", 10, 0, 0, 300, 100);

    This code creates a 300 x 100-pixel text field named test_txt with a location of (0, 0) and a depth (z-order) of 10.

  3. To access the methods and properties of the newly created text field, use the instance name specified in the first parameter of the createTextField() method.For example, the following code creates a new text field named test_txt, and modifies its properties to make it a multiline, word-wrapping text field that expands to fit inserted text. Then it assigns some text using the text field’s text property:
    test_txt.multiline = true;
    test_txt.wordWrap = true;
    test_txt.autoSize = "left";
    test_txt.text = "Create new text fields with the MovieClip.createTextField() method.";
  4. Select Control > Test Movie to see the text field.The text is created at runtime and appears on the Stage.

You can use the TextField.removeTextField() method to remove a text field created with createTextField(). The removeTextField() method does not work on a text field placed by the timeline during authoring.

For more information, see createTextField (MovieClip.createTextField method) and removeTextField (TextField.removeTextField method) in the ActionScript 2.0 Language Reference.

NOTE Some TextField properties, such as _rotation, are not available when you create text fields at runtime. You can rotate a text field only if it uses embedded fonts. See To embed a font symbol:.

You can find sample source files that demonstrate how to work with text fields using ActionScript. The source files are called textfieldsA.fla and textfieldsB.fla, and you can find them in the Samples folder on your hard disk:

  • In Windows, browse to boot drive\Program Files\Macromedia\Flash 8\Samples and Tutorials\Samples\ActionScript\TextFields.
  • On the Macintosh, browse to Macintosh HD/Applications/Macromedia Flash 8/Samples and Tutorials/Samples/ActionScript/TextFields.

source:

http://livedocs.adobe.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00001419.html

Windows 2003 Server does not stream FLV videos


Solution

Please be aware that these steps do not resolve any issue with Flash, but are a configuration step for Microsoft Windows 2003 and Microsoft IIS Server 6.0. Any difficulties in executing these instructions or any errors that may arise from modifying your system settings should be addressed to Microsoft. For more details, please refer to your IIS documentation.

  1. On the Windows 2003 server, open the Internet Information Services Manager.
  2. Expand the Local Computer Server.
  3. Right-click the local computer server and select Properties.
  4. Select the MIME Types tab.
  5. Click New and enter the following information:
    • Associated Extension box: .FLV
    • MIME Type box: application/octet-stream (some friend told me to use flv-application/octet-stream)
  6. Click OK.
  7. Restart the World Wide Web Publishing service.

source:

http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=tn_19439