Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash








Problem: Dynamically Loaded Jpeg Images "cropped"


Hello all,

I have a little problem when loading JPEG images in movieClip: the images I am loading have a black border around, but the right and bottom ones don't show. As if there was some cropping.

To have a look at the problem please click on this link.

http://www.staceyspiegel.com/version_4/stacey.html

Click on the "artwork" menu and then the "public work"
Finally click on one of the icon to see the preview image and the problem I am talking about.

Thank for your help in advance.

geraldine




FlashKit > Flash Help > Flash MX
Posted on: 05-02-2006, 12:01 PM


View Complete Forum Thread with Replies

Sponsored Links:

Centering Dynamically Loaded JPEG Images?
I'm loading multiple JPEG images of different sizes directly into an existing movie clip in Flash 6. I want them to load into the same movie clip, each replacing the one before it, and I need them to all center in the stage.

The problem is that the loaded JPEGs align their top left registration point to the movie clip's center registration point.

When loaded, the different size JPEGs all have their top-left corner aligned to the same point on the stage (the movie clip's original center point), but since they are different sizes, most are not centered.

Is there a way to cause the dynamically loaded JPEGs to align their center to the movie clip's center?

View Replies !    View Related
Scaling A Dynamically Loaded Jpeg
I've had a good look through the forums but can't find any specific help on this topic. I hope I'm not duplicating a question if I missed something.

I have created a slide show for a selection of photographs which dynamically loads a jpg into the swf to save on load time at the start. I have an alpha fade between each image which works fine but I have a scaling issue. I have a caption button which slides in a bit of text for the photo and shrinks the photo to make room. The jpg is loaded into a movieclip using actionscript and then scaled again using actionscript. The scaling results in distortion lines and isn't as smooth as I would hope for. Does anyone know of any workarounds for this?

The link to the site is http://www.ethos-uk.com/matt/

Thanks in advance for any help

Matt

p.s. The site is obviously not finished

View Replies !    View Related
How To Copy Dynamically(loadMovie) Loaded Jpeg ?
I have a movie clip called picture_mc.
I load a jpeg in it.


Code:
picture_mc.loadMovie("http://somewhere.com/picture1.jpg");
Once the picture is loaded, I press a button that duplicate picture_mc, but the loaded jpeg is not duplicate.

And if use loadMovie for the duplicate movie with exactly the same path, the image get download again. Not very efficient.

Is there a way to duplicate EVERYTHING inside a movie clip ?

Martin

View Replies !    View Related
Retrieving Dynamically Loaded JPEG Dimensions
Hello everyone.

That's the main purpose of my code:
To dynamically load a JPEG into a movieclip called image from a path, using:


Code:
image.loadMovie ("jpeg/one.jpg");


This works just fine. But when it comes to retrieving the jpg dimensions (width, height), I'm trying :


Code:
var w = image._width;


Which returns 0. Does anyone know how to fix this? Thanks in advance.

View Replies !    View Related
Easy Way To Resize Dynamically Loaded JPEG?
Hi,
I'm loading an external image and resizing it proportionally once it's loaded, but I need to know if there's a more efficient/effective way to do it. Right now I've got:

ActionScript Code:
loadMovie("image1.jpg", mc1);onEnterFrame = function() {    percent1 = mc1.getBytesLoaded()/mc.getBytesTotal();    if (percent1 == 1) {        ratio = mc1._width/mc1._height;        mc1._width = 100*ratio;        mc1._height = 100;    }}


The image kinda jumps around as it's loading... seems like a pretty tacky way of doing it.

Any ideas?

View Replies !    View Related
Dynamically Loaded JPEG For Tiled Background?
Is it possible to dynamically load a JPEG image and use it as a tiled background for a fullscreen flash movie?

Everything I see online is for bitmaps already loaded in the library.
I don't see why it wouldn't be possible.
Thanks!

View Replies !    View Related
Preloading 'with A Progressbar' Dynamically Loaded Jpeg's
i want to preload (with a progressbar) a dynamically loaded .jpg

this is what i made (it's a flash mx file), but i'm not really satisfied because the progressbar shows 100% first and then it detects the loaded content. how can i make it so that the progressbar starts from 0% without showing the 100% first.

max.

http://members.tripod.com/gelectroni...er-dynamic.zip

View Replies !    View Related
Find Width Of JPEG's Loaded Dynamically?
I'm trying to dynamically place loaded JPEG's next to each other.

So I did something like...


ActionScript Code:
createEmptyMovieClip("image01", 0);
image01.loadMovie("image01.jpg");
trace(image01._width);


The output of trace is 0. However the debug tool lists _width property of image01 value as width of the image01.jpg file.

Looks like I can work around this by drawing a line (or some other shape) of the same width as the image into the movie like...


ActionScript Code:
createEmptyMovieClip("image01", 0);
image01.loadMovie("image01.jpg");
image01.lineTo(40, 0);
trace(image01._width);


The trace output for above is 40.

Which means I need to know the width of the image file ahead of time - not a huge deal as the widths can be loaded from an XML file.

However, idealy it seems like Flash should be able to tell me the width of the image, especially considering the debugger knows. Any ideas?

Thanks.

View Replies !    View Related
[F8] Reference Bitmap Object Of Dynamically Loaded Jpeg?
My search skills must be lacking today, so forgive this probably oft asked question, as I've been away from flash development for over a year:

How dow you reference the bitmap object of a jpeg dynamically loaded into a movie clip, from the internet not the library.

I initialize the flash.display.bitmapdata object, load the image into a holder movieclip named "holder", then how do I reference the bitmap object once loaded for use in dissolves, etc?


PHP Code:



this.createEmptyMovieClip('holder',this.getNextHighestDepth());
loadMovie('image.jpeg','holder');




Thanks, sorry my feeble search skills didn't find the answer!

View Replies !    View Related
CROPPED IMAGES
hello... i cropped an image (sailboat) in photoshop w/ TRANSPARENT BACKGROUND...and i used flash to import the image. the file is imported w/ a square shape.... not the original cropped image. can i use flash to crop images w/ the lasso? thanks

View Replies !    View Related
Dynamically Loading Images Into Dynamically Loaded MovieClips
I'm read through many of the posts and found several on this topic, none, however, that addressed all that I need addressed. I've tried several of the suggestions but so far nothing seems to work.

What I want to do is alter the width of images loaded dynamically into a dynamically loaded set of movieclips. all of the widths of the images are different, but i want them set to the same width. The width seems to stay at zero, however, and I cannot seem to change it.

Here is my code:

for (var i:Number = 0; i < 8; i++){
var mc = attachMovie("rect_mc", "r" + i, this.getNextHighestDepth());
mc._x = 90 + (i * (mc._width+5));
mc._y = 375;
mc.img_txt.text = "image" + (i+1);
mc.img_mc.loadMovie("myPic" + (i+1) + ".jpg");

mc.img_mc._xscale = mc.img_mc._yscale = (50/mc.img_mc._width) * 100;
};

The last line is the one that does not function properly.

I'd appreciate any help anyone can provide. thanks.

View Replies !    View Related
~~cropped Images In Fash?~~
hey is there a way to bring a CROPPED IMAGE into flash? i prepared a cropped image of a frog in photoshop without a background, but when i import it into flash the frog comes set within a square white background.

is there a format i can save the image in, that Flash will bring in while preserving the cropped edges?

*BigJuicy*!

View Replies !    View Related
Loaded Swf - Cropped Without MASK
Is there a way to load an SWF - and constrain it's bounds without using a mask -
It seems as though a mask on the entire SWF is taking up way too much processor power and slows down the loaded SWF.

??
thanks.

View Replies !    View Related
Skipping Missing Images For Dynamically Loaded Images?
Hey all,

I'm creating a image viewer for a photography studio.

I have it dynamically load the images. I'm using a text file to tell flash how many pics there are, the starting number, and the prefix and suffix for the file name ie. Ahp1234.jpg. Im using a simple counter when a person clicks on the "next" button it will add an increment to the starting number. My problem is photography studios often throw out images that didn't come out right, so there is a jump in numbers, and hence I get an error when trying to load an image that isn't there. I was wondering if there was a way to tell if an image has loaded properly using loadMovie. Or perhaps a better method than what I'm using?

I tried

square = new loadMovie;
square.load (_root.Filename);
square.onload = function (success){
if (success) {
//coding
}else{
counter++
}
}

If any one has any insight I would appreciate it.

Thanks.

View Replies !    View Related
Dynamically Loaded Images (.jpg Only?)
I'm loading images from outside my movie using the load movie action. Everything I've read and tried myself so far implies that you can only load .jpgs... Is this correct? I want to load .gis or .pngs so that I can have a transparent background. Any ideas?

thanks

View Replies !    View Related
Dynamically Loaded Images
Hi, I am working on a product display module for a client.

I have 10 images of the product in a movie clip and am using action script to enable the visitor to rotate the product and zoom in and out.

When I place the images within the flash movie, I get a very smooth transition.

But when i load the images dynamically using load movie, there is a delay before each of these images are displayed giving the rotation feature a very shabby and broken effect.

Please let me know if a smooth transition can be achieved when i use dynamically loaded images and if so, Please guide me on how to do it.

Any help will be sincerely appreciated.

Thanks in Advance.

View Replies !    View Related
Dynamically Loaded Images - Help Please
HI, I'm trying to build a portfolio in which each image loads dynamically, a movie clip resizes to the dimensions of the image being loaded, the image fades in and out again when a new image loads. I have had no problem with any of this except getting the dimensions of the images as they load and centering the images. I want the 'holder_mc' clip to tween from "w"(the current width of 'holder_mc') to "a"(the width of the loaded jpg) and I want them to be centered inside the clip i load them into. Below is the script I have used so far. An example of what I'm trying to acheive is at the address: http://www.iso50.com/iso50.html . Any ideas?



PHP Code:



import mx.transitions.Tween;
import mx.transitions.easing.*;

my_mc.loadClip("frames.jpg", "container");

button1.onPress = function() {
    var alpha_tween:Object = new Tween(container, "_alpha", regular.easeOut, 100, 0, 1, true);
    alpha_tween.onMotionFinished = function() {
        my_mc.loadClip("frames.jpg", "container");
    };
};
button2.onPress = function() {
    var alpha_tween:Object = new Tween(container, "_alpha", regular.easeOut, 100, 0, 1, true);
    alpha_tween.onMotionFinished = function() {
        my_mc.loadClip("911.jpg", "container");
    };
};
button3.onPress = function() {
    var alpha_tween:Object = new Tween(container, "_alpha", regular.easeOut, 100, 0, 1, true);
    alpha_tween.onMotionFinished = function() {
        my_mc.loadClip("tree.jpg", "container");
    };
};

w=holder_mc._xscale
h=holder_mc._yscale
my_mc = new MovieClipLoader();
preload = new Object();
my_mc.addListener(preload);

preload.onLoadStart = function(targetMC) {
    trace("started loading "+targetMC);
    container._alpha = 0;
};
preload.onLoadProgress = function(targetMC, lBytes, tBytes) {
};
preload.onLoadComplete = function(targetMC) {
    trace(targetMC+" finished");
};
preload.onLoadInit = function (targetMC)
{
a="imported image width?";
b=="imported image height?";
trace(contentainer._xscale);

var size_tween:Object = new Tween(holder_mc, "_xscale", Regular.easeOut, w, a, 1, true);
var size_tween:Object = new Tween(holder_mc, "_yscale", Regular.easeOut, h, b, 1, true);
size_tween.onMotionFinished = function() {
   var alpha_tween:Object = new Tween(container, "_alpha", regular.easeOut, 0, 100, 1, true);
};
};

View Replies !    View Related
Dynamically Loaded Images
Hi I have a problem with some images i've dynamically loaded into a flash Movie. For some reason the images look very poor. They are not scaled (at least not all of them). So i don't know what the porblem is. In the authoring environment they look perfect and once they are published tehy look like hell. Please help !

View Replies !    View Related
Dynamically Loaded Images
hi,

i am loading jpegs from an external folder into separate movie clips on the stage. this works fine. however, due to the structure of the movie, i need to attach these loaded clips to another movie clip which exists further along the timeline.

when i try to do this, nothing happens and tracing for the movies returns undefined.

does anyone know if this is because the jpegs are loaded dynamically?

e.g of loading jpeg:

loadMovie("content/design_1.jpg",im_holder1_mc);

and then later in the movie...

image01_mc.attachMovie("im_holder1_mc", "new", 300)
trace(im_holder1_mc.new); (returns undefined and the movie does not load)

anyone got any ideas?

many thanks,

lukemack.

View Replies !    View Related
Dynamically Loaded Images?
i know there's a section for this on kirupa.com, but i really need everything spelled out for me. (for instance, i knew the i had to use the code, but i didn't know where i was supposed to put it).

basically, i'd like to have a loaded image like the splash page on www.heftyrecords.com, where it says "loading images..." and then the images show up. i don't want to have to click on a button to load the image; rather, i'd like it to be done automatically. could anyone possibly help further explain this to me?

View Replies !    View Related
Dynamically Loaded Images In Rollover
Hi:
I'm creating an application in Flash where everything is dynamically decided at runtime, including what images to loaded and their positions on the screen. All this is defined in an XML file.

I am loading a particular image, say Image 1 onto the screen and on rolling the mouse over that, it changes to the rollover image, Image 2, which is also dynamicaly loaded at runtime from the disk drive using the loadMovie method.

The problem with this approach is that the rollover is really slowly, gets stuck sometimes and the images flicker. This is obviously because Image 2 is loaded from the harddrive everytime the mouse is rolled over Image 1. And when the mouse rolls out, Image 1 is again loaded from the hard drive. I'm loading thses images by checking the onMousOver events in the Movieclip containing the image.

Is there a better way to do this to be efficient and also to avoid flicker? Any help would be greatly appreciated. Thanks!!

-Gautam

View Replies !    View Related
Animating Dynamically Loaded Images..HOW?
Hi,

I want to animate dynamically loaded images. The images move from right to the left and are loaded from an XML file:

<Slides>
<slideNode jpegURL="images/aktie01.jpg">Banden</slideNode>
<slideNode jpegURL="images/aktie02.jpg">Mobiele bandenservice</slideNode>
<slideNode jpegURL="images/aktie03.jpg">Zakenrijders</slideNode>
</Slides>

The problem is how to animate the variable number of images from right to left like a carrousel. so the first image appears again when the last one leaves the screen.

View Replies !    View Related
Preload Dynamically Loaded Images - How?
How do I preload dynamically loaded images? For example - in the samples folder of Flash MX there is a slideshow, but none of the photos have a preloader. If I have a slideshow with dynamically loaded images, I want preloaders in front of them all. Any help?

View Replies !    View Related
Can Dynamically Loaded Images Be Aligned?
I use Flash MX

I 'm loading some images dynamically from an xml document.

When I bring them in, always, the top left of the target clip corresponds to the top left of the image I bring in (left justified to the x point of the target clip).

What I'd like to do, is have them align to the center of that clip.. is it possible?

Here's the open-source file I've been working with :

http://www.macromedia.com/support/fl...slideshow_xml/

Any help is appreciated.

-Craig

View Replies !    View Related
Images Loaded Dynamically Effect
Hello all, I was on www.lennykravitz.com and I was in the "gallery" section. I wanted to know how to create something like this. Where your thumbnails and your images load dynamically, your thumbnails are clickable and call up the bigger image in the viewer window, and the window changes shape according to the size of the image. Can anyone point me to a tutorial of this or help me create my own. I have found some help, I can either find a tut on the changing window size or a tut on the images loading, but not one on how to put them together like this site has. Any help would be appreciated. Thanks

NIck

View Replies !    View Related
Loading Bar On Dynamically Loaded Images
Hi,

Is it possible to have a loading progress bar for a dynamically loaded image within a flash movie. Or even better, to incorporate it's loading time into the main movie preloader?

If anyone could help out with this it'd be much appreciated, thanks...

View Replies !    View Related
Transparency In Dynamically Loaded Images
I have created a Flash application where users can upload images and then have them dynamically loaded into the movie. The problem I am running into is that any transparency within those uploaded images is simply being filled with black.

Is it possible to retain the transaparency of images dynamically loaded into a Flash movie?

Thanks in advance.
Aaron

View Replies !    View Related
Is It Possible To Preload Images That Are Dynamically Loaded
is it possible to preload images on frame that are dynamically loaded into the timeline later in the timeline. If so how would one go about that?

View Replies !    View Related
[F8] Fade In Dynamically Loaded Images
Yea so i have a functioning dynamic image gallery with thumbnail buttons using


Quote:




on (release) {
loadMovie("images/pic1.jpg","img_container");
}




i want the images when loaded to fade in - and When another thumbnail is clicked i want the dynamic picture that is loaded to fade out?

is there actionscript to do this.?

AC

View Replies !    View Related
Scale Dynamically Loaded Images
i am using flash cs3 with actionscript 2.0

i was wondering if theres any way to scale an image that was dynamically loaded using script... or would i have to edit the actual image i am loading in?

this is the code that dynamically loads the image:


PHP Code:



loadMovie("joe.jpg", _parent._parent.about_section.targetArea);




i want to scale down "joe.jpg" using script...

View Replies !    View Related
[F8] Dynamically Loaded Images & AttachBitmap
ok.. Im sure this has an OLD problem.. (as I have seen several posts around on it).. however I dont have much (barely any) exposure to the bitMap class or using attachBitmap()


my application was/is working fine.. until I got to the point where I need to work on the 'controls' that manipulates the images I am loading in.

these 'controls' basically only scale & rotate the image when clicked...
and of course if using the MovieClip loader class.. the images are NOT loaded/attached as bitmaps..so there is NOT control over the smoothing, and things look jagged/pixelated when rotating or scaling..

I have tried forceSmoth = true;
http://livedocs.adobe.com/flash/9.0/...=00001912.html

syas CS3 but also states AS2.0.. so Im think F8 just doesnt have it? even though a FlashPlayer should recognize it?

anyways.. didnt work, so I tried to attachBitmap.. and I still cant seem to get it to work. the images show-up but I dont think it is fomr the attachBitmap call..and from the original movieClip loader 'call' of loading the images..as when I scale them.. they still get 'jagged'

so my question(s) (two fold here) are:

1.) I need help on correctly implementing the attachBitmap on the INIT call back of my clipLoader...

