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




Resize Image Border



what's the best method for resizing a frame to the size of the current image?

I've have square and 35mm format images and I'd like a frame around them to resize depending on their format.

Any hints?



Ultrashock Forums > Flash > Flash Newbie
Posted on: 2005-09-14


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

[MX] Resize Border To Fit Dynamic Image?
I have a background with a border that is behind dynamic images. I am trying to resize the background to custom fit each jpg that is loaded. However, I cannot get the width/height from the movieclip the jpgs are loaded into and I can't get the width/height from the jpgs. Anyone have any advice?

Here is what I tried:

setProperty("_root.serve_contents.photo_button.pho to_background_image.subpages.photo_examples_bg", _height, getProperty("examples/photo/event/amcel_medium.jpg", _height));

and/or

setProperty("_root.serve_contents.photo_button.pho to_background_image.subpages.photo_examples_bg", _height, getProperty("photo_loader", _height));


Thanks,
-Brandon

[MX] Resize Border To Fit Dynamic Image?
I have a background with a border that is behind dynamic images. I am trying to resize the background to custom fit each jpg that is loaded. However, I cannot get the width/height from the movieclip the jpgs are loaded into and I can't get the width/height from the jpgs. Anyone have any advice?

Here is what I tried:

setProperty("_root.serve_contents.photo_button.pho to_background_image.subpages.photo_examples_bg", _height, getProperty("examples/photo/event/amcel_medium.jpg", _height));

and/or

setProperty("_root.serve_contents.photo_button.pho to_background_image.subpages.photo_examples_bg", _height, getProperty("photo_loader", _height));


Thanks,
-Brandon

Resize Border/load Initial Image
I've been following a great tut someone posted here that resizes the border when images are loaded from an xml file.

My question is:
How can I load the first image (foto0.jpg) right away instead of just an empty box?? Anyone?

Thanks

AS2 - Auto - Image Resize/border/shadow
Last edited by adstudio3d : 2008-10-18 at 09:50.
























I'm looking to set up a gallery of images. The images are all different sizes

I need to place all my images in a folder and have them loaded into a container MC

The image container (imageContainer_mc) has 3 layers inside it:
top layer = border
middle layer = actual image container (container_mc)
bottom layer = shadow

When the images are loaded in, I need them to be automatically rescaled to thumbnail size. When clicked, they need to resize to 100% and positioned on center of screen.

To handle the sizing issue, I think i'm going to just start the animation with the imageContainer_mc at 15% and load the images into it. Then use FUZE to tween it to 100%.

What I need to know how to do is dynamically add a border around the image and a shadow behind it which will fit any size image I load into "container_mc"

Resize MC But Not The Border
What I am trying to do is to create a graphic or movieclip, something that I can resize and change the colors of the "fill" section to act as somekind of panel for content. The panel needs to have a border with a decent amount of thickness to it. Here is what I am working on:http://www.redlinestudio.com/ia/who.html
Right now I have to manually adjust each border.

The way I created the element is that I drew the rounded rectangle with border. then seperated and turned each into an MC so that I could use tint to change the color inside. I then grouped them so that way I can reuse the item for each piece in hopes to save file size. I hope that I am making sense. I would also like to be able to do the same method with boxes. Also on the rounded corner one, is there a way that I would be able to scale the item without the rounded corners elongating?

Thanks Much

Tazz

Border Resize With XML
I'm loading images in with xml and want a border to resize to each image. The image loads in, but does not center within the containerMC. The Border resizes, but all the way down the registration point.

Here is the code I am trying to make work:


