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








Resizing Dynamically Loaded Jpegs


Hi,
I am loading JPEGs into an MC called pictureHolderMC using "loadMovie" without a problem. But, the JPEGs are different sizes and I need them to be a constant width (100 pixels) so I am using the code below to set this:

Code:
_root.pictureHolder._width = 100;
But when I add this code the JPEG disappears from "pictureHolderMC". I know that "pictureHolderMC" is still there as I put a background colour block in it which still shows up, but without the JPEG.
Ultimately, I will write a function that also sets the "_height" property in proportion, but I need to get the basics of controlling the size to work first.
Any suggestions as to how o achieve this would be much appreciated.




ActionScript.org Forums > ActionScript Forums Group > ActionScript 1.0 (and below)
Posted on: 04-05-2007, 12:50 PM


View Complete Forum Thread with Replies

Sponsored Links:

Resizing Externally Loaded Jpegs
Does anyone have any idea on how to resize an externally loaded jpeg once it's been loaded? When I try and set the _height/_width of the movie clip that they're being loaded into, Flash seems to reset them both to 0, but if I leave them alone and check them in the debugger, it shows them as the height/width of the image I'm loading externally.

View Replies !    View Related
Help With Dynamically Loaded Jpegs
I am using this tutorial to load jpegs into container mc's
http://www.kirupa.com/developer/mx/loading.htm

The images show up on computers with flash player 8, but not on computers with flash player 7 or below.
any idea why?
and how do i make them show up in flash player 7.
thanks

View Replies !    View Related
Dynamically Loaded Jpegs
I loaded a picture dynamically but it looks very sharp and stands out too much. Is there a way that i could put a border around the picture (probably a mask) to help it to blend in more

heres the code i used to genreate the jpeg.

Quote:




_root.createEmptyMovieClip("imageHolder1", 200);
imageHolder1._x = 160;
imageHolder1._y = 55;
loadMovie("digicel.jpg", "imageHolder1");
stop();

View Replies !    View Related
Properties On Jpegs Loaded Dynamically
Hello,

Is there a way to change the properties of a jpeg using loadMovie()? The properties I want to change are the width and height of the picture.

For example, I am loading a picture using this stmt.

loadMovie("Cinema-"+whichPic+".jpg", "square");

where whichPic is simply an integer number. Is there a way to duplicate the mc square and then resize it so that it serves as a thumbnail?

Thanks for your help,
Fabocp

View Replies !    View Related
Preloading Dynamically Loaded JPEGs?
I have three movie clips that each dynamically load a JPEG...i have the code that loads the JPEGs placed on one of the first frames...the problem is that there is a pause or delay...until the JPEGs are loaded...which leaves the screen with a void...and makes you think there is no content...how can I put a preloader that will show the user that the images are being loaded?

thanks,
diabolicalbutter

View Replies !    View Related
Need To Scale Dynamically Loaded Jpegs
Hi,

I'm dynamically loading movies (jpegs) and attaching them to another movie one at a time. Since the jpegs are all different sizes, is there a script I can use to scale all of them to the size of the object that I'm attaching them too? I've been trying to use:

