> > Tutorials > T1023

Load JPEG or SWF file with loadMovie.

load image

  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");;

    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 or earlier does not save “ActionScript Target” attribute. Upgrade to newer version to fix this.

To load image use ActionScript code:


to load Flash movie use


get flash