Code:
// ////// XML Load Functions
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
}
loadImage();
} else {
content = "Error, the image did not load.";
preloader._visible = false;
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("pictures/pictures.xml");
// //////
p = 0;
this.onEnterFrame = function() {
filesize = containerMC.getBytesTotal();
loaded = containerMC.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else if (containerMC._alpha<100) {
preloader._visible = false;
containerMC._alpha += 10;
}
};
// //////
function loadImage() {
if (loaded == filesize) {
containerMC._alpha = 0;
containerMC.loadMovie(image[random(total)], 1);
var w = containerMC._width+spacing, h = containerMC._height+spacing;
border.resizeMe(w, h);
delete _root.onEnterFrame;
}
}
// //////
spacing = 20;
containerMC._alpha = 0;
// //////
MovieClip.prototype.resizeMe = function(w, h) {
var speed = 10;
this.onEnterFrame = function() {
this._width += (w-this._width)/speed;
this._height += (h-this._height)/speed;
if (Math.abs(this._width-w)<1) {
this._width = w;
this._height = h;
_root.containerMC._x = this._x-this._width/2+spacing/2;
_root.containerMC._y = this._y-this._height/2+spacing/2;
_root.containerMC._alpha = 100;
delete this.onEnterFrame;
}
};
};
// //////
stop();
anyone know what I'm missing? thanks.

Resize Border
//------------Resize Border----------//
spacing = 10;
this._parent.containerMC._alpha = 0;
MovieClip.prototype.loadPic = function(pic) {
this._parent.containerMC._alpha = 0;
this._parent.containerMC.loadMovie(pic);
this._parent.onEnterFrame = function() {
var t = containerMC.getBytesTotal(), l = containerMC.getBytesLoaded();
if (t != 0 && Math.round(l/t) == 1) {
var w = containerMC._width+spacing, h = containerMC._height+spacing;
border.resizeMe(w, h);
delete this._parent.onEnterFrame;
}
};
};
MovieClip.prototype.resizeMe = function(w, h) {
var speed = 3;
this.onEnterFrame = function() {
this._width += (w-this._width)/speed;
this._height += (h-this._height)/speed;
if (Math.abs(this._width-w)<1) {
this._width = w;
this._height = h;
this.containerMC._x = this._x-this._width/2+spacing/2;
this.containerMC._y = this._y-this._height/2+spacing/2;
this._parent.containerMC._alpha = 100;
delete this.onEnterFrame;
}
};
};
contentHolder2.content1.but8.onRelease = function() {
containerMC.loadPic("pic1.jpg");
};
contentHolder2.content1.but9.onRelease = function() {
containerMC.loadPic("pic2.jpg");
};

AS Animated Border Resize
This is in relation to my last thread.

If i cant get a border to auto resize to the MC as MC's are load with attachMovie(); , can i get a border to animate a resize to a specific ._height, ._width (also with a var speed = #)?

Am i just totally F'ing this thing up or what. pleeeeaaseeee help me!

Heres and example:


http://www.surfacestudios.com/attachMovieMX.fla

i would make a second frame and have the AS for the border load a different value and a new MC.

Border On Fullscreen Resize
Hi everyone,

how is everybody doing on this beautiful monday (trick question)?
I know its been asked a million times:

http://www.milesaldridge.com/

The border and how it works with the resize. If any one can point me to the thread, thanks a bunch.

enjoy your monday,
M.

Help Tracking A Mask Border During Resize. Fla Inc
Hello all,
I am having a little trouble on a site I am doing. I have a mask that moves and resizes itself according to nav buttons. The problem is that I need the top border line(nav) and the bottom border line to move to the correct spot with the mask. So any help on getting the top and bottom border lines to line up on the top and bottom of the mask after the height and location of the mask changes I would apprecitate it.

a sample fla is included.

Thanks again.

Quickie: Best Way To Dynamically Resize A Border.
I am going to make an image gallery that loads jpg's. Around the jpg is going to be a border that resizes depending on the demensions of the image. I want the border to expand so that it encompasses the image, BUT i dont want the width of the border to change. SO, would this work:

Break the border up into 4 MC's (topbar, bottombar, leftbar, rightbar), and have the topbar and bottombar's width resize according to the jpg loaded, aswell as its _y postion change according to the height of the jpg, and have the side bars height resize according to the height of the jpg and its x position change according to the width of the jpg. If it did it right, could this result in a border that resizes depending on the demension of the dynamically loaded jpg, but the actualy width of the boarder all the way around stays the same? I'm thinking that I'm correct, but just wanted to make sure there wasnt any glaring problems before I procceded. THANKS!

Resize Border/images Function
Hello

I have this

PHP Code:



var ct = null;
var spacing = 10;
loader._visible = false;
function showImg(img) {
    this.onEnterFrame = function() {
        loadImg(img);
        mx.transitions.TransitionManager.start(ct, {type:mx.transitions.Fade, startPoint:empty, numStrips:empty, dimension:empty, direction:0, ccw:empty, duration:2, shape:empty, xSections:empty, ySections:empty, easing:mx.transitions.easing.Regular.easeOut, param1:empty, param2:empty});
    };
}
function loadImg(img) {
    ct = container.createEmptyMovieClip("ct", 0);
    ct._x = 5;
    ct._y = 0;
    container._visible = false;
    ct.loadMovie(img);
    loader.init();
    this.onEnterFrame = function() {
        var cur = ct.getBytesLoaded();
        var max = ct.getBytesTotal();
        if (cur>10 && max>10) {
            var percent = cur*100/max;
            loader.setPerc(percent);
            if (percent>=100 & ct._width>10 && ct._height>10) {
                container._visible = true;
            }
        }
    };





Now I would like to use images with different sizes in the gallery together with a border with some spacing to images(ct-container).
How could this be done if I want to have the images and the border always centered, but with a solid y-position?

Auto Resize Border Script?
Anyone here know where I can find a tutorial or source files for this trick?

an example can be viewed here:
http://www.artluvr.com/files/slick_g...ckgallery.html

Help Tracking A Mask Border During Resize. Fla Inc
Hello all,
I am having a little trouble on a site I am doing. I have a mask that moves and resizes itself according to nav buttons. The problem is that I need the top border line(nav) and the bottom border line to move to the correct spot with the mask. So any help on getting the top and bottom border lines to line up on the top and bottom of the mask after the height and location of the mask changes I would apprecitate it.

a sample fla is included.

Thanks again.

Quickie: Best Way To Dynamically Resize A Border.
I am going to make an image gallery that loads jpg's. Around the jpg is going to be a border that resizes depending on the demensions of the image. I want the border to expand so that it encompasses the image, BUT i dont want the width of the border to change. SO, would this work:

Break the border up into 4 MC's (topbar, bottombar, leftbar, rightbar), and have the topbar and bottombar's width resize according to the jpg loaded, aswell as its _y postion change according to the height of the jpg, and have the side bars height resize according to the height of the jpg and its x position change according to the width of the jpg. If it did it right, could this result in a border that resizes depending on the demension of the dynamically loaded jpg, but the actualy width of the boarder all the way around stays the same? I'm thinking that I'm correct, but just wanted to make sure there wasnt any glaring problems before I procceded. THANKS!

Resize Border Photo Gallery
im using a resizing border for my photo gallery. ive got it finished and it works in dreamweaver and flash but when i uploaded the html file to my site it doesn't exactly work right. if you click on a picture it loads the pic outside of the border but if you click the same pic again it works like its suppose to. do i need to load the pics when the page loads or somethin? heres the link www.atlifesend.com/alepics.html
btw, i have it open in a smaller window from the site.

im sorry, ive found the answer in another thread. thanks again scotty!!

Resize Border Photogallery Not Working
Hi guys i am still a beginner with flash and i am trying to create a photo gallery with a resize frame that resize everytime it loads a jpeg.
The problem that i have is that when you first load this gallery the pics don't load correctly(the pics are off position and the frame doesn't resize) but as soon as you clic more everything works.
I don't have a clue why??
Please help
Thanks
Massimo
http://www.gammacurta.com/TONY_SITE/load_pic.html

Auto-resize Border With AttachMovie();
Ive been up for two nights in a row, trying to figure out how i can use this script with attachMovie(); . Im trying to create a border that auto resizes when MCs (basically just an image imported into an mc) load. This will be expoted as a projetor then burned onto a CD. I just need them to load from the library.

Any help would be greatly appreciated. Heres what i have so far:
space = 10;
photo_mc._alpha = 0;
MovieClip.prototype.loadPhoto = function(photo) {
this.attachMovie(photo);
_level0.photo_mc._alpha = 0;
_level0.onEnterFrame = function() {
var total = photo_mc.getBytesTotal(), loaded = photo_mc.getBytesLoaded();
if (total != 0 && total == loaded) {
var w = photo_mc._width+space;
var h = photo_mc._height+space;
border.resize(w, h);
delete _root.onEnterFrame;
}
};
};
MovieClip.prototype.resize = function(w, h) {
var speed = 4;
this.onEnterFrame = function() {
this._width += (w-this._width)/speed;
this._height += (h-this._height)/speed;
if (Math.abs(this._width-w)<1) {
this._width = w;
this._height = h;
_root.photo_mc._x = this._x-this._width/2+space/2;
_root.photo_mc._y = this._y-this._height/2+space/2;
_root.photo_mc._alpha = 100;
delete this.onEnterFrame;
}
};
};
photo_mc.onEnterFrame = function() {
photo_mc.attachMovie("image1",1,1);
};
stop();
nextButton.onRelease = function() {
gotoAndStop(3);
};
previousButton.onRelease = function() {
gotoAndStop(35);
};

Quickie: Best Way To Dynamically Resize A Border.
I am going to make an image gallery that loads jpg's. Around the jpg is going to be a border that resizes depending on the demensions of the image. I want the border to expand so that it encompasses the image, BUT i dont want the width of the border to change. SO, would this work:

Break the border up into 4 MC's (topbar, bottombar, leftbar, rightbar), and have the topbar and bottombar's width resize according to the jpg loaded, aswell as its _y postion change according to the height of the jpg, and have the side bars height resize according to the height of the jpg and its x position change according to the width of the jpg. If it did it right, could this result in a border that resizes depending on the demension of the dynamically loaded jpg, but the actualy width of the boarder all the way around stays the same? I'm thinking that I'm correct, but just wanted to make sure there wasnt any glaring problems before I procceded. THANKS!

Resize Border Photo Gallery
im using a resizing border for my photo gallery. ive got it finished and it works in dreamweaver and flash but when i uploaded the html file to my site it doesn't exactly work right. if you click on a picture it loads the pic outside of the border but if you click the same pic again it works like its suppose to. do i need to load the pics when the page loads or somethin? heres the link www.atlifesend.com/alepics.html
btw, i have it open in a smaller window from the site.

im sorry, ive found the answer in another thread. thanks again scotty!!

Help Tracking A Mask Border During Resize. Fla Inc
Hello all,
I am having a little trouble on a site I am doing. I have a mask that moves and resizes itself according to nav buttons. The problem is that I need the top border line(nav) and the bottom border line to move to the correct spot with the mask. So any help on getting the top and bottom border lines to line up on the top and bottom of the mask after the height and location of the mask changes I would apprecitate it.

a sample fla is included.

http://www.parlettdesigns.com/help.fla

Thanks again.

Motion Tween - Resize Without Increase Border
Hi,
Ok, feeling weird about asking this but I just can't find it...

Scenario:
The purpose of my flash movie is to grow the border of a circle made in Flash (circle only has border and no fill).

Without creating a motion tween, I can resize the border of the cricle from 10px to 200px without it affection the border thickness. THIS IS GOOD

Now, as soon as I create a motion tween, flash seems to transform that into an image and when I resize the circle, the border thickness also increases.
Kind of like going from: O to O
You see the border thickness increases with the size. THIS IS BAD

Question:
Is it possible to use motion tween to create a the GOOD effect by having a circle grow in size without it affecting it's border thickness?

Addtl info: Basically, I want to use many empty circles to create an emanation effect.

Thank you for any help.
UTN

Gallery Resize Border Loading Swf Problem
Hello Friends,

Currently I am using the gallery that has been posted on a link on Kirupa.com where it uses XML and loads in my case .swfs into a border that resizes according to the size of what is loaded.

The reason I am using .swfs is because I plan to somehow make it so that the artwork being loaded can be zoomed in on once they are loaded, how I am not sure quite yet.

Anyway, I was wondering if anyone could please tell me why that sometimes the .swfs load once or twice and then when clicking on other artwork thumbnails they do not load at all. THis just happens for the swfs and not when I would use the jpegs instead of swfs. The swfs just do not seem to be loading as planned, sometimes one or two load sometimes none. Was wondering if someone knew why this is happening and could please give me some help if possible, maybe pertaining to actionscript?

Please click here to preview what I am speaking of

(please right click on files and click save as or save file as:
Click here to download the files

I greatly appreciate anyones help on this, sincerely.

Next/prev Buttons Of Border Resize Gallery
I found an auto border resize gallery which is just perfect because it does not use XML. It is easier and faster load. However I would like to developpe this gallery with a "next" and "previous" buttons, navigating not only by thumbnails.
I found a script (see below in RED) in a similar resize gallery which uses xml , it should be changed to work without xml.
Pls check it and let me know if you have an idea how the right script should be.
Demo : http://www.mozaikart.org/essai/essai1.htm

THE WHOLE SCRIPT :
----------------
stop();
space = 25;
photo_mc._alpha = 100;
var photo = new Array();

MovieClip.prototype.loadPhoto = function(photo){
photo_mc._alpha = 0;
this.loadMovie(photo);
_level0.onEnterFrame = function(){
// modified the total and loaded so as to round it up to smaller number.
var total = Math.round photo_mc.getBytesTotal)/ 1024);
var loaded = Math.round(photo_mc.getBytesLoaded()/1024);
if (total != 0 && loaded>=total){
var w = photo_mc._width + space;
var h = photo_mc._height + space;
border.resize(w, h);
delete this.onEnterFrame;
picinfo.info.text = photo;
delete this.onEnterFrame;
}
}
};