code:
_root.onEnterFrame = function() {
loadMovie("../images/image"+whichPic+".jpg", "screen");
this.screen["image"+whichPic+".jpg"]._x = screen._x;


with no success. The image (there's only one at the moment) appears but it's way too big and needs to be scaled to the "screen" object it's attached to.


TIA,
aaroneousmonk

View Replies !    View Related
Dynamically Loaded Jpegs---PROBLEMS
Hey guys
I'm loading JPEGs dynamically from a DB using PHP and LoadVars in FMX. I get the images to load perfectly. but i'm having a problem moving them into proper placement.

Goal= I'm trying to load all the images into a specific area and have them dynamically resized so they all fit within the area (another MC).
I'm creating empty movie clips and loading the jpegs into them.


Problem = The created MCs wont MOVE OR RESIZE!! They'll place properly, but no animation!

i'm using this function for motion:

MovieClip.prototype.slideTo = function(x, y, speed) {
//set up targets and speed variable
this.targetX = x;
this.targetY = y;
this.speed = speed;
//create onEnterFrame function
this.onEnterFrame = function() {
//take care of motion
this._x += (this.targetX-this._x)/this.speed;
this._y += (this.targetY-this._y)/this.speed;
// check if near target
if (Math.abs(this.targetX-this._x)<0.2 && Math.abs(this.targetY-this.y)<0.2) {
this._x = this.targetX;
this._y = this.targetY;
}
};
};
//
//
//and this to place the photos
//

function getPhotos(List) {
x = 0;
for (var item in List) {
//loop thru and get images, place them in
myitem = List[item].filename;
mypic = _root.createEmptyMovieClip("image"+x, x++);
loadMovie("thumbs50/"+myitem+".jpg", "image"+x);
trace (_level0.mypic._width);
_root["image"+x]._width = 100;
_root["image"+x]._height = 100;
_root["image"+x].slideTo(someX, someY,someSPEED);

}
}

where someY, someX, someSPEED, will be generated by another script.

Help!
my code is a little sloppy, its still in the works....
i may be overlooking something small, please help.

You can look at what i mean about the photo placement here, I'm trying to recreate this in flash MX: Distortion Photography
(there's a JS error on the page, click thru it).



Thanks in Advance
Jbot

View Replies !    View Related
Problem With Dynamically Loaded Jpegs
i've created a site for a photographer using dynamically loading jpg's to minimize file size. The site works fine on most of the computers i've checked it on, but on some computers, especially macs, the WHOLE site goes down when the first jpg unloads...
does flash player 6 deal with loading and unloading jpegs in the same way as 7? might this be my problem?

View Replies !    View Related
Centering Dynamically Loaded JPEGs
I know this has been asked a million times- and trust me, I tried everything I could find in these forums, but nothing seems to be working right for me. I have a gallery that dynamically loads JPEGs from an XML file. It uses next/previous buttons to flip through the code.

The main code is:

ActionScript Code:
function loadXML(loaded) {
    if (loaded) {
        xmlNode = this.firstChild;
        image = [];
        description = [];
        total = xmlNode.childNodes.length;
        for (i=0; i<total; i++) {
            image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
            description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
        }
        firstImage();
    } else {
        content = "file not loaded!";
    }
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
// ///////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {
    if (Key.getCode() == Key.LEFT) {
        prevImage();
    } else if (Key.getCode() == Key.RIGHT) {
        nextImage();
    }
};
Key.addListener(listen);
previous_btn.onRelease = function() {
    prevImage();
};
next_btn.onRelease = function() {
    nextImage();
};
// ///////////////////////////////////
p = 0;
this.onEnterFrame = function() {
    filesize = picture.getBytesTotal();
    loaded = picture.getBytesLoaded();
    preloader._visible = true;
    if (loaded != filesize) {
        preloader.preload_bar._xscale = 100*loaded/filesize;
    } else {
        preloader._visible = false;
        if (picture._alpha<100) {
            picture._alpha += 10;
        }
    }
};
function nextImage() {
    if (p<(total-1)) {
        p++;
        if (loaded == filesize) {
            picture._alpha = 0;
            picture.loadMovie(image[p], 1);
            desc_txt.text = description[p];
            picture_num();
        }
    }
}
function prevImage() {
    if (p>0) {
        p--;
        picture._alpha = 0;
        picture.loadMovie(image[p], 1);
        desc_txt.text = description[p];
        picture_num();
    }
}
function firstImage() {
    if (loaded == filesize) {
        picture._alpha = 0;
        picture.loadMovie(image[0], 1);
        desc_txt.text = description[0];
        picture_num();
    }
}
function picture_num() {
    current_pos = p+1;
    pos_txt.text = current_pos+" / "+total;
}

I tried using the following statement in the actually MC called picture

ActionScript Code:
onClipEvent(enterFrame){
    if (!this.loaded && this.getBytesLoaded() > 0 && this.getBytesLoaded() == this.getBytesTotal()){
        this._x -= this._width/2;
        this._y -= this._height/2;
        this.loaded = true
    }
}
It works for the first image and then does not update when the image changes. I also tried moving minor variations of that code around in the main code blurb above, but it does nothing there. Is there something I can add for it to update on change?

Thanks!

View Replies !    View Related
Getbytesloaded, Dynamically Loaded Jpegs Etc.
hi all
i have searched the site and read all the links on dynamically loaded jpegs listed in cyanblues post above, but i'm still not understanding where i'm going wrong. i'd be grateful for advice:

here's what i'm doing, 1 & 2 work fine but 3 is where it all stop working as I would expect:


1. duplicate the original:
------------------------

ActionScript Code:
for (Mainnumber=0; Main number<(NumberOfItems); Mainnumber++) {
        this.originalMain.duplicateMovieClip("main" + Mainnumber, Mainnumber);
        _root["main" + Mainnumber]._y = (Mainnumber * 75) + 1;
}

2. load jpeg to the symbol: (this script attached to the originalMain)
------------------------

ActionScript Code:
onClipEvent (load) {

    myname = this._name;
    myMainnumber = myname.charat(4);
    barcodenum = _parent.items[myMainnumber];
    mainpicfilename = "mainphotos/"+barcodenum+".jpg";
    loadMovie(mainpicfilename, this.mainphotos);

}
3. to check the bytes loaded, i am trying this on the next frame
----------------------------------------------

(this just to debug; i would actually have a while {} loop waiting for them all to returnt that they are loaded)

to check just one of the images, inside main1, main2 or main3:

ActionScript Code:
trace(_root.TargetMC.main1.mainphotos.getBytesTotal());
trace(_root.TargetMC.main2.mainphotos.getBytesTotal());
trace(_root.TargetMC.main3.mainphotos.getBytesTotal());

but these always returns a value of 12 -- it must be the byte size of the symbol itself not the jpeg (which is about 100k), even if i loop it 100 times to simulate some wait time....

so my question is how do i do getBytesTotal() (and of course getBytesLoaded() ) on the jpeg so that I can evaluate the difference...?

does it just not work on dynamically loaded jpegs?

i would be grateful if someone could explain the exact procedure for a. dynamically loading the jpegs; b. checking that they are loaded -- i thought i knew what i was doing but, first, it didn't work and second, when i read through the posts mentioned above it really threw me.....

thanks.......

View Replies !    View Related
How Do I Close Dynamically Loaded Jpegs?
i have dynamically loaded jpeg , but now how do i make it dissappear when its clicked on?

View Replies !    View Related
How Do I Close Dynamically Loaded Jpegs?
i have dynamically loaded jpeg , but now how do i make it dissappear when its clicked on?

View Replies !    View Related
Problem With Dynamically-loaded Jpegs
i recently completed a site that dynamically loads jpegs and when viewed in a browser, the pics are SO blurry. i'm confused because i have another site, set up the same way, and the pics aren't blurry at all.
the pics for the two sites were taken by two different digital cameras, but i optimize them the same way in photoshop.

here's blurry (go to the PHOTOS section):
http://www.thegaragebar.net

here's not blurry (go to FOR RENT section):
http://www.urbanrestorationsproject.com

what am i doing wrong with the first site?

View Replies !    View Related
Dynamically Loaded Jpegs And OnEvent Handlers
i've got a movie that attaches a blank mc on the stage via attachMovie, and then loads a jpeg into it via loadMovie. The problem is, once this is done the image will not respond to user input (i.e. onRelease, onRollOver don't work) Can anyone explain why this happens?

View Replies !    View Related
Crossfades On Dynamically Loaded Jpegs - Any Tutes Out There
Hi. I am working on a click through type slide show (photographers site). All the images are being loaded in dynamically. At present the images are fading out- then fading in, done by actionscript. All works fine. However what I really need is to cross fade the images. I have searched the forums but all to no avail although the question of crossfades did come up a few times but with no answers. I had a look at the source code that was available from www.whatdoiknow.org/archives.shtml. However I need the images to be click though not automatic and i don't know enough as to how to alter that code. What I did manage to pull from the code is that I might need to create 2 mc containers and load the images into varying levels. That is my theory but I have no idea how to implement this. If I am somewhere warm with this, or if any one can help with code, or if anyone can point me to a tutorial I would be very very very grateful.

thanks in advance

View Replies !    View Related
Preload Dynamically Loaded Jpegs And Fade
I have been researching the forums on information to do this. To be quite honest, I'm still somewhat of a Newb so I'm having difficulty piecing everything together. Here is what I am looking to do!

I would like to preload 10 dynamic jpegs into a movieClip. I want the getBytesTotal function active, showing the progress in the swf preload. I don't want the movie to start playing until the jpegs are loaded. Once they are loaded, I would like them to fade from one another, and loop.

I was going to simply program it within flash, but that's a heavy file, I do know how to simply load dynamic images, but I have no idea how to interact it with a preloader and AS to make them fade.

Any help would be appreciated, if anyone is willing to post a sample file, I usually can figure it out from there.

Thanks

View Replies !    View Related
Preload Dynamically Loaded Jpegs And Fade
I have been researching the forums on information to do this. To be quite honest, I'm still somewhat of a Newb so I'm having difficulty piecing everything together. Here is what I am looking to do!

I would like to preload 10 dynamic jpegs into a movieClip. I want the getBytesTotal function active, showing the progress in the swf preload. I don't want the movie to start playing until the jpegs are loaded. Once they are loaded, I would like them to fade from one another, and loop.

I was going to simply program it within flash, but that's a heavy file, I do know how to simply load dynamic images, but I have no idea how to interact it with a preloader and AS to make them fade.

Any help would be appreciated, if anyone is willing to post a sample file, I usually can figure it out from there.

Thanks

View Replies !    View Related
Problem With Preloader For Dynamically Loaded Jpegs
I use this code to display the progress of the jpeg im loading dynamically into my empty movieclip, bildholder.


bytes_loaded = Math.round(bildholder.getBytesLoaded());
bytes_total = Math.round(bildholder.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
loadpic = "_loading_product "+Math.round(getPercent*100)+" % loaded";
if (bytes_loaded >= bytes_total) {
gotoAndPlay("done");
}

The problem is that I cant get the line:
bytes_total = Math.round(bildholder.getBytesTotal());

to work. It seems that Flash have a problem getting the TotalBytes for a dynamically jpeg.

When i set bytes_loaded to a fix number, say 5000, then the preloader works but not wgen I use the command .getBytesTotal()

Can anyone tell me why or how I can solve this problem.

View Replies !    View Related
Problem With Preloader For Dynamically Loaded Jpegs
I use this code to display the progress of the jpeg im loading dynamically into my empty movieclip, bildholder.


bytes_loaded = Math.round(bildholder.getBytesLoaded());
bytes_total = Math.round(bildholder.getBytesTotal());
getPercent = bytes_loaded/bytes_total;
loadpic = "_loading_product "+Math.round(getPercent*100)+" % loaded";
if (bytes_loaded >= bytes_total) {
gotoAndPlay("done");
}

The problem is that I cant get the line:
bytes_total = Math.round(bildholder.getBytesTotal());

to work. It seems that Flash have a problem getting the TotalBytes for a dynamically jpeg.

When i set bytes_loaded to a fix number, say 5000, then the preloader works but not wgen I use the command .getBytesTotal()

Can anyone tell me why or how I can solve this problem.

View Replies !    View Related
Movie Clip With Dynamically Loaded JPEGs Not Responding To Mouse Clicks
I have a movie clip called pictureframe that I am loading JPEGs into sequentially with a movieClipLoader. I want to be able to click on each JPEG and go to a different web site, but it's not working. The MC is not accepting mouse clicks. Here's the code I'm using:


Code:
this.pictureframe.onRelease = function() {
getURL("http://www.a_web_site.com");
}


If this were a normal movie clip with some content "hard coded" into it, it would work fine. It's gotta have something to do with the fact that it's a movie clip that's empty until it gets a JPEG loaded into it.

View Replies !    View Related
Controlling/Transofmring Dynamically Loaded Pics(jpegs) - File Attached
Hey all,

I'm trying to create this polaroid development effect, which has been tweened, problem is I would kie the pics to load dynamically into a placeholder MC. This is fine, but the JPG loads, flashes upa nd then disappears, meaning the effect is rendered useless.

File can be got here:
http://www.thoughtography.net.au/temp/polaroid.fla

Please help :S

cheers.

View Replies !    View Related
Controlling/Transofmring Dynamically Loaded Pics(jpegs) - File Attached
Hey all,

I'm trying to create this polaroid development effect, which has been tweened, problem is I would kie the pics to load dynamically into a placeholder MC. This is fine, but the JPG loads, flashes upa nd then disappears, meaning the effect is rendered useless.

File can be got here:
http://www.thoughtography.net.au/temp/polaroid.fla

Please help :S

cheers.

View Replies !    View Related
Resizing A Dynamically Loaded SWF
Hi, I'm trying to load in a movie using 'loadMovie' into an empty movie clip. The movie being loaded is a linear playing .swf movie I made using Sorenson Squeeze. I've got a 320x240 video and I want to resize it to 240x180 and play in my flash presentation. Whenever I try to change the movie container's width/height the movie disappears. I can hear the audo but no video. Here's an example of what I've tried:


Code:

movieToOpen = video_txt.text;
_root.createEmptyMovieClip("movieHolder_mc", 100);
movieHolder_mc.loadMovie(movieToOpen);
movieHolder_mc._width = 240;
movieHolder_mc._height = 180;
I've also tried using a .onData event to do resizing there. What am I doing wrong? Or can you just not resize a swf like this? Any help is appreciated, thanks

View Replies !    View Related
Resizing A Dynamically Loaded SWF
Hi, I'm trying to load in a movie using 'loadMovie' into an empty movie clip. The movie being loaded is a linear playing .swf movie I made using Sorenson Squeeze. I've got a 320x240 video and I want to resize it to 240x180 and play in my flash presentation. Whenever I try to change the movie container's width/height the movie disappears. I can hear the audo but no video. Here's an example of what I've tried:


Code:

movieToOpen = video_txt.text;
_root.createEmptyMovieClip("movieHolder_mc", 100);
movieHolder_mc.loadMovie(movieToOpen);
movieHolder_mc._width = 240;
movieHolder_mc._height = 180;
I've also tried using a .onData event to do resizing there. What am I doing wrong? Or can you just not resize a swf like this? Any help is appreciated, thanks

View Replies !    View Related
Dynamically Loaded Picture - Resizing
I am working on a picture viewer that will step through all pictures in folder. The pictures are all different sizes.

How would i go about resizing the dynamically loaded picture to fit inside a specified area in the movie? Below is the update function used to load the picture.

Thanks

function update() {
url = filename+picnum+".jpg";
loadMovie(url, picture);
}

View Replies !    View Related
Resizing Jpgs Loaded Into A Mc Dynamically
I have a drag and drop card wizard. Where there are at least 3 hit test areas. If the hit test is true the dragable button loads a external jpg into the mc holder.

What I would like to do is have the jpeg dynamically resize to fit the empty mc. Each hit area/mc holder for the jpeg are different sizes, so I would like the jpeg to accomadate the mc holder.The mc holders need to be a set size.

Any help with this is so appreciated! Thanks all in advance.

View Replies !    View Related
Resizing Container To Fit A Dynamically Loaded File
what's up? is there any way to have a container resize itself to the size of an externally loaded file such as a jpg?

right now i'm making a portfolio with many different pics, animations etc. to keep the file size down i'm storing all of my main files in an array and loading them via the loadMovie(); function. here is the problem:

there is a square on the screen in which is an empty movieclip that i'm using to load the file into. laying on top of this empty movieclip in a layer on top of it, i have a white outline that acts as a frame. i'd like the CONTAINER to scale itself to match that of the loaded file and also would like to have the FRAME layer to scale itself accordingly.

please help
thanks
itriix

View Replies !    View Related
[F8] Dynamically Resizing Externally Loaded Images
Hey,

I'm having a lil bit of a problem, I'm trying to load an image into an existing MC and then both get and set it's width and height.

Right now I'm loading the image in just fine, I stop the movie at the top of the script and tell it to play when it's been fully loaded (I use the MovieClipLoader class for that). the image loads in and the movie plays fine but if I try to resize it at all (in the onLoadComplete) the image just dissapears...

I'm pretty sure I'm just missing something starring me in the face but I"ve been grappling with this for a while (I fixed up a cheap workaround in the meantime). Any help would be VERY appreciated,

Thanks,

-Sandy

View Replies !    View Related
Question About Resizing An Dynamically Loaded Imag
hi guys, I found the following script to dynamically load images and thumbnails into their respective containers:


ActionScript Code:
xmlData = new XML ();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load ("1a.xml");
////////////////////////////////////
function loadXML (loaded) {
    if (loaded) {
        xmlNode = this.firstChild;
        image = [];
        description = [];
        thumbnails = [];
        total = xmlNode.childNodes.length;
        for (i = 0; i < total; i++) {
            image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
            description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
            thumbnails[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
            thumbnails_fn (i);
        }
        firstImage ();
    } else {
        content = "file not loaded!";
    }
}
/////////////////////////////////////
previous_btn.onRelease = function () {
    prevImage ();
};
next_btn.onRelease = function () {
    nextImage ();
};
/////////////////////////////////////
p = 0;
this.onEnterFrame = function () {
    filesize = picture.holder.getBytesTotal ();
    loaded = picture.holder.getBytesLoaded ();
    preloader._visible = true;
    if (loaded != filesize) {
        preloader.preload_bar._xscale = 100 * loaded / filesize;
    } else {
        preloader._visible = false;
        if (picture.holder._alpha < 100) {
            picture.holder._alpha += 5;
        }
    }
};
function nextImage () {
    if (p < (total - 1)) {
        p++;
        if (loaded == filesize) {
            picture.holder._alpha = 0;
            picture.holder.loadMovie (image[p], 1);
            desc_txt.text = description[p];
            //trace(description[p]);
            picture_num ();
        }
    }
}
function prevImage () {
    if (p > 0) {
        p--;
        picture.holder._alpha = 0;
        picture.holder.loadMovie (image[p], 1);
        desc_txt.text = description[p];
        //trace(description[p]);
        picture_num ();
    }
}
function firstImage () {
    if (loaded == filesize) {
        picture.holder._alpha = 0;
        picture.holder.loadMovie (image[0], 1);
        desc_txt.text = description[0];
        //trace(description[0]);
        picture_num ();
    }
}
function picture_num () {
    current_pos = p + 1;
    pos_txt.text = current_pos + "/" + total;
    //trace(current_pos+" / "+total);
}
function thumbNailScroller () {
    // thumbnail code!
    this.createEmptyMovieClip ("tscroller", 1000);
    scroll_speed = 5;
    tscroller.onEnterFrame = function () {
        if ((_ymouse >= thumbnail_mc._y) && (_ymouse <= thumbnail_mc._y + thumbnail_mc._height)) {
            if ((_xmouse >= (hit_right._x - 40)) && (thumbnail_mc.hitTest (hit_right))) {
                thumbnail_mc._x -= scroll_speed;
            } else if ((_xmouse <= (hit_left._x + 40)) && (thumbnail_mc.hitTest (hit_left))) {
                thumbnail_mc._x += scroll_speed;
            }
        } else {
            delete tscroller.onEnterFrame;
        }
    };
}
function thumbnails_fn (k) {
    thumbnail_mc.createEmptyMovieClip ("t" + k, thumbnail_mc.getNextHighestDepth ());
    tlistener = new Object ();
    tlistener.onLoadInit = function (target_mc) {
        target_mc._x = hit_left._x + (target_mc._width + 5) * k;
        target_mc.pictureValue = k;
        target_mc.onRelease = function () {
            p = this.pictureValue - 1;
            nextImage ();
        };
        target_mc.onRollOver = function () {
            this._alpha = 50;
            thumbNailScroller ();
        };
        target_mc.onRollOut = function () {
            this._alpha = 100;
        };
    };
    image_mcl = new MovieClipLoader ();
    image_mcl.addListener (tlistener);
    image_mcl.loadClip (thumbnails[k], "thumbnail_mc.t" + k);
}


now, all this works perfect, but what I want is to automatically resize the loaded images to the maximum size of the picture.holder MC (which is 350 x 350). The problem for me is that I want the image to scale proportionatly. For instance, if an image is 600 x 450 I want the longest side (in this case the width) to be resized to 350, but the height should be proportionatly resized to 235 or something in order to keep the same proportion. Can someone help me out with this, because I cant figure out how to do this...

thanks!

View Replies !    View Related
Problem With Loading Jpegs Dynamically Into Dynamically Created MC's
hey all. I got a problem with loading jpegs dynamically into dynamically created MC's. I've been using NEIL WEBB's tutorial on dynamic creation with event handling through the LISTENER component, which you can see here http://www.actionscript.org/tutorial...MX_2004_Part2/

I have slightly altered the script to accomodate the fact that I want to attach a movieclip with text fields and image holders within it, but the code aint too different I don't think.


Code:
stop();
myMCL = new MovieClipLoader(); //define MovieClipLoader
myListener = new Object(); //define listener
myListener.onLoadComplete = function(targetMC){ //set the onComplete function on listener
trace("targetMC = " + targetMC._name);
targetMC.onPress = function() { //define onPress within function

}
}
//****************************
function initClips(){
//trace(_global.gallery_cnt);
for (i=1; i<=_global.gallery_cnt; i++){
//trace("Attaching Clip - " + i);
this.gallery_TN_holder.attachMovie("TN_Holder", "TN_Holder" + i, i); //attach the movie
this.gallery_TN_holder["TN_Holder"+i]._x = (i-1)*90; //spacing
this.gallery_TN_holder["TN_Holder"+i].TN_Text.text = _global.gallery_array.description;
[i] [i]myMCL.loadClip(_global.gallery_array.main_thumbnail ,this.gallery_TN_holder["TN_Holder"+i].TN_Image);
//load images into clip
}
play();
}
//****************************
myMCL.addListener(myListener); //associate listerer with MCL object
initClips();
The first line ("trace") in bold outputs

Quote:




targetMC = TN_Image
targetMC = TN_Image




which you can see is resulting from the second bold line.

Basically I need some direction with this as to how to reference the clip target for the loaded JPEG, as my output in the movie shows the attachMovie works, as does the text change within the individual "TN_Holder" clips. What the hell am i doin wrong, cos my eyes are kinda starting to go kinda funny looking at this stuff!!!!!

Thanks for any help!

View Replies !    View Related
STRESS Resizing Imported Jpegs
Hi everybody,

I am VERY new to actionscripting and have got myself into a bit of a muddle. I am trying to import a jpeg image into an empty movie clip and then resize the image. I can scale it, and position it but I can't resize it.

Somebody suggested creating a movieclip in Flash first and giving it an instance name. Then use loadMovie to place the jpeg into that movieclip. This did work and allowed me to resize it but only the movieclip would be resized which in turn resized the image proportionally. I still couldn't specify exact dimensions of the image - only the movieclip. I hope this makes sense... I think I've lost myself!!

Any ideas of help would be greatly appreciated.

Many thanks in advance



Brasso

View Replies !    View Related
STRESS Resizing Imported Jpegs
Hi everybody,

I am VERY new to actionscripting and have got myself into a bit of a muddle. I am trying to import a jpeg image into an empty movie clip and then resize the image. I can scale it, and position it but I can't resize it.

Somebody suggested creating a movieclip in Flash first and giving it an instance name. Then use loadMovie to place the jpeg into that movieclip. This did work and allowed me to resize it but only the movieclip would be resized which in turn resized the image proportionally. I still couldn't specify exact dimensions of the image - only the movieclip. I hope this makes sense... I think I've lost myself!!

Any ideas of help would be greatly appreciated.

Many thanks in advance



Brasso

View Replies !    View Related
Dynamically Loading Jpegs
Hi Flash experts,

Have two questions, hope you can come to the rescue as I am pretty new to Flash.

1) Is it possible to display an image in Flash? Say I have a text file containing the URL to the images, is it possible for flash to read those URL and display it?

2) Is it possible to change the Flash canvas size (after it has been published) using Actionscript?

Thanks!

- boon

View Replies !    View Related
Dynamically Load Jpegs
Is it possible to dynamically load jpegs from a text file? Thanks

View Replies !    View Related
Loading JPEGS Dynamically
Hi people!

Does anybody know of a tutorial on Loading JPEGS Dynamically?

Could really do with it!

Cheers

Deadhands

View Replies !    View Related
Dynamically Preloading Jpegs
Hi there,

I know this has been asked a thousand times, but my problem doesnt seem to have been answered anywhere.

When i go to perform getbytestotal on my dynamically pulled images, it just returns a value of zero instead of the actual image size.

Does anyone have any ideas why this would be occurring ?
My code looks something like this.

_root.createEmptyMovieClip("imageHolder1", 201);
_root.imageholder1.loadMovie( +fsdir +fsimage1, "_root.imageHolder1");

bT =_level201.imageholder1.getBytesTotal();
bL =_level201.imageholder1.getBytesLoaded();

etc . . .

Any ideas folks ?

View Replies !    View Related
Loading Jpegs Dynamically
Hey All,

i was wondering if someone could maybe tell me the answer to this.

ok say your making a menu from XML with a for loop

how would you go about loading the thumbnail image into the holder clip, i know the XML is working coz i traced it but well look.

...

_root.nav.attachMovie("module","module"+i,i)
_root.nav["module"+i]._y = (i*heightTotal);
loadMovie (picXML[i],_root.nav["module"+i].pic);
trace (picXML[i]);

..

third line see this is prob the worst thing i have tried so dont make fun of me

i tried

_root.nav["module"+i].clip.loadMovie (picXML[i]);

(clip being the holder for the jpeg)

that dont work either but i know for a fact the xml is giving me the name

1.gif
2.gif etc etc

Any ideas what im doing wrong? Never used this loding in before of images and its got me

thanks :P

View Replies !    View Related
Loading Jpegs Dynamically?
I saw that this is possible and am wondering if it's just like dynamic text? Are these jpegs from an outside source? Any articles or tutorials about this would be amazing. Thanks

View Replies !    View Related
Dynamically Load Jpegs?
Is it possible to dynamically load jpeg images into your swf movies?

I'm working on a shopping cart and would like to be able to load images of various products on demand. I'm using Flash 5, and can't find anything that allows this so far. The closest I can get is to create a small swf file with an image statically embedded in it, and then use the loadMovie() actionscript function...

This is obviously not a viable solution for a shopping cart application where an administrator of the store uploads new pictures of various products on a regular basis.

View Replies !    View Related
Dynamically Generating JPEGS
Help....

Does anyone know how to dynamically generate JPEGS from Flash?

Got this project where, the user creates a wallpaper by
1) Selecting the a dog species
2) Selecting a series of accessories to dress it up with such as hats, coats, shoes, collars etc
3) Then the user can save and export their creation as a wallpaper.

