A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Importing an image and contraining it to an area

  1. #1
    at the moment an image in my movie is imported by the user by setting a variable (in this case entering the url into a box) and pressing a button. Attached to the button is : -

    on (release) {
    loadMovie(imgurl, "mypic");
    fscommand(allowscale, false);
    gotoAndStop("profile");
    }

    this imports the image, the only problem is that this does not constrain it to the rectangle that the movie clip (mypic) takes up.

    I tried to use some initiative and change the code attached to the button to: -

    on (release) {
    loadMovie(imgurl, "mypic");
    fscommand(allowscale, true);
    gotoAndStop("profile");
    mypic.constraintorectangle(0, 150, 0, 150);
    }

    but this had no effect, pure guesswork really

    please bare in mind if you reply that these variables are saved in shared objects, just incase that has any effect.

    If you have to much time on your hands here is the movie: -
    http://www.mwt.rules.it
    go to new game, give yourself a new name then skip the non-existent intro and click profile. the image in the top left corner of that screen is the movieclip 'myimg' click on it.

    Thanks for the help (in advance),
    Ollie.

  2. #2

    please have sympathy

    this has been up for a few hours now, if ur just sitting there readings this please write something, it's gone 4am and i gotta wake up and run a nike 10kLondon qualifying thing in 5 hours.

  3. #3
    Junior Member
    Join Date
    Aug 2002
    Posts
    29
    try scaleing it after it loads
    theClip._width=xxx;
    theClip._height=xxx;
    thats how i did mine, just make sure the registration point is set to the upper left.

  4. #4

    nice!

    Thanks, it's resizing itself to the right size really well now but not in the right place. How do you set the registration point?

    Thnx for the help, much apreciated.

  5. #5
    Junior Member
    Join Date
    Aug 2002
    Posts
    29
    to set the registration point create a new movie clip and there should be a little box of black boxes with a white box in the middle, click the top right box of those and thats now the registartion point.

  6. #6

    aha!

    i just realised what you meant when you said registration point, thanks is working perfectly now.

    Infinately grateful.

  7. #7
    Junior Member
    Join Date
    Aug 2002
    Posts
    29
    no prob

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