MovieClip.prototype.resize = function(w, h){
//the higher the slower the resize of the border
var speed = 4;
this.onEnterFrame = function(){
this._width += (w - this._width)/speed;
this._height += (h - this._height)/speed;
nav._x = Math.round(this._x-this._width/2);
nav._y = Math.round(this._y+this._height/2+spacing/2);
prevb._x = nav._x-5;
nextb._x = nav._x+this._width+5;
nextb._y = prevb._y=this._y-this._height/2;
picinfo._y = nextb._y-5;
picinfo._x = border._x-picinfo._width/2;
if( Math.abs(this._width-w)<1 && Math.abs(this._height-h)<1){
this._width = w;
this._height = h;
photo_mc._x = this._x - this._width/2 + space/2;
photo_mc._y = this._y - this._height/2 + space/2;
photo_mc._alpha = 100;
delete this.onEnterFrame;
}
}
};

gallery_xml.load("gallery.xml");
prevb.onRelease = function() {
cur--;
if (cur<0) {
containerMC.loadPic(pArray.length-1);
} else {
containerMC.loadPic(cur);
}
};
nextb.onRelease = function() {
cur++;
if (cur > pArray.length-1) {
containerMC.loadPic(0);
} else {
containerMC.loadPic(cur);
}
};

pic1.onPress = function() {
photo_mc.loadPhoto("p1.swf");
};
pic2.onPress = function() {
photo_mc.loadPhoto("p2.swf");
};
pic3.onPress = function() {
photo_mc.loadPhoto("p3.swf");
};
pic4.onPress = function() {
photo_mc.loadPhoto("p4.swf");
};
pic5.onPress = function() {
photo_mc.loadPhoto("p5.swf");
};
pic6.onPress = function() {
photo_mc.loadPhoto("p6.swf");
};
pic7.onPress = function() {
photo_mc.loadPhoto("p7.swf");
};
pic8.onPress = function() {
photo_mc.loadPhoto("p8.swf");
};
pic9.onPress = function() {
photo_mc.loadPhoto("p9.swf");
};

