Re: [Flashcoders] Trying to create an emptyMovieClip and then loadanimage into it

2006-09-27 Thread Radley Marx




Just a first guess, are you trying to load a clip into depth "0" when  
i=0??? Wouldn't that kill the MC?


-radley




On Sep 26, 2006, at 12:37 AM, vic wrote:


_level0.createEmptyMovieClip(imgMovieClip,i)





 
--

Radley Marx
[EMAIL PROTECTED]
http://www.radleymarx.com
 
--




___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com


Re: [Flashcoders] Trying to create an emptyMovieClip and then loadanimage into it

2006-09-26 Thread vic
sorry again, here is non-revered code:

class ImageViewerMain extends MovieClip {
// Constants:
public static var CLASS_REF = ImageViewerMain;
// Public Properties:
// Private Properties:
// var to pass from constructor func to loadImage func
private var newlyCreatedImgHolder_mc:MovieClip;
// Initialization:
// set constructor func
public function ImageViewerMain(targetImg_mc:MovieClip, 
targetThumb_mc:MovieClip, depth) {
// create the empty movie holder with a unique instnace name 
and depth
for (var i = 0; i<_level0.numOfItems; i++) {
// use the array previously created to set the 
imageToLoad var
var newImageToLoad = _level0.imageArray[i];
var newThumbToLoad = _level0.thumbArray[i];
// create as many empty movieClips as there are images 
in the XML with unique instance names
makeImageMovieClips(i, newImageToLoad, targetImg_mc);
}
}
// Public Methods:
// Semi-Private Methods:
// Private Methods:
private function makeImageMovieClips(i, newImageToLoad, targetImg_mc) {
// create movieClip name
var imgMovieClip = ["img_"+i];
trace('creating empty movie clip called '+imgMovieClip);
_level0.createEmptyMovieClip(imgMovieClip,i);
// run the loadMovie func
loadImage(newImageToLoad, imgMovieClip);
}
// func to load image into newly created movieClip
private function loadImage(newImageToLoad:String, imgMovieClip):Void {
trace('trying to load '+newImageToLoad+' into '+imgMovieClip)
imgMovieClip.loadMovie(newImageToLoad)
}
}


But it does not work and I feel that it is a scope issue but I am not sure why. 
 Thanks, V


-- Original Message --
From: "vic " <[EMAIL PROTECTED]>
Reply-To: Flashcoders mailing list 
Date:  Tue, 26 Sep 2006 00:30:08 -0700

>Shoot, that is reverted code...hold a tick and I will reprise it the way it 
>was when it was looking tight and NOT working.  Sorry, V
>
>
>-- Original Message --
>From: "vic " <[EMAIL PROTECTED]>
>Reply-To: Flashcoders mailing list 
>Date:  Tue, 26 Sep 2006 00:24:56 -0700
>
>>I have a Class, I am trying to create an empty movieClip on the stage, that 
>>is going well because I see this when i hit ctl+alt+v:
>>
>>Variable _level0.imgViewer = [object #8] {}
>>Movie Clip: Target="_level0.emptyViewerContainer_mc"
>>Movie Clip: Target="_level0.emptyThumbContainer_mc"
>>Movie Clip: Target="_level0.img_0"
>>Movie Clip: Target="_level0.img_1"
>>Movie Clip: Target="_level0.img_2"
>>Movie Clip: Target="_level0.img_3"
>>Movie Clip: Target="_level0.img_4"
>>Movie Clip: Target="_level0.img_5"
>>
>>So I know I am doing that right, but then I want to loadMovie ( a JPG) into 
>>it.  that is where I am falling short.  Anyone see the problem?  Below is the 
>>Class code...thanks in advace, Victor
>>//
>>class ImageViewerMain extends MovieClip {
>>  // Constants:
>>  public static var CLASS_REF = ImageViewerMain;
>>  // Public Properties:
>>  // Private Properties:
>>  // var to pass from constructor func to loadImage func
>>  private var newlyCreatedImgHolder_mc:MovieClip;
>>  // Initialization:
>>  // set constructor func
>>  public function ImageViewerMain(targetImg_mc:MovieClip, 
>> targetThumb_mc:MovieClip, depth) {
>>  // create the empty movie holder with a unique instnace name 
>> and depth
>>  for (var i = 0; i<_level0.numOfItems; i++) {
>>  // use the array previously created to set the 
>> imageToLoad var
>>  var newImageToLoad = _level0.imageArray[i];
>>  var newThumbToLoad = _level0.thumbArray[i];
>>  // create as many empty movieClips as there are images 
>> in the XML with unique instance names
>>  makeImageMovieClips(i, newImageToLoad, targetImg_mc);
>>  }
>>  }
>>  // Public Methods:
>>  // Semi-Private Methods:
>>  // Private Methods:
>>  private function makeImageMovieClips(i, newImageToLoad, targetImg_mc) {
>>  // create movieClip name
>>  var imgMovieClip = ["img_"+i];
>>  trace('creating empty movie clip called '+imgMovieClip);
>>  _level0.createEmptyMovieClip(imgMovieClip,i);
>>  // run the loadMovie func
>>  loadImage(newImageToLoad, imgMovieClip,i);
>>  }
>>  // func to load image into newly created movieClip
>>  private function loadImage(img:String, imgMovieClip:MovieClip,i):Void {
>>  trace(img)
>>  }
>>}
>>
>>___
>>Flashc