Home Tutorials Forums Articles Blogs Movies Library Employment Press
Old 03-01-2007, 08:52 AM   #1
Senior Member
mojito's Avatar
Join Date: Jun 2001
Location: London
Posts: 523
Smile load dynamic images into scroll pane

Im still unresolved on this so if you have any ideas I'd really like to hear.
Im simply trying to load external jpegs into a scroll pane component. Here is my code sp is the scrollpane and image_mc is a blank movie clip. Both are on the stage

var mclListener:Object = new Object();
mclListener.onLoadInit = function(target_mc:MovieClip) {
var image_mc1:MovieClipLoader = new MovieClipLoader();
image_mc1.loadClip("content/visual/images/01010000_00.jpg", image_mc);
Random Life and other painful life.
mojito is offline   Reply With Quote
Old 03-02-2007, 01:22 PM   #2
Flash Designer
Join Date: Mar 2007
Posts: 32
Post Have you had a go at..

Making a seperate swf that calls in the pics and then call that swf into the scrollPane?
_global.kevin is offline   Reply With Quote
Old 03-02-2007, 01:26 PM   #3
Senior Member
mojito's Avatar
Join Date: Jun 2001
Location: London
Posts: 523

Hi and thanks for that, it did work and I shamefully hadnt returned here to show my code, well here it is for loading in the dynamic images and then the scroll pane unfortunately has to have an onEnterFrame to update on the invalidate(); method.

dynamic image loading (beware that the order loaded is sequential but the init function is dependant on which loads first etc

//labels for images
var aLabels = [];
var maxWidth = 450;
var maxHeight = 450;
//test with three images
aTotalLoadedImages = [];
totalHeight = 0;
for (var a = 0; a<=3; a++) {
ref = this["mclListener"+a];
var ref:Object = new Object();
ref.onLoadInit = function(target_mc:MovieClip) {
trace("height is "+target_mc._height);

if (target_mc._width>maxWidth) {
var factor = target_mc._width/maxWidth;
target_mc._width = target_mc._width/factor;
target_mc._height = target_mc._height/factor;
if (target_mc._height>maxHeight) {
var hfactor = target_mc._height/maxHeight;
target_mc._width = target_mc._width/hfactor;
target_mc._height = target_mc._height/hfactor;
//centre the image horizontally
target_mc._x += target_mc._width/2;
if (aTotalLoadedImages.length == 3) {
//trace("loaded all "+aTotalLoadedImages);
trace("height is "+totalHeight);
} else {
trace("height is "+totalHeight);
var ref2:MovieClipLoader = new MovieClipLoader();
//trace("LOADING content/visual/images/"+_root.currentScreenObject.images[a]);
ref2.loadClip("content/visual/images/"+_root.currentScreenObject.images[a], "bttn"+a);
Random Life and other painful life.

Last edited by mojito; 03-02-2007 at 01:27 PM. Reason: added code
mojito is offline   Reply With Quote

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
loading dynamic gallery thumbnail images overrides variables fauxpasNYC ActionScript 2.0 1 06-11-2006 04:31 PM
dynamically-loaded jpegs into scrollpane xmiinc Components 33 12-13-2005 09:38 PM
Scroll Pane - Unable to load image from web. Dave At ADC Components 4 12-07-2005 03:28 PM
How to print entire (dynamic) scroll pane contents MD68 Components 1 03-13-2005 03:15 PM
Trying to load dynamic images eclipsegrafx ActionScript 1.0 (and below) 4 03-25-2004 12:05 AM

All times are GMT. The time now is 06:21 PM.

Follow actionscriptorg on Twitter


Powered by vBulletin® Version 3.8.5
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2013 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.