Link to home
Start Free TrialLog in
Avatar of b2johnso
b2johnso

asked on

Actionscript: Dynamically create empty movie clip within a scroll pane, attach JPEG to that dynamically created movie clip

I have a scrollpane.  I have many images I want to put in the scrollpane as thumbnails.  They need to be movie clips because I need to do stuff with them when the user clicks on them.  Like fades, alpha stuff, scaling, load another instance of that dynamically created movie clip into a different movie clip, etc.

So - can someone provide some example code of how to:

1 - Dynamically create a empty movie clip ("within" my scrollpane)
2 - Insert a JPEG into that dynamically created movie clip (from disk or URL, using loadmovie)

I would appreciate it if you could be very specific as well - but beggars can't be choosers.  Thanks in advance.

ASKER CERTIFIED SOLUTION
Avatar of SandyCooke
SandyCooke

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rowdypig
rowdypig

I just read the reply to this question in the hopes that it would help me with my diimma. Although it was concise, well-written (and actually cleared up a thing or two for me), it did not solve my problem. I would truely appreciate your help with this issue:

I need to take a MovieClip (lets call it clipSubject) and divide it into a number of pieces in a cartesian grid. As such, I guess I need to mask the clipSubject MovieClip to only show a sub-section of it.

So can I use the MovieScript.CreateEmptyMovie() constructor to create a new grid of MoveClips (all attached to each other) where each grid section (clipSection MovieClip) contains two layers:

clipSectionMovieClip  -- MovieClip
  |
  |
  ==> Layer 1:   clipMask - MovieClip
  |
  |
  ==>Layer 2:    clipSubject - MovieClip

If so, how do I control the x,y coordinates of the clipMask MovieClip on the first layer of the new dynamically created clipSection MovieClip?
also, how can I tell the new dynamically created clipSection MovieClip to treat the clipMask MovieClip as a mask?

finally, how do I decide where to create Class definitions for this project?

Currently I am leaning towards this:
==============================================
class megaClip extends MovieClip
  MovieClip object that contains an array of horizCLIP objects

class horizCLIP extends MovieClip
  MovieClip object that contains an array of sectionCLIP objects

class sectionCLIP extends MovieClip
  MovieClip object that contains two layers:
    layer 1: maskCLIP - MovieClip object
    layer 2: subjectCLIP - MovieClip object

=============================================

The entire goal, of course, is to create a dynamic MovieClip that when you mouse over it, the image appears to dimple where your mouse is by shrinking the size of it's corresponding pieces and enlarging the pieces that are not being moused over. the resolution of the dimple then would be determined only by the number of subdivisions you select for dividing the main image into (ideally this number would be setup to either have one divMax (maximum number of divisions being equal horiz and vertical) or hdivMax and ydivMax (for independently controlled x and y resolutions).

Sorry for the long post. I hope that someone has some advice for me rather than just "get a life, you moron" or "too much trouble for me". Any suggestions or information that you could provide would be greatly appreciated. Thanks in advance for you help.

Rowdy

rowdypig@yahoo.com