/////////////////////////////////////
//Modified by Sokhodom Pheng //
////////////////////////////////////
//define the initiation function

function init(photo) {
photo_mc.loadPhoto(photo);
}

// call the initiation function
//change the image name accordingly

init("p1.swf");

Auto Border Resize Photo Gallery
Hi everyone, i have this project where im doing a photo galery via xml, it works great, however i want to shape it a little bit more.

I want to do, that the mc container of the photos, resizes every time that loads each picture.

Each picture has diferent sizes

Can someone give me some guide lines to acomplish what i want

Greetings

thanks

Resize Bg On Browser Resize While Maintaining Image Proporti
im using the following code to resize background images on browser resize:

Code:

var listener:Object = new Object()

bg_mc.width = Stage.width;
bg_mc.height = Stage.height;

listener.onResize = function(){

bg_mc.width = Stage.width;
bg_mc.height = Stage.height;

}
Stage.addListener(listener);


the problem i'm having is that my background image does not maintain proportion on resize. so, when i resize my browser to a width of 100px, the entire width of my background image is compressed into the 100px area.

is there some additional code i can add to the snippet above to maintain the proportions of my background image on resize?

thanks,
brandon

Image Border
Does anyone out there know what the code is for setting the color of image borders in Dreamweaver MX?

No Border On First Image...
I load my images using XML and tween them + putting a border with this script (not including the xml loading code, dont know if I need to change this?) Everything works fine with doing the same thing with all images. What I want to try to accomplish is putting no border on the first image? Anyone who can give me a hint on try to do this?