2.) Im un-clear as to what happens with the original loaded images? Do we need to clear them somehow? It seems as if there would be double data if not removed? or am I just way off base here?


summary/background of project:

using a custom class (written by FK member MyFirndIsATaco, that I really like) that take an array of images and loads them all.. giving you your normal callBacks.. this is derived form the ClipLoader class, and has another callBack for onProgress for the loaded progress for ALL the images in your array..

so from searching.. I am trying to execute/attachBitmap() on the onInit callBack function that fires after EACH image is done loading.

the only part of that you need to worry/know about it this:


PHP Code:



//declare vars (in loop)var mainPart = partXML.firstChild.childNodes[h].attributes.bImage;var indiPartHolder = mainContainer[sectionID].createEmptyMovieClip("indiPartHolder_"+(h+1),  mainContainer[sectionID].getNextHighestDepth());                    mainLoad.addToQueue(mainPart, indiPartHolder);//end loopmainLoad.loadAll();




here is the function/callBack I am having trouble with.


PHP Code:



function onMainInit(mc:MovieClip):Void {    trace(newline+"PART NAME (INIT): "+mc.partName);    //force smoothing    //mc.forceSmoothing = true;        var bitmapCon:MovieClip = mc.createEmptyMovieClip("bitmapCon", mc.getNextHighestDepth());    var bitmap:BitmapData = new BitmapData(mc._width,  mc._width, true, 0x000000);       bitmapCon.attachBitmap(bitmap, mc.getNextHighestDepth());    bitmap.draw(mc);    //check for partImage #1    if(mc._name == "indiPartHolder_1"){        mc._parent.currentPart = 1;                mc._x -= Math.round(mc._width/2);        mc._y -= Math.round(mc._height/2);    }else{        mc._visible = false;        mc._x -= Math.round(mc._width/2);        mc._y -= Math.round(mc._height/2);    }    mc.onPress = function(){        trace("MY NAME IS: "+mc._name);        mc._parent.startDrag(false, ((mc._width/2)+25), ((mc._height/2)+100), (Stage.width - (mc._width/2)-25), (Stage.height - (mc._height/2)-110));        mc._parent._parent._parent.focusClip = mc._parent;        var partNum:Number = mc._parent.currentPart;        mc._parent._parent._parent.partDesc_txt.htmlText = "<b>"+sectionID+"</b> "+partXML.firstChild.childNodes[partNum].attributes.name;            }    mc.onRelease = mc.onReleaseOutside = function(){        mc._parent.stopDrag();    }}




Id like someone to help me understand better what I am doing wrong?
Also about the clean up of the movieClipLoader loaded images??


update: ok I seem to have the smoothing working now?

I changed this:

bitmapCon.attachBitmap(bitmap, mc.getNextHighestDepth());

to this:

bitmapCon.attachBitmap(bitmap, mc.getNextHighestDepth(), "auto", true);


however.. Id still like to know about 'clean-up' portion still??

Also.. now that I have done this.. the startDrag() code as well as the 'positioning' code I have is totally out of whack now? Why is this? In my mind.. I just created a new clip.. and copied the same image into it??

so the values and what not should be the same..no? (as far as X/Y placement..etc..etc)

thanks gang...


update 2:

(it always happens like this..doesnt it?)

well after I posted.. I saw a typo..

this:

var bitmap:BitmapData = new BitmapData(mc._width, mc._width, true, 0x000000);

should have been this:

var bitmap:BitmapData = new BitmapData(mc._width, mc._height, true, 0x000000);

DUH! lol..

anyways.. things seem to be good... so any conversation on the clean-up of the original loaded images from the ClipLoader() class is appreciated.. (maybe one doesnt have to do anything? and Im just crazy?)

View Replies !    View Related
[F8] Positioning Dynamically Loaded Images
hey!
i'm loading some images into the site i'm building dynamically and want them to come onto the screen bang in the middle. i'm loading them into an empty movieclip, called empty that's on the root timeline. here's my not-working script:


Code:
tempWedge.onRelease = function(){
launchImage();
loadMovie("illustration/"+_root.whichImage+".jpg", empty);
posEmpty();
trace(empty.width);
}
function launchImage(){
Tweener.addTween(overlay,{_alpha:80, time:0.4, transition:"easeInOutSine"});
Tweener.addTween(btmNav.bubble,{_alpha:0, time:0.4, transition:"easeInOutSine"});
}
function posEmpty(){
empty._x = (Stage.width/2) - empty.width;
empty._y = (Stage.height/2) - empty.height;
}


my trace of empty.width comes back as undefined. can anyone spot what i'm doing wrong here?
thanks guys!
emma.

View Replies !    View Related
Animating Dynamically Loaded Images
hi all,

a quick question,
I have loaded an image into flash using a url in a text file and now i want to animate it so it scrolls up the screen.... is this possible and if so how would i go about doing it?

cheers, milly

View Replies !    View Related
How To Preload Dynamically Loaded Images?
I used this wonderful example of the MCL, courtesy of Neil Webb, to load images dynamically into my swf. My only problem is that since each image is loaded dynamically, any preloader I use does not report the correct total bytes.

What I need is a preloader that will show the loading status to each image as it is being loaded.

I tryed this with the code below, but it seems to only show the status of which ever clip is passing through the function instead of preloading each image in order.


Do I understand this right? is what i need possible?


ActionScript Code:
//************
 //define MovieClipLoader
myMCL = new MovieClipLoader();                 
myListener = new Object();   //define listener

myListener.onLoadStart = function(targetMC) {
    totalBytes = targetMC.getBytesTotal();
    _root.preloader.total.text = "Total bytes "+totalBytes;
    _root.preloader.bar._visible = true;
};
myListener.onLoadProgress = function (targetMC, bytesLoaded, bytesTotal) {
    percentBytes = Math.round((bytesLoaded/bytesTotal)*100); // store percentage of byte loaded int oa varible called percentBytes
    downloadedBytes = bytesLoaded;
    remainingBytes = (bytesTotal - bytesLoaded);
    _root.preloader.percent.text = percentBytes+"%";
    _root.preloader.downloaded.text = downloadedBytes+" bytes downloaded";
    _root.preloader.remaining.text = remainingBytes+" bytes remaining";
    _root.preloader.bar._xscale = percentBytes;
};

myListener.onLoadComplete = function(targetMC){ //set the onComplete function on listener
    targetMC._alpha = 0;
    targetMC.onEnterFrame = function() {  //fade in clips when they are done.
        if (targetMC._alpha <= 99) {
            targetMC._alpha += 17;
        } else {
            targetMC._alpha = 100;
            delete targetMC.onEnterFrame;
        }
    };
};



//****************************
myMCL.addListener(myListener); //associate listerer with MCL object

View Replies !    View Related
Get Width Of Dynamically Loaded Images?
I have several images loaded and displayed dynamically on the stage, but they are all currently positioned at (0,0). To display them properly I need to be able to get the width of each image (or the MovieClip its loaded in).

I've tried this:


ActionScript Code:
for (var i:Number=0; i<data.result.length; i++){
        var imagePath:String = "http://mydomain.com/" + data.result[i];
        var instanceName:String = "image_" + i
        var thePic = "picture_" + i;
        thePic = _root.createEmptyMovieClip(instanceName, _root.getNextHighestDepth());
        _root[instanceName].loadMovie(imagePath);
        trace(_root[instanceName]._width);      //TRYING TO GET THE WIDTH
    }

Why does this last line output several 0s? How can I get the width of each image or parent MC?

View Replies !    View Related
Clickable Dynamically Loaded Images
The following script loads images from an array and places them on the stage.


Code:
var images:Array = new Array();

images[0] = '1.jpg';
images[1] = '2.jpg';

for(i=0; i<images.length; i++) {
pic = attachMovie("holder", "pic"+i, i);
pic._x = 10 + i*120 + i*10;
pic.image.loadMovie(images[i]);
}
I want to make the images clickable by associating this:


Code:
onClipEvent (enterFrame) {
this.onRelease = function() {
trace(this._name);
}
}
with the movie clip called 'image'.

The problem is that this._name is equal to the instance name of 'image'. How would I get it to show 'pic0' and 'pic1' instead?

View Replies !    View Related
Dynamically Loaded Images Look Colourless.
Hi!

I'm working on a page that needs dynamic jpg loading. My problem is that all the pictures loaded from a folder (that is on server) look a litle desaturated or colourless. Black looks like gray and red is not as red as it's in the original picture. I can't figure out any reason. Is flash lowering the quality of dynamically loaded jpgs?

I'm using forceSmoothing = true on MovieClip that loads images and loading is done by using instance of MovieClipLoader class. I have set JPEG quality to 100% in publish settings, didn't help. This problem is really driving me crazy. If you have some solution or idea why this desaturation is happening, please let me know.

View Replies !    View Related
Fade In And Out Dynamically Loaded Images
OK, I have a flash header for my new site which has an effect of transitioning images with a flash in between to mock a camera flash. I have achieved this by use of the timeline, however, i dont want to use the timeline. what i have done is created a .php file which passes the location of 10 images to flash using var names img1, img2, img3, etc. I then created 10 mcs, 1, 2, 3, etc, and 10 graphic symbols, 1, 2, 3, etc. I then dynamically loaded the images into the mcs which i then placed inside of the graphic symbols. so in the end i have 10 graphic symbols which hold 10 dynamically loaded images. what i want to do is mimic the effect i have now, but using AS. I also want it to check and see if there are actually 10 images, right now i am only using 5, but i want to be able to add/remove/update the images without editing the .fla file itself. so i was thinking in there i would just need to add...


Code:
if (img1 != undefined) {
*fade script*
}
for each image to check if there is data there, if not, then it should just skip that image. that way if i only have 5 images, it will show only those 5 five and not fade in a non image. anyone help me with this please?!?!?

here is the link to the site with header

http://s170193323.onlinehome.us/MKPortalSMF/index.php

and this is my php file passing onto flash

http://s170193323.onlinehome.us/MKPo...lashimages.php

and this is my existing AS


Code:
myVars = new LoadVars();

myVars.onLoad = function()
{
img1_mc.loadMovie(this.img1);
img2_mc.loadMovie(this.img2);
img3_mc.loadMovie(this.img3);
img4_mc.loadMovie(this.img4);
img5_mc.loadMovie(this.img5);
img6_mc.loadMovie(this.img6);
img7_mc.loadMovie(this.img7);
img8_mc.loadMovie(this.img8);
img9_mc.loadMovie(this.img9);
img10_mc.loadMovie(this.img10);
}

myVars.load("http://s170193323.onlinehome.us/MKPortalSMF/flashimages.php");

View Replies !    View Related
How To Scroll Dynamically Loaded Images
How would I scroll dynamicall loaded images. I would like to use XML but that not required.

View Replies !    View Related
Masking Dynamically Loaded Images
Hi,

I'm trying to load two images dynamically (into mc placeholders) each movieclip is on a different layer over the top of each other. I want to mask the top movie clip and animate the mask to reveal the image below. When the timeline moves to the point where the mask is, the mask doesn't work and reveals the whole movieclip below. Any ideas?

View Replies !    View Related
Swapping Dynamically Loaded Images
Hello,

I am trying to build an image viewing application that essentially loads in a large series of images (~300 @ 512px by 512px) and allows the user to drag across the image area to move to a particular image in the series. I've got this implemented, and it works "alright," but it swaps images somewhat slowly and will often skip images, even when dragging quite slowly.

Because the images are dynamically loaded, AFAIK, I have to grab the image data and attach it to an empty clip with smoothing turned on, which is what I am doing to each as it is loaded (and unloading the image after a BitmapData object has been created).

Currently, images are loaded at increasingly negative depths, and swapped to depth=1 when a particular image is to be displayed (and to depth=-1 when they are swapped out).

I should note that setting '_visible' to false on all images other than the one being displayed does not appear to improve the performance. Incidentally, is there a way to set '_visible' to false before it loads, so it is invisible until '_visible' is explicitly toggled (as opposed to setting it to false in an load event handler)?

I need all the images to remain loaded so the swapping can be as snappy as possible.

Any insight as to how I can improve the performance?

Thanks!

(XP, 1GB RAM, 2.8GHZ P4)

View Replies !    View Related
Dynamically Loaded Images Look Colourless.
Hi!

I'm working on a page that needs dynamic jpg loading. My problem is that all the pictures loaded from a folder (that is on server) look a litle desaturated or colourless. Black looks like gray and red is nod as red as it's in original picture. I can't figure out the reason. Is flash lowering the quality of dynamically loaded jpgs?

Im using forceSmoothing = true on MovieClip that loads images and loading is done by using instance of MovieClipLoader class. I have set JPEG quality to 100% in publish settings, didn't help. This problem is really driving me crazy. If you have some solution or idea why this desaturation is happening, please let me know.

View Replies !    View Related
How Do You Size Dynamically Loaded Images?
Hi,

I am loading images from mysql into flash using php, I need to make thumbnails out of these images, so they need to be resized as they are loaded in and then displayed to one set size. Does anyone have any ideas?

thanks

Gavin

View Replies !    View Related
How To Preload Dynamically Loaded Images
i'm working on a photo gallery with flash mx.. the problem is i'm using quite a lot of photos.. and they have to be updated from time to time..

I got help from this website.. on the tutorial on how to dynamically load images into the gallery.. this way.. i can change the images whenever i want... I've combined this tutorial with the infinite menu tutorial ..so i have a scrollingbar(the buttons itself are dynamically loaded images) as buttons for dynamically loaded images..

the problem is.. these pictures are not loaded during preloading.. hence.. images in the scrolling bar are shown empty initially.. and pop up one by one later..

the more efficient way would be for all the images to preload first before the gallery starts.. i've been searching through the internet for such tutorials..found some really close one... but i don't quite understand them.. i'm still new to flash.. in fact.. this is my first flash website... and i have little understanding of actionscript...

i hope u can help me with this

View Replies !    View Related
Images In Dynamically Loaded Text
Is it possible to place images in a dynamic text box? The <img src> tag didn't work. Is this even possible at all?

View Replies !    View Related
Dynamically Loaded Images And Scrolling
Hello....I am currently creating a section for a client that needs to be updated frequently by them...I need help in creating a scroller similar to the claudio ease scroller....However, i want to be able to load images into the scroll box dynamically and have the scroller adjust to the image sizes when they are changed by the client...I tried loading the images dynamically directly into the Claudio-ease scroller and it does not accomplish this....Instead it scrolls only as far as you set the box and not to the sizes of the images....

View Replies !    View Related
Rollovers On Dynamically Loaded Images
For the life of me, I cannot get any rollovers to work with the images that have been loaded from XML. I can target them and set the _alpha and whatnot, but rollover/out/press functions don't seem to work :[
I've tried many different ways... does anyone see what's wrong?



Code:
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
title = [];
type1 = [];
type2 = [];
type3 = [];
ypos = [];
total = xmlNode.childNodes.length;
//////////
for (i=0; i<total; i++) {
ypos[i] = (135 * i) + 225;
title[i] = xmlNode.childNodes[i].childNodes[0].childNodes[0].nodeValue;
image[i] = xmlNode.childNodes[i].childNodes[1].childNodes[0].nodeValue;
type1[i] = xmlNode.childNodes[i].childNodes[2].childNodes[0].nodeValue;
type2[i] = xmlNode.childNodes[i].childNodes[3].childNodes[0].nodeValue;
type3[i] = xmlNode.childNodes[i].childNodes[4].childNodes[0].nodeValue;
//////////
///create thumbs
var thumb_mc:MovieClip = _root.main.createEmptyMovieClip("thumb"+ (1 + i), _root.main.getNextHighestDepth());
thumb_mc._x = 0;
thumb_mc._y = ypos[i];
loadMovie (image [i] , thumb_mc);




//////////////////////////////////////////////////////////////////////
///////////////////////////////FUNCTION////////////////////////////
//////////////////////////////////////////////////////////////////////

thumb_mc.onRollOver = function () {
trace("YUP-over"); //should work
}
thumb_mc.onRollOut = function () {
trace("YUP-out"); //should work
}

//////////////////////////////////////////////////////////////////////
///////////////////////////////FUNCTION////////////////////////////
//////////////////////////////////////////////////////////////////////






}

} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("data.xml");
/////////////////////////////////////
THANK YOU for your help.

