A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: [F8] Importing a JPEG using loadmovie

  1. #1
    Senior Member
    Join Date
    Mar 2005
    Location
    MI
    Posts
    279

    [F8] Importing a JPEG using loadmovie

    i am trying to import a JPEG in to my flash using the loadmovie command but when i try it i get an error message saying the file i am trying to load does not exist. I have used this command with swf files with out any errors what am i doing wrong. Heres my script:
    on (release){
    loadMovie("GM_photo_1.JPEG", replace_movie);
    }
    It seems so simple can anyone help me.
    Our greatest fear is not that we are inadequate,
    but that we are powerful beyond measure.

  2. #2
    Member
    Join Date
    Nov 2006
    Posts
    32
    Hey,

    You need a destination to load into. You can either create an empty movie clip or, use something like this (from the help files):

    // Creates a movie clip to hold the container.
    this.createEmptyMovieClip("image_mc", 9);
    // Loads an image into image_mc.
    image_mc.loadMovie("http://www.helpexamples.com/flash/images/image1.jpg"

    Cheers!

  3. #3
    Senior Member
    Join Date
    Mar 2005
    Location
    MI
    Posts
    279
    i did thats what replace_movie was for it's the name of the movie clip the JPEG was to replace.
    Last edited by jardane; 04-13-2007 at 03:09 PM.
    Our greatest fear is not that we are inadequate,
    but that we are powerful beyond measure.

  4. #4
    Member
    Join Date
    Nov 2006
    Posts
    32
    How about moving the destination to the front:

    on (release){
    replace_movie.loadMovie("GM_photo_1.JPEG");
    }

    Also, you might try to apply the function from actionscript not tied directly to the button:

    myButton.onRelease = function() {
    replace_movie.loadMovie("GM_photo_1.JPEG");
    };

    Cheers!

  5. #5
    Senior Member
    Join Date
    Mar 2005
    Location
    MI
    Posts
    279
    nope neither of those worked
    Our greatest fear is not that we are inadequate,
    but that we are powerful beyond measure.

  6. #6
    girasquid.com
    Join Date
    Mar 2007
    Location
    127.0.0.1
    Posts
    18
    Are you sure your jpeg file exists? Is the extension actually JPEG, and not just jpeg? That could cause the problem you're talking about.

  7. #7
    Senior Member
    Join Date
    Mar 2005
    Location
    MI
    Posts
    279
    yes it's a JPEG... heres a i will give you the test files i am working with and see if you guys can get it working.
    Last edited by jardane; 08-27-2007 at 04:23 PM.
    Our greatest fear is not that we are inadequate,
    but that we are powerful beyond measure.

  8. #8
    Senior Member
    Join Date
    Nov 2004
    Location
    Toronto, Canada
    Posts
    194
    it's because you used the extension JPEG when you should have used jpg


  9. #9
    Senior Member
    Join Date
    Mar 2005
    Location
    MI
    Posts
    279
    thanks that worked
    Our greatest fear is not that we are inadequate,
    but that we are powerful beyond measure.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center