I am ok with points one and two but the exporting out to JPEG is where I am stuck. Any suggestions would be appreciated?

View Replies !    View Related
Dynamically Linking MP3 And Jpegs
Every MP3 and Jpeg on my website is loaded Dynamically via the loadSound method. It works perfect on the final SWF and it also looks good on DreamweaverMX. However when uploaded to the webserver via FTP, the SWF plays fine but nothing that was dynamically linked will show up. I uploaded all the MP3 and Jpeg files to the server also but the problem still persists. Any help? Thanks for your time

Frank P

View Replies !    View Related
Dynamically Loading JPEGS
I'm creating a little movie that will play through jpegs. nothing fancy, just a back and next button. My code doesnt work and i cant figure out why.

Any insights?

Thanks

Greg


ActionScript Code:
//create array with jpeg info
var slides:Array = new Array("1.jpg", "2.jpg", "3.jpg", "4.jpg");
 
//create and set properties for images to load into
createEmptyMovieClip("picture_mc",1);
picture_mc._xscale = 20;
picture_mc._yscale = 20;
picture_mc._y = 20;
picture_mc._x = 20;
 
//init variable
var currentSlide:Number;
 
//function to load images
function changeSlide(number){
    if (number >= 0 && number < slides.length){
        currentSlide = number;
        loadMovie (slides[1], "picture_mc");
        }
}
//call function
changeSlide(0);
 