View Replies !    View Related
Fade In And Out Dynamically Loaded Images
I currently have achieved a look on my header using the timeline to fade in and out a series of photographs and make them flash like a camera flash between each photo. I have created a .php file to pass on the location of up to 10 files to flash using img1, img2, img3, etc as the var names. I would like to be able to change/replace the existing files so they would change in the header without having to edit the .fla file itself. little help? thanks!

this is the .php file....

Dynamic Images .php for Flash

this is the location of the header....

The Images On The Right

View Replies !    View Related
AS 2 Caching Dynamically Loaded Images
hey,

wonder if anyone can shed light on this for me...

ok, i've built a site that loads in images (jpeg) dynamically. a php file looks at my image directory, and makes all the filenames into a list... then in flash i take that list and populate an array with the filenames.

then with my interface the user can navigate to the next / previous image, which then uses the movieClipLoader class to load the jpeg into the movieclip, and i use onLoadProgress to throw in some code to control my preloader graphic.

the problem i'm having, is that flash doesn't seem to be caching the images once already loaded (as in, if the user goes back to a previously loaded image, the image gets preloaded all over again).

the strange thing is... sometimes it caches images, and sometimes it doesn't... (although with the latest images i've uploaded its not caching any) so i'm ruling out anything wrong with my actionscript (famous last words) and was thinking it was an issue with the server or even the jpegs (maybe different compression settings?!).

