External Image

 

Right here we gonna use an interesting property of Sprite with Load Movie to upload an external image .

⇒ see animation ⇐

At first, Download the image. . Unzip the file in the directory where your SWF movie 'll be.

1 - Set up width, height, and a background color (white for instance). 'Frame Rate' doesn't matter.

dimensions

2 - In Menu Insert, click Sprite.
In 'Outline', click text Sprite to edit it. Enter Conteneur.

outline

3 - In 'Outline', click Scene1, then click tab Actions in the right zone. Click Add Event to yield  Add Event

4 - Then, click Add Action, select Tell Target.
In the Edit field, enter /Conteneur Tell Target

5 - Right now click Add Action, select Load Movie
Load Movie allows to import an external file on the fly. There is a special value for the level ( -1 ) which allows this file to replace the content of the Sprite', BUT position, size and effects of 'Sprite' 'll be apply to it.
Enter the complete pathname for the file and level -1.

Load Movie

6 - Click right now menu File , then Test, then In Player.
What do you watch out ? Image stays at a weird position. Why ?
2 reasons for that :
- the point of coordinates [0;0] from imported file fits with the point [0;0] of 'Sprite'. Cool ! would you say !
- But [0;0] of 'Sprite' is its Center ! The point [0;0] from imported file is the high left corner. So bad !

7 - So we gonna move the image towards the high left corner of the scene.
For that, click Conteneur in 'Outline'. Then click tab Transform in the right zone. You 'd yield :

Sprite      Transform

8 - Et Voilà, it's over. You just have to export. Don't forget to put your image file in the right directory.

 


Si vous aimez le site

 

Select a language if you need :


Page chargée en 0.003 sec.

Dernière Modification : Mer 25 Janvier 2017 8:56
Copyright © 1999-2017 Jean-Paul Molina Tous droits réservés.

to Google