A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: external JPEG loading and placing

  1. #1
    Junior Member
    Join Date
    Jun 2002
    Posts
    1
    1. After loading the external jpeg pic to my mc, i want to place it in a specific place (e.g. x=50, y=70)in the movie.
    but i can't move it.

    2. what exactly the "LOCATION: LEVEL" parameter does, when its 0 you can see only the Jpeg but when its 1 and above the jpeg is over everything else in the movie.


  2. #2
    Junior Member
    Join Date
    May 2002
    Posts
    16
    The easiest way to place a jpg on the stage via x,y coords, is to load the jpg into an empty movieclip (which you have done), then give that movieclip an instance name. (i.e. jpgHolder). Drag "jpgHolder" to the staging area then in the frame you placed it on, add this code:

    Code:
    setProperty(_root.jpgHolder, _x, "50");
    setProperty(_root.jpgHolder, _y, "70");
    This code works on the assumption that you placed the movieclip with the instance name "jpgHolder" on the main stage. Change as needed.

  3. #3
    Junior Member
    Join Date
    Mar 2002
    Posts
    21

    Just wondering....

    Since you guys are talking about it..Im curiouse, how do you load a picture into an MC?

    Thanks

    Chris

  4. #4
    Junior Member
    Join Date
    May 2002
    Posts
    16
    There are several ways (all using loadMovie action), and many ways are posted on the forums. Just search the forums and you will find a world of examples. Here's a simple way to do it though:

    1. Create an empty movie clip.
    2. Drag it to the stage and give it the instance name of "jpgHolder".

    3. Create a button and drag it to the stage, then add this code to the button:

    Code:
    on(press)
    {
    	_root.jpgHolder.loadMovie("http://www.hello.com/whatever.jpg");
    }
    It's that easy!

  5. #5
    Originally posted by bbcaaron


    Code:
    on(press)
    {
    	_root.jpgHolder.loadMovie("http://www.hello.com/whatever.jpg");
    }
    It's that easy!
    i have code similar to the above, but it gives me errors when i try to load the image. I have everything in the right directory so i know that isnt the problem. how do i make this:
    _root.pic.loadMovie(_root["image"+whichOne]);
    load images that are in the same directory as the swf without returning and error that says error opening URL blah blah blah???

  6. #6
    Junior Member
    Join Date
    May 2002
    Posts
    16
    it looks like you're missing the extension in your code:

    Code:
    _root.pic.loadMovie("image"+whichOne+".jpg");

  7. #7
    Thanks for the reply. I am loading the images from a txt file, so i didnt need the extention in the code. It did work when i posted this, but not in Test Movie. Once i published it and tested it from that, it worked fine. Does the images not show up in Test Movie mode at all, or is it the fact that they are loaded dynamically? Im just glad it works!

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