//back and next buttons
back_mc.onRelease = function(){
    changeSlide(currentSlide - 1);
}
next_mc.onRelease = function(){
    changeSlide(currentSlide + 1);
}

View Replies !    View Related
Dynamically Loading JPEGs And Then Downloading Them
I'm a newbie and I want to dynamically load a jpeg from a button. Once the jpeg opens, I want to download it. Is this possible? Any coding tips would be great. Hope this makes sense. Thanks for any recommendations!!

View Replies !    View Related
Dynamically Loading Jpegs In A Movie
Hi all,
I am trying to create a flash movie that will dynamically load a series of different jpegs. I need the jpegs to load at runtime so that they are not all downloaded at the sametime. Also, is there a way that i can have the images appear for 5 seconds before the next picture loads. I don't want there to be any user control, basically scrolling 10 pictures one after the other for about 5 seconds each.
I've seen it done with user controls but am not sure how it can be created to scroll aoutomatically.
kudos
Steve

View Replies !    View Related
Dynamically Load JPEGs And/or GIFs?
can i dynamically load JPEGs and/or GIFs into an empty movie clip?

or can i only do it with PNGs and SWF?

I am using 6 and cannot develop on 7, sadly.

View Replies !    View Related
Loading A Series Of Jpegs Dynamically
Ive been asked to make a presentation which can load jpegs dynamically into flash. This is of course relativily easy to do. However, it needs to load a series of Jpegs as part of a slideshow from a folder which will be continously updated with pictures. It also needs to go through the slideshow automatically and not require a user to operate through it.