can anyone offer an explanation?

cheers,
martin.

View Replies !    View Related
Jumpy Dynamically Loaded Images
I've been working with this problem all day now with no luck.

I'm using Lee's carousel to create a circular menu that rotates very slowly. I have the menu on a seperate swf to make life easier. However, when the main swf loads the menu, the images in the menu get very pixely and jumpy.

Is there a solution to this? Or should I just put the menu into the main swf instead?

View Replies !    View Related
Hyperlinking Dynamically Loaded Images
I have a slideshow that I've put together based on a tut from oman3d.com. I know very little about actionscripting and need to modify the code to allow me to hyperlink each individual image to their own url. Here's the code I'm using now. Any assistance would be greatly appreciated.


Code:

this.createEmptyMovieClip("container",1);

var imagesNumber:Number = 10;
for (i=1; i<=imagesNumber; i++) {
container.attachMovie("image"+i,"image"+i+"_mc",i);
myImage_mc = container["image"+i+"_mc"];
myImage_mc._x = (i-1)*myImage_mc._width;
myImage_mc._alpha=25;

// need this link to be unique for each image, I can predefine what image 1, 2, 3 etc. should link to, but have no idea where to begin. Tried switch statements, if's, etc. to no avail.
myImage_mc.onRelease = function(){
getURL("http://www.link.php", "_parent");
}

myImage_mc.onRollOver = function(){
this._alpha=100;
}
myImage_mc.onRollOut = function(){
this._alpha=25;
}
}

container.onEnterFrame = function() {
this._x += Math.cos((-_root._xmouse/Stage.width)*Math.PI)*15;
if (this._x>0) {
this._x = 0;
}
if (-this._x>(this._width-Stage.width)) {
this._x = -(this._width-Stage.width);
}
};

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved