Not signed in (Sign In)

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.


    • CommentAuthorjustnajm
    • CommentTimeNov 17th 2006
     
    Hi,

    I have tried to make an image viewer, I have completed the project in VB6, but as I tried to make one in flash I was unable to import the gif image in the flash swf file:


    loadMovie("C:\\Documents and Settings\\Najm\\My Documents\\My Pictures\\stars.gif",post);//not working


    Please help me to import gif files through script so I can move further to complete this one too. As I have done it in VB6. And if flash can show the gif image as an animated image not as static.

    VB6 also require typical coding to show gif images as animated but I should post this question in programming.

    Thanks in advance, I will really glad to see a good solution as I had for fliping movieclips.
    • CommentAuthorjustnajm
    • CommentTimeNov 23rd 2006
     
    I have got the answer but did'nt get it that how I am going to show the image from variable ??? /sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" />

    Importing images using Embed in ActionScript

    You can embed images within ActionScript using the [Embed] compiler directive. This is functionally equivalent to the MXML @Embed syntax, and you can use it to import JPEG, GIF, PNG, SVG, and SWF files at compile time. You can also import image assets from SWC files.

    This syntax allows you to assign an imported image to a variable for repeated later use. It also allows you to change the image at runtime by reassigning the variable. Generally, this method of image import provides more flexibility than other mechanisms.

    The following example loads an image file and assigns it to the image1 variable:

    [Embed(source="bar.gif")]
    var image1:String;


    The embedded resource does not have to be a locally stored asset. You can specify network URIs as the source, as the following example shows:

    [Embed(source="http://getpic.com/getsvg")]
    var pic:String;


    If the source files of the external resources change after the Flex application is compiled, Flex will not recompile the application. Flex does not examine the source files on each request to determine if they are up to date.