A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Trouble loading an image

  1. #1
    Junior Member
    Join Date
    Oct 2004
    Posts
    10

    Trouble loading an image

    OK, I'm trying to load a jpg from my hard drive into a blank movie clip.

    The clip's name is "picDisplay" and the photo file, as it resides in the same folder as my .fla file, is "photo.jpg".

    Here is the AS attached to my button:

    code:

    on(release){
    picDisplay.loadMovie("photo.jpg");
    }



    I'm using MX 2004

    edit: Forgot to ask a question . Nothing is loading up when I press the button. What could I be doing wrong?
    Last edited by agape; 10-05-2004 at 09:21 PM.

  2. #2
    Junior Member
    Join Date
    Oct 2004
    Posts
    13
    use this code

    code:
    on(release){
    loadMovie("???.jpg",_root.picDisplay);
    }

    Last edited by x_ash; 10-05-2004 at 09:47 PM.
    Work hard... Play harder

  3. #3
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Is picDisplay also the instance name of the container clip on stage, and not just it's Library name?

    Have you tried adding _root?
    code:

    on(release){
    _root.picDisplay.loadMovie("photo.jpg");
    }


  4. #4
    Junior Member
    Join Date
    Oct 2004
    Posts
    13
    i guess the output of our code is the same oldnewbie.. =)
    Work hard... Play harder

  5. #5
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Yeah! Sure looks like it... Now that you've edited your's though!

    I did also ask about the instance name... Which you didn't, and that would keep your script from working also!

  6. #6
    Junior Member
    Join Date
    Oct 2004
    Posts
    10
    Originally posted by oldnewbie
    Is picDisplay also the instance name of the container clip on stage, and not just it's Library name?

    Have you tried adding _root?
    code:

    on(release){
    _root.picDisplay.loadMovie("photo.jpg");
    }

    Yup, it was that instance thing in the name...thanks!

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