Code:
MovieClip.prototype.loadPic = function(pic) {
this.loadMovie(pArray[pic]);
this._parent.onEnterFrame = function() {
var t = containerMC.getBytesTotal(), l = containerMC.getBytesLoaded();
bar._visible = true;
per = Math.round((l/t)*100);
if (t == l && containerMC._width>0 && containerMC._height>0) {
var w = containerMC._width, h = containerMC._height;
border.alphaTo(100, speed_fadeIn, tweentype_fadeIn, speed_fadeIn);
resizeMe(w, h);
bar._visible = false;
picInfo.text = tArray[pic];
delete this.onEnterFrame;
} else {
//bar._width = w;
bar.preInfo.text = per;
}
}
}

function resizeMe(w, h) {
//border tween:
border.tween(["_width", "_height"], [w+2, h+2], speed_resize, tweentype_resize);
//pic and picinfo fade in:
containerMC.alphaTo(100, speed_fadeIn, tweentype_fadeIn, speed_resize);
picInfo.alphaTo(100, speed_fadeIn, tweentype_fadeIn, speed_fadeIn);
//pic position:
containerMC._x = border._x+1;
containerMC._y = border._y+1;
}

Image Gets Unwanted Border
Hi -

I've got a .jpg that I'm using in a movie that I used to create a movie clip. When I run the movie the image gets an extra pixel of black around the top, left, and right edges.