As a new picture is inserted into the folder it needs to be added to the slideshow dynamically (obviously the pictures will be named like picture001, picture002, picture003 etc etc). Also the tricky part is this needs to be done without me changing the flash script at any time.

IS this possible to do? Is it easy?

View Replies !    View Related
Dynamically Loading Thumbnail JPEGS
ok, so I have a crazy wierd problem.... I am basically loading 28 thumbnails into a flash gallery, which seems to work flawlessy inside of flash, now when I try and load it online, it seems to fall over and I cannot work out why.

Its using full paths, so I dont think its a path issue (on the same server too)

I have 28 place holders, all labelled sub1 to sub28 consecutively.

Im using the following code to load the movies, with the totalIMAGES variable set to 28


while (x<_root.totalIMAGES) {
x++;
loadMovie("http://www.puredirt-x.com/photos/"+_root.gallDir+"/thumbs/"+x+".jpg", "sub"+x);
}
stop();

But it seems almost as though its not waiting for all these items to load in time? any ideas as to whats happening here?

Thanks for any help in advance!!

View Replies !    View Related
Preloader For Dynamically Loading Jpegs?
Hi,

Im using Flash MX (export to player 6)

had a trawl through the board but couldnt' find anything on this. I want to dynamically load in a jpeg at run time (I know, just use loadmovie), but I want the equiv of onLoad, so I can run a little preloader while the jpeg is loading, any ideas how to do this??

