Selteco.com > FlashDesignerZONE.com > Tutorials > T1023

Load JPEG or SWF file with loadMovie.

  1. Launch Flash Designer and choose "Blank Animation". Choose "Frame" > "Frame Size" to set movie dimensions. Enter 300 x 300 and click OK.
  2. Choose "Sprite" tool and draw a rectangle on the frame. Flash Designer will create new sprite and display blank "chessboard" frame.
  3. Choose "Movie" > "Go to Main Movie" to quit sprite thread. You should see "Sprite1" as the name of the empty sprite.
  4. Choose "Item" > "Placement properties" and check "ActionScript" target. Click OK.
  5. Choose "Item" > "Resize", uncheck "Keep proportions" and enter width and height that will match your jpeg image size. Click OK.
  6. Choose "Button" tool and draw a button below the sprite.
  7. Choose "Item" > "Edit Properties". Rename button to "Load Movie". Click OK.
  8. Choose "Action" > "OnClick", select "ActionScript" and enter the code:

    Sprite1.loadMovie("t1023.jpg");
    Sprite1.play();

    The name must match your jpeg file name. Click OK.

  9. Choose "Frame" > "Frame Delay" and check "Stop" options to create static frame. Click OK.
  10. Choose "File" > "Export SWF file" and export flash movie to the same folder where your jpeg image is.
  11. Choose "File" > "Export Web Page". The page will popup in a new browser window.
  12. Click "Load Movie" in your Flash file to load jpeg image

JPEG image must be in baseline compression, progressive is not supported (Flash player will not show progressive JPEG). See Macromedia TechNote

Import JPEG image to Flash Designer to check if the image is not progressive compressed, use "File" > "Import Image" command. If the image is progressive Flash Designer will display a warning message.

Flash Designer 5.0.13.14 or earlier does not save "ActionScript Target" attribute. Upgrade to newer version to fix this.

To load image use ActionScript code:

Sprite1.loadMovie("imagename.jpg");

to load Flash movie use

Sprite1.loadMovie("flash.swf");

Products | Purchase | Downloads | Support | Flash Tutorials | Contact
Copyright © 1999-2017 Selteco Software, Inc. www.selteco.com, ph: +1 810 377 5778