Does this make sense? It's not there at design time, only when I test the thing out. Looks lame - any ideas on what to do?

Thanks!!

Dynamic Image Border
i ahve created a swf that will load a random image intoa webpage. i want to but a border around it,but the dimentions are random, any ideas?

all pictures are quadrilateral

Border Around Dynamic Image [MX]
Hey all,

My question didn't seem to get any replies last time so I am saying please with a cherry on top this time.

My question is related to putting a border around an image. I am dynamically loading images from an xml file and they appear as thumbnails. I want to put a 1 or 2 pixel black border around the image when I load it. The problem that I see is that some of the images are portrait and others, landscape. I hope there is a way to do this in AS? I have searched the forum but nothing.

Cheers

Another Dynamic Image Border
I have a dynamic border with a loader and buttons and whatnot. It works for the most part, but when the images have not loaded on the persons machine before, there is an occasional glitch preventing it from displaying properly(the border shrinks to nothing, the loading bar goes to aobut 10px, etc.)

Here is the gallery thing (only 1 - 11 are uploaded)
http://www.domainkarl.com/gallery1/index.html

Here is the FLA -->
http://www.domainkarl.com/gallery1/resizeborder.fla

I assume it's some kind of issue with loading, as in resizing before loading properly or something...but to me the code looks fine. The big problem with this error is it's extremely hard to troubleshoot as i have to upload the SWF, and clear my cache everytime. :- I WOULD LOVE SOME HELP! :-o

Loadmovie() And Image Border
Hi can anyone tell me how to place a border around the images I load with loadmovie() - I'm publishing to Flash 5

thanks

Tweening Image Border
Hello,

I am trying to make one of those Resizing borders for an image gallery ...

Is there an Actionscript 2.0 function that whilst Loading in an external jpeg, Flash can be told the dimensions of the picture it is currently loading > before it has loaded it fully. .. ?

Thus, preparing the size of the border, whilst the image is loading.

Or, does it have to initiate that once the jpeg has loaded 100% ...


A lot of words for one question ...

Thanks if there is some help out there

Image Border Tween
Hello,

I am trying to make one of those Resizing borders for an image gallery ...

Is there an Actionscript 2.0 function that whilst Loading in an external jpeg, Flash can be told the dimensions of the picture it is currently loading > before it has loaded it fully. .. ?
ie: getWidth (as a guess) ...

Thus, preparing the size of the border, whilst the image is loading.

Or, does it have to initiate that once the jpeg has loaded 100% ...

Thanks if there is some help out there

Border Around Dynamic Image [MX]
Hey all,

My question didn't seem to get any replies last time so I am saying please with a cherry on top this time.

My question is related to putting a border around an image. I am dynamically loading images from an xml file and they appear as thumbnails. I want to put a 1 or 2 pixel black border around the image when I load it. The problem that I see is that some of the images are portrait and others, landscape. I hope there is a way to do this in AS? I have searched the forum but nothing.

Cheers

Another Dynamic Image Border
I have a dynamic border with a loader and buttons and whatnot. It works for the most part, but when the images have not loaded on the persons machine before, there is an occasional glitch preventing it from displaying properly(the border shrinks to nothing, the loading bar goes to aobut 10px, etc.)

Here is the gallery thing (only 1 - 11 are uploaded)
http://www.domainkarl.com/gallery1/index.html

Here is the FLA -->
http://www.domainkarl.com/gallery1/resizeborder.fla

I assume it's some kind of issue with loading, as in resizing before loading properly or something...but to me the code looks fine. The big problem with this error is it's extremely hard to troubleshoot as i have to upload the SWF, and clear my cache everytime. :- I WOULD LOVE SOME HELP! :-o

Help Jpg Image Border's Cutting Off
Hey All,
I have Jpg images that have borders; I can see them in Adobe and through IE. However, when flash loads them it cuts off the right border or the left border, etc. I don't understand why? I've searched and played around and can't figure it out.

The images have a black border surrounding them, top, bottom, left, right.

Please help? I'm stumped.

Thanks,
Anthony

Image Border Displacement
I have made a couple of images in PS with a 2px white border around it, they are being used in flash intro.

The things is that after i import them in flash and use them in the movie, the 2px border seems to be a bit thinner on the right side then the left side. On some pictures it even looks like the border is completely gone.

I try'd giving them coordinates that ended on a .0 instead of .4 or so. That didn't have any result on the borders, they still looked messed up on one side.