thanks for any help
boombanguk

View Replies !    View Related
Dynamically Loading Jpegs For A Set Time
Hi,

A simple problem that I don't seem to be able to work out!

I have 15 images in the library.
I would like to dynamically load each one, one after the other, to the stage for 5 sec each, and when it gets to the fifteenth I'd like it to go back to the first image.

Any ideas?

View Replies !    View Related
Preload Jpegs Of A Dynamically Attached Mc
Hi all. Well onjce again I have been scanning the threads and cant find a direct solution to my problem, or at least I dont know how to implement it if I have :s Anyway what I am doing is this.

I am doing the website for a furnitre company that has a large product catalog, around some 200 photos.

In the main swf. I have all the thumbs and when I click on one thumb depending on what category it is, it will load the external swf. and also a variable that says which photo to show (which frame to go to).

for examplle if I click on a thumb of a bed it will load beds.swf with a photo value of 6, which will go to frame 6 in the beds.swf.

Now in beds.swf I am attaching a movie clip with an instance name of beds dynamically into an mc called photo_holder using the attachMovie function.

The beds movie clip has 40 - 50 keyframes with an mc on each frame which then holds the bitmap. So the target to one photo would be _root.photo_holder.beds_attached.bed1

Then I have a gotoAndStop(photo); action where photo is the variable I loded from level0.

Ok the problem is the following.

I can add a preloader onto a scene before everything, however, I only know how to make the preloader load all the photos. I dont want to do this cause if the user wants to view one photo, they have to wait for all 50 high res photos of beds to load, of course, they wont have to wait for the next bed they click on but its still a pain.

I tried doing some tests last night using the getBytesTotal() function but it only seems to return a value if what I am targetting is in the same frame number where I have that action. Otherwise it returns undefined. Since this clip is loaded dynamically, I have no idea how to preload something that hasnt been called on yet. Or in other words, get the Total Bytes of a photo before showing it, or whatever. Its kinda hard to explain, does anybody have any ideas?

I tried _root.photo_holder.beds.bed1.getBytesTotal(); but it always returns undefined.

Thank you very much

Ted

View Replies !    View Related
Limitations On Dynamically Importing JPEGs?
Does anyone know if Flash has a limitation on dynamically imported jpegs? I find that maybe 30% (maybe more) of the jpegs I have do not import into Flash (using LoadMovie).

I think I read somewhere that you can't import progressive jpegs dynamically. Is that it? Or is there something else?

Cheers,

Mike

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