Professional Web Applications Themes

resizing jpeg imported to a movieclip - Macromedia Flash Actionscript

I am importing a jpeg into an empty movie clip, which then gets dragged/dropped as part of a configuration tool. I have several base items in the flash configurator, but want other (lesser used) items imported when needed, to save file size. I can get the jpeg's to import fine, but instead of having to import a different jpeg for each size of the item in question (eg. 3 sizes of Plasma TV), I would like to just import the same image and resize it The problem is that after I import the clip, I can't then use movieClipName._height and ...

  1. #1

    Default resizing jpeg imported to a movieclip

    I am importing a jpeg into an empty movie clip, which then gets dragged/dropped
    as part of a configuration tool.

    I have several base items in the flash configurator, but want other (lesser
    used) items imported when needed, to save file size. I can get the jpeg's to
    import fine, but instead of having to import a different jpeg for each size of
    the item in question (eg. 3 sizes of Plasma TV), I would like to just import
    the same image and resize it

    The problem is that after I import the clip, I can't then use
    movieClipName._height and movieClipName._width to change the size. Even when
    the jpeg is imported, trace shows the HxW as 0, which makes sense for the empty
    clip
    I thought that importing essentially replace the existing clip, shoudl it not
    also change the size? And why can I not then resize it? I can use set property
    to move the clip, so I can access the clip (eg. _x, _y), so why not _height and
    _width

    Any help is appreciated. It's not a huge deal to have 3 jpegs to import, but I
    must be missing something here, and going forward it might be important to know
    how to do this

    Joh

    can-am Guest

  2. #2

    Default resizing jpeg imported to a movieclip

    I am importing a jpeg into an empty movie clip, which then gets dragged/dropped
    as part of a configuration tool.

    I have several base items in the flash configurator, but want other (lesser
    used) items imported when needed, to save file size. I can get the jpeg's to
    import fine, but instead of having to import a different jpeg for each size of
    the item in question (eg. 3 sizes of Plasma TV), I would like to just import
    the same image and resize it

    The problem is that after I import the clip, I can't then use
    movieClipName._height and movieClipName._width to change the size. Even when
    the jpeg is imported, trace shows the HxW as 0, which makes sense for the empty
    clip
    I thought that importing essentially replace the existing clip, shoudl it not
    also change the size? And why can I not then resize it? I can use set property
    to move the clip, so I can access the clip (eg. _x, _y), so why not _height and
    _width

    Any help is appreciated. It's not a huge deal to have 3 jpegs to import, but I
    must be missing something here, and going forward it might be important to know
    how to do this

    Joh

    can-am Guest

  3. #3

    Default Re: resizing jpeg imported to a movieclip

    I have not attempted this with any recent version of Flash, but it was not
    possble in the past. Importing an image into an MC does not replace the
    holder MC, it places the imported image *inside* of it. If I recall, the
    "problem" was that Flash does not alter the size of raw image files via AS,
    (setProperty) but it must first be a symbol, before it can be manipulated.

    I will be watching to see if there is now a way to do this.

    Regards,
    --Vern


    _posted.by\(Vern\); Guest

  4. #4

    Default Re: resizing jpeg imported to a movieclip

    Hmmm, so there is no way to manipulate an imported image? Could I have a
    separate SWF file that is nothing but an image, and then manipulate that when
    imported, or loaded? Alternately, is there a way to convert an image to a
    symbol at runtime

    can-am Guest

  5. #5

    Default Re: resizing jpeg imported to a movieclip

    >>Alternately, is there a way to convert an image to a symbol at runtime<<

    This is exactly what would be required. I dont know of a way, but there may
    be. Hopefully, someone can catch this thread and enlighten us both.

    Regards,
    --Vern


    _posted.by\(Vern\); Guest

  6. #6

    Default Re: resizing jpeg imported to a movieclip

    I actually have a working method, although I am not sure it's the most elegant

    I made the jpeg to import into a single frame flash, and attached AS to resize
    it based on the input from x/y variables housed in _global variables. When I
    import this SWF, it reads the _global settings, and gets resized accordingly.
    Works a treat from a drop-down menu now. Depending on the selectedIndex, the
    _global variables are set, then the SWF is imported.

    So I have 2 layers in the imported SWF, one has the image, the other has the
    following

    this._height = _global.h; // heigh
    this._width = _global.w; // widt
    stop()

    This works, but i'm not sure whether this is the recommended way or not

    can-am Guest

Similar Threads

  1. Resizing the Bounding Box (text and imported graphics)
    By David_Van_Horn@adobeforums.com in forum Adobe Illustrator Windows
    Replies: 2
    Last Post: July 25th, 09:37 AM
  2. Imported Bitmaps Too Large for Slide Screens: Resizing?
    By Jack Danniel in forum Macromedia Flash
    Replies: 5
    Last Post: May 10th, 04:14 AM
  3. Can i change the bkgnd of an imported jpeg?
    By Ndna Jnz in forum Adobe Illustrator Macintosh
    Replies: 0
    Last Post: February 26th, 06:35 AM
  4. Resizing a jpeg stored in a database
    By Donald Tyler in forum PHP Development
    Replies: 0
    Last Post: September 18th, 08:51 PM
  5. a movieclip to control another movieclip???
    By Patrik Liljebäck in forum Macromedia Flash
    Replies: 0
    Last Post: June 23rd, 12:59 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139