Is there a way to fix this, or is it just a bad idea to use images that a border around them in Flash?

Help: Mouseovers - Image Outside Of Border?
Hi there,

I am having a problem I cannot solve on my own...

I am doing mouse overs for a site navagation in Flash mx.

My problem is that I have a button, about 100 X 20px large, and, on mouse over, I would like a larger image to appear which is about 200 X 40, more or less, my problem is that, when I try this, on mouse over of the original button, nothing appears, but should my mouse go over the area I happen to know the larger image should appear, it appears... that is, the larger image appears to be the mouseover area, and not the original smaller image...

I am asuming it has something to do with the larger image being simply, larger, than the smaller ...

I cannot for the life of me, find a solution, so, any suggestions or help would be greatly appreciated.

- Murray

Dynamic Image + Border + Shadow
I am building a gallery of images.

I would like to load each image into its container by using the containers <instance name> (not sure how to write this : ("images/"+instanceName+".jpg");

Then add a 5px border and drop shadow to each gallery item dynamically based on the image size (They are all different sizes).

I've been searching and playing around but could not get exactly what i'm looking for...

Here is the code I'm working with now which kind of works
not loading in the way i want however

Actionscript on imageContainer1

ActionScript Code:
onClipEvent (load) {
    this.attachMovie("photo", "photo1", 5);
    this.attachMovie("shadow", "shadow1", 4);
    shadowAmount = 5;
    borderAmount = 3;
    this.shadow1._width = this.photo1._width+shadowAmount;
    this.shadow1._height = this.photo1._height+shadowAmount;
    this.shadow1._x = shadowAmount;
    this.shadow1._y = shadowAmount;
    this.border1._width = this.photo1._width+borderAmount;
    this.border1._height = this.photo1._height+borderAmount;
}

I need to somehow replace this

ActionScript Code:
this.attachMovie("photo", "photo1", 5);

so that it will load an external image using something like this

ActionScript Code:
container.loadMovie("images/"+imageName+".jpg");

But the problem is, when I just replace it with loadMovie,
the shadow is no longer added.

Also, if I add this

ActionScript Code:
imageName = "name of file to load";

In the onEnterFrame or on the actual frame, it is not being recognized and is trying to load "/images/.jpeg" instead of "images/test1.jpg"

Please, any help would be greatly appreciated. Thanks

URGENT Dynamic Image Border HELP
Hey all,

I really want to figure this out it has been torchering me all night! Anyway, the problem is that I have a specific area that images load into dynamically. The area has a border and the images load within the border when you rollover small thumbs at the bottom of the page. It looks a little unprofessional because the images don't cover the space due to their various formats (aka horizontal and vertical).
What I am trying to do is make the border resize to the images when they load. I tried numerous things but nothing seemed to work. If anyone knows what to do or if your confused, I'll be checkin in.

Thanks in advance

Load Image With Border OnLoad
I appologise for posting this again but I got no responses,

So, I am going to call this swf file to show a random image in a panel. I want the border to be around the picture when it loads. Here is the code, Cheers




Code:
portfolioInfo = new XML();

portfolioInfo.ignoreWhite = true;
timeline = this;
// Function when xml is done loading:
portfolioInfo.onLoad = function(){

portfolioTag = this.firstChild;

trace(count = portfolioTag.childNodes.length);
// Generate a random number based on the lenght of nodes in the XML file
num = Math.floor(Math.random()*count);

spacing = 1;
image_mc._alpha = 0;

// LOAD IN FIRST PICTURE IN XML FILE, first occurance of IMAGE NODE
image_mc.loadMovie(portfolioTag.childNodes[num].attributes.IMAGE);

_root.onEnterFrame = function(){
var t = image_mc.getBytesTotal(), l = image_mc.getBytesLoaded();
if (t != 0 && Math.round(l/t) == 1){
var w = image_mc._width + spacing, h = image_mc._height + spacing;
border.resizeMe(w, h);
delete _root.onEnterFrame;
}
}

}

MovieClip.prototype.resizeMe = function(w, h) {
var speed = 3;
this.onEnterFrame = function() {
this._width += (w-this._width)/speed;
this._height += (h-this._height)/speed;
if (Math.abs(this._width-w)<1) {
this._width = w;
this._height = h;
image_mc._x = this._x-this._width/2+spacing/2;
image_mc._y = this._y-this._height/2+spacing/2;
image_mc._alpha += 15;
if (image_mc._alpha>=100) {
// _root.containerMC._alpha = 100;
delete this.onEnterFrame;
}
}
};

};


portfolioInfo.load("random.xml");
The fla and more info can be found here, fla

Load .png & Mask Border On Top Of The Image
Hi there.

I've tried to use the tutorial as below:
http://www.kirupa.com/developer/mx/loading.htm

i was in a success to load the image dynamically with flash 8 as i am using a flash 8.

but i have trouble in knowing how to make a border on top of the image (i mean, the border would be on another layer, the image is on another layer)

how do i do this?

thank you.

URGENT Dynamic Image Border HELP
Hey all,

I really want to figure this out it has been torchering me all night! Anyway, the problem is that I have a specific area that images load into dynamically. The area has a border and the images load within the border when you rollover small thumbs at the bottom of the page. It looks a little unprofessional because the images don't cover the space due to their various formats (aka horizontal and vertical).
What I am trying to do is make the border resize to the images when they load. I tried numerous things but nothing seemed to work. If anyone knows what to do or if your confused, I'll be checkin in.

Thanks in advance

Load Image With Border OnLoad
I appologise for posting this again but I got no responses,

So, I am going to call this swf file to show a random image in a panel. I want the border to be around the picture when it loads. Here is the code, Cheers




Code:
portfolioInfo = new XML();

portfolioInfo.ignoreWhite = true;
timeline = this;
// Function when xml is done loading:
portfolioInfo.onLoad = function(){

portfolioTag = this.firstChild;

trace(count = portfolioTag.childNodes.length);
// Generate a random number based on the lenght of nodes in the XML file
num = Math.floor(Math.random()*count);

spacing = 1;
image_mc._alpha = 0;

// LOAD IN FIRST PICTURE IN XML FILE, first occurance of IMAGE NODE
image_mc.loadMovie(portfolioTag.childNodes[num].attributes.IMAGE);

_root.onEnterFrame = function(){
var t = image_mc.getBytesTotal(), l = image_mc.getBytesLoaded();
if (t != 0 && Math.round(l/t) == 1){
var w = image_mc._width + spacing, h = image_mc._height + spacing;
border.resizeMe(w, h);
delete _root.onEnterFrame;
}
}

}

MovieClip.prototype.resizeMe = function(w, h) {
var speed = 3;
this.onEnterFrame = function() {
this._width += (w-this._width)/speed;
this._height += (h-this._height)/speed;
if (Math.abs(this._width-w)<1) {
this._width = w;
this._height = h;
image_mc._x = this._x-this._width/2+spacing/2;
image_mc._y = this._y-this._height/2+spacing/2;
image_mc._alpha += 15;
if (image_mc._alpha>=100) {
// _root.containerMC._alpha = 100;
delete this.onEnterFrame;
}
}
};

};


portfolioInfo.load("random.xml");
The fla and more info can be found here, fla

Rounded Button/Image Border
Ok,

I'm pretty new to flash... Actually, I haven't touched it since Flash 2 and it was a really light touch at that.

What I'm trying to do is create images in Photoshop and import them as images into Flash. I was told that saving them as .png files would allow them to keep the transparency in flash. They did, but now the problem that I'm having is that there's always a pixelated white-ish border around what I want to be a smooth edge.

Help??!!

Please??!!

Graahh!!!

-----------------------------------------------
www.liquidfuzion.com
"The night sky over the planet Krikkit is the least interesting sight in the entire universe."
-Hitch Hiker's Guide To The Galaxy

1 Pixel Border Around Image Lost On Import
Hi

Can anyone help with this one. Should be easy.

I am importing a jpg with a one pixel border. When I import it into Flash Mx however the right and bottom side border is lost.

Any one else found this? Is it a bug?

Thanks in advance

Image Moving Around - Detecting Border Of SWF And Bouncing
Hi there, I am a bit of a newbie here and I've got a very silly problem. I've got an image moving around my SWF depending on what side of the .swf file the mouse cursor is.

Here it is: http://supr.is-a-geek.org/psd/flash.html

The problem is prolly very obvious: the image disappears when it should detect the border of SWF and bounce back.

here is the script for moving aorund:
code:
onClipEvent (load) {
x = 0;
}
onClipEvent (enterFrame) {
this._x += x;
if ((_root._xmouse>0) && (_root._xmouse<50)) {
if (x>-3) {
x -= 0.15;
}h
}
if ((_root._xmouse>715) && (_root._xmouse<765)) {
if (x<3) {
x += 0.15;
}
}
}


Any help would be much appreciated. Thanks!

Copyright © 2005-08 www.BigResource.com, All rights reserved