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
KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 07-01-2004, 05:21 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
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
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
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
[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
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
[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
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!!
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
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
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?
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.
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!
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"
Border Around Flash Image In Table, Not Supposed To Be There
On this page:
http://www.techartisans.net/speedMi....php?flash=true
you will find a table which includes one flash image. For some reason the flash image appears a pixel or two smaller than the table cell it is in, and so there is a dark blue border around it (it was a white border until I set the background color of the flash to dark blue). The cell is 326 pixels in height, and colspan=2 so it never actually says it is 360 wide, but it is. The flash image is also 360w x 326h.
Any ideas why this might be happening? I played around with adjusting the size of the flash but it didn't change much, just made the border slightly skinnier.
Thanks, Emily
Border Around Flash Image In Html Table, Shouldn't Be There
On this page:
http://www.techartisans.net/speedMin...php?flash=true
you will find a table which includes one flash image. For some reason the flash image appears a pixel or two smaller than the table cell it is in, and so there is a dark blue border around it (it was a white border until I set the background color of the flash to dark blue). The cell is 326 pixels in height, and colspan=2 so it never actually says it is 360 wide, but it is. The flash image is also 360w x 326h.
I played around with adjusting the size of the flash but it didn't change much, just made the border slightly skinnier or fatter. I also took a good look at the widths and heights of the table cells, and they are all correct.
One strange thing was when I took out the spacer row that Flash creates when it publishes the html. The whole thing went out of wack, nothing matched up, even tho the widths and heights are correct. It's all just weird.
Any ideas why this might be happening, and how to fix it?
Thanks, Emily
Putting Border And Dropshadow For A Dynamically Loaded Image
hi
how to add a linestyle and a dropshadow to a dynamically loaded image.
this is the code that loads them and sets the x and y positions. i need to give these images a border and a dropshadow effect
Code:
for (i=1; i<=num_img; i++) {
_root.imgClip0.duplicateMovieClip("img_"+i, _root.getNextHighestDepth());
eval("_root.img_"+i)._x = sc_width;
eval("_root.img_"+i)._y = sc_height;
}
can anyone help me?
Thanks
Preload Opening Image (Problem Center/border)
Been a while,
I have some thumbnails, when clicked on, the larger image loads which fades in and is centered. My problem lies with the first image which I want to automatically load when the swf is called. At the moment, it loads the image from the top left corner of the MovieClip, it fades it but no border and I can't get it to center. I want to call the function which fades in and centers the opening image onLoad. I have attached the fla which has been edited so it only includes the problem. I hope someone can help using the same or a similar function to mine as it will be applied to each thumbnail.
This appears at the top of my AS code:
Code:
onLoad = function() {
//onload, load the first image into the MC
ImageContainer._alpha = 0;
ImageContainer.loadMovie("images/image0.jpg");
//This function centers, borders and fades the image in
preload();
}
This is the preload function(s), please remember this same function works fine when a thumbnail is clicked on it!
Code:
function preload() {
this.onEnterFrame = function() {
var l = ImageContainer.getBytesLoaded();
var t = ImageContainer.getBytesTotal();
var percent = Math.round((l/t)*100);
percent -= (percent-((l/t)*100))*.25;
per = int(percent);
if (l<t){
percentage = per+" percent";
bytes = "loading ("+l+"/"+t+")";
}
if (t>0 && l>=t) {
percentage = "";
bytes = "";
ImageContainer._x -= ImageContainer._width/2;
ImageContainer._y -= ImageContainer._height/2;
ImageContainer.createEmptyMovieClip("border",7453);
ImageContainer.border.lineStyle(0,0x000000,100);
ImageContainer.border.lineTo(ImageContainer._width,0);
ImageContainer.border.lineTo(ImageContainer._width,ImageContainer._height);
ImageContainer.border.lineTo(0,ImageContainer._height);
ImageContainer.border.lineTo(0,0);
ImageContainer.bordered = true;
//calls fadeIn program
this.onEnterFrame = FadeImage;
}
}
};
function FadeImage() {
if (ImageContainer._alpha<100) {
trace("fade");
//changing digit will change speed
ImageContainer._alpha += 10;
} else {
this.onEnterFrame = null;
}
};
Thanks!
Adding Fancy Border To Scotty's Image Gallery
I'm encountering a weird glitch when I try to use a more complex image border: the image container and the text caption both jump into place at the last moment. A bad effect. All I've done is add two more variables, "w2" and "w3" to the code:
Code:
var w = container._width+spacing, h = container._height+spacing;
var w2 = container._width+space2, h2 = container._height+space2;
var w3 = container._width+space3, h3 = container._height+space3;
border.resizeMe(w, h, id);
border2.resizeMe(w2, h2, id);
border3.resizeMe(w3, h3, id);
The effect can be see here:
http://www.tornedgedesign.com/_test/...i_borders.html
The only way I can find to keep the border shapes in correct proportion is to create 3 different border clips and apply the "resizeMe" easing function to each of them.
Files are here - thanks for any help:
http://www.tornedgedesign.com/_test/...ti_borders.zip
Preload Opening Image (Problem Center/border)
Been a while,
I have some thumbnails, when clicked on, the larger image loads which fades in and is centered. My problem lies with the first image which I want to automatically load when the swf is called. At the moment, it loads the image from the top left corner of the MovieClip, it fades it but no border and I can't get it to center. I want to call the function which fades in and centers the opening image onLoad. I have attached the fla which has been edited so it only includes the problem. I hope someone can help using the same or a similar function to mine as it will be applied to each thumbnail.
This appears at the top of my AS code:
Code:
onLoad = function() {
//onload, load the first image into the MC
ImageContainer._alpha = 0;
ImageContainer.loadMovie("images/image0.jpg");
//This function centers, borders and fades the image in
preload();
}
This is the preload function(s), please remember this same function works fine when a thumbnail is clicked on it!
Code:
function preload() {
this.onEnterFrame = function() {
var l = ImageContainer.getBytesLoaded();
var t = ImageContainer.getBytesTotal();
var percent = Math.round((l/t)*100);
percent -= (percent-((l/t)*100))*.25;
per = int(percent);
if (l<t){
percentage = per+" percent";
bytes = "loading ("+l+"/"+t+")";
}
if (t>0 && l>=t) {
percentage = "";
bytes = "";
ImageContainer._x -= ImageContainer._width/2;
ImageContainer._y -= ImageContainer._height/2;
ImageContainer.createEmptyMovieClip("border",7453);
ImageContainer.border.lineStyle(0,0x000000,100);
ImageContainer.border.lineTo(ImageContainer._width,0);
ImageContainer.border.lineTo(ImageContainer._width,ImageContainer._height);
ImageContainer.border.lineTo(0,ImageContainer._height);
ImageContainer.border.lineTo(0,0);
ImageContainer.bordered = true;
//calls fadeIn program
this.onEnterFrame = FadeImage;
}
}
};
function FadeImage() {
if (ImageContainer._alpha<100) {
trace("fade");
//changing digit will change speed
ImageContainer._alpha += 10;
} else {
this.onEnterFrame = null;
}
};
Thanks!
AS2 - MovieClip Drawing Methods - Adding 'border' To Image
Hello.
I am producing a standalone app which loads images from a local directory using MovieClipLoader - no problems there. I am setting the width and height (onLoadInit 200x133) so that if someone were to drop in an oversized image into the directory it wouldn't ruin the look. Finally I am adding a 'border' using the drawing methods. The border works fine if the image is exactly the right size (200x133) but if the original image is bigger then when reduced in size in the mc the border seems to scale in proportion to the original image??? There is probably a simple explanation for this...any advice? I know it will be easier to set the orignal image to the right size (which I probably will do) but I am curious how to do it the other way.
Code:
var nWidth = 134;
var nHeight = 201;
var imgLoad = new MovieClipLoader();
imgLoad.loadClip("commander.jpg", img_commander);
imgLoad.onLoadInit = function (img_commander){
img_commander._width = 133;
img_commander._height = 200;
with (img_commander) {
beginFill(0xFFFFFF, 100);
moveTo(-1, -1);
lineTo(nWidth, -1);
lineTo(nWidth, nHeight);
lineTo(-1, nHeight);
lineTo(-1, -1);
endFill();
}
}
Please don't laff at my code!
Dynamically Loaded Image ..border And Center Of Movie Clip
Hi all,
I am working on a image gallery where i am loading the images from xml. Now my problem is On click of the thumbnails a larger image should load...I like to give a outline to the image based on the orientation horizontal and vertical and should fit to the image loaded.
I am using the following script to load images.
/*Scrip starts here*/
import flash.filters.DropShadowFilter;
var dropShadow:DropShadowFilter = new DropShadowFilter(3, 45, 0x000000, 0.4, 7, 7, 2, 3);
big1.frm.filters = [dropShadow];
big1._visible = 0;
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
th = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
th = xmlNode.childNodes.childNodes[0].firstChild.nodeValue;
}
loadmc(); // will assign the th to the movie clip name th_loader//
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
Any help will be appreciated.
Thanks & Regards,
kakas
Border Around Dynamic Text Box
Is there a way to change the size of a border around a dynamically created text box, the only actionscript I can find is textbox.border=true or false, which draws a border width 1, as far as I can see. Is there any way of making the border bigger width?
Thanks
Draw Dynamic Border?
Hey all...
I've got a bunch of thumbnails being dynamically loaded into flash that have a mask applied. I just wondered if there was a way of tracing either the mask or the actual thumbnail using actionscript to draw a border? thanks!
Dynamic Text Box Border
I am just starting to learn Flash and found script to add a date to a dynamic text box. This worked fine but there is a black border around the box that I can't remove. I tried removing the Stroke color but that doesn't do anything to the box. I also changed the font to be Arial, bold, italic and it's just Arial. It didn't make any of my changes. How do I remove the border and get the dynamic text box properties to work correctly?
Thanks for the help.
Dynamic Border And Glow
Hey,
Just a quick question. Is there a way to set the border of a box to be set in actionscript, as well as set a glow property.
I am going to be resizing the box using actionscript so if I have it as an image or in the mc it will be resized and that would be no good.
Cheers,
Jeff
XML Gallery Dynamic Border?
Just thought I'd see if this is possible with the XML Photo Gallery.
1. Is it possible to create a dynamic border for the loaded image depending on the size of the image being loaded?
2. Is it possible to move the Y position of the caption text box depending on the height of the loaded image? ie if the image is 200 pixels high, then the text box should be positioned at 220 pixels.
The current code I have which loads the images then automatically scrolls through them is:
Code:
delay = 6000;
// -----------------------
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
link = [];
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;
link[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("pid1.xml");
p = 0;
function preload(clip) {
picture.loadMovie(clip);
preloader._visible = true;
var temp = this.createEmptyMovieClip("temp", 9987);
temp.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader.preload_bar._xscale = 100*loaded/filesize;
if (filesize>4 && filesize == loaded) {
preloader._visible = false;
picture._alpha += 10;
if (picture._alpha>100) {
picture._alpha = 100;
slideshow();
delete this.onEnterFrame;
}
}
picture.onRelease = function() {
getURL(link[p], "_blank");
};
};
}
function nextImage() {
if (p<(total-1)) {
p++;
fadeOut(image[p]);
desc_txt.text = description[p];
picture_num();
}
}
function firstImage() {
picture._alpha = 0;
fadeOut(image[0]);
desc_txt.text = description[0];
picture_num();
}
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}
function slideshow() {
myInterval = setInterval(pause_slideshow, delay);
function pause_slideshow() {
clearInterval(myInterval);
if (p == (total-1)) {
p = 0;
firstImage();
} else {
nextImage();
}
}
}
function fadeOut(clip) {
picture.onEnterFrame = function() {
this._alpha -= 20;
if (this._alpha<0) {
preload(clip);
delete this.onEnterFrame;
}
};
}
Any help greatly appreciated.
Dynamic Border/stroke With AS
I have read like a bajillion places people wanting to do the same thing, but you can not with just graphics and symbols. Every keeps saying to do it with AS, but then no one tells you how, so I am asking. How do I create a shape, any shape and then apply a border/stroke to it that has a fixed width, and then i can scale that shape say like a square, into a rectangle and make it huge.
And please don't tell me to use hairline, I want a think fat border.
Basically I want to be able to do in flash what this guy has in html.
www.omegapage.com. I want those boxes!!!!!!!
Thanks for your help.
Tazz
HELP - Dynamic 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 "http://www.ultrashock.com/forums/images/.jpeg" instead of "inages/test1.jpg"
Please, any help would be greatly appreciated. Thanks
Dynamic Border And Glow
Hey,
Just a quick question. Is there a way to set the border of a box to be set in actionscript, as well as set a glow property.
I am going to be resizing the box using actionscript so if I have it as an image or in the mc it will be resized and that would be no good.
Cheers,
Jeff
Animated Masking A Dynamic Image Is Causing Dynamic Image To Disappear Intermedently.
You can find the file here of what I am trying to do:
http://www.yourfilelink.com/get.php?fid=462218
Please tell me if you are having problems downloading it.
This has always irritated me and I can't seem to find a way around it.
I dynamically load an image to a movie instance and the movie instance is masked. The masking is animation on it, so that it looks like the image is animated via masking. It works if the masking animation is one long shape motion tween, but if I make the masking animation frame by frame, the image being masked disappears and reappears only when it is a long shape tween of the mask.
Please refer to the downloadable sample to understand what I mean. Is there a way around this?
I have seen page flip samples that is able to do what I am trying to do, but they used really advanced actionscripting to do this. I am using timeline.
Putting A Border Around Dynamic Images
Hi I wondered if anyone could help me. I am loading in a series of images dynamically, currently by creating emptymovie clips and then loading the images within. However, what i need to be able to do is place a white broder around the images within flash. Can anyone help me on how to acheive this please?
the code i am using to load the images inf orm the xml is below:
for (i=0; i<numimages; i++) {
this.picHolder = this.firstChild.childNodes[i];
this.thumbHolder = createEmptyMovieClip("thumbnail"+i, i);
this.thumbHolder._x = i*spacing;
this.thumbLoader = this.thumbHolder.createEmptyMovieClip("thumbnail_i mage", 0);
this.thumbLoader.loadMovie(this.picHolder.attribut es.thmb);
this.thumbHolder.title = this.picHolder.attributes.title;
this.thumbHolder.main = this.picHolder.attributes.main;
thanks veyr much in advance any pointers would be great.
Issues With Dynamic Movieclip Border
Hi Folks:
I'm trying to add a border to a dynamic movieclip, and nothing seems to be happening. It may actually have to do with the Graphics class in general, as none of the drawing methods seem to be working. I can't seem to find this issue on any forums, so I'm hoping that someone may have some guidance.
Here is my code, and I see no reason as to why it shouldn't work:
```````````````````````````````````````````````
function overThumb(event:MouseEvent):void {
var vars=event.target.getBounds(event.target.parent);
var border:Sprite = new Sprite();
event.target.addChild(border);
border.graphics.lineTo(vars.width, 0);
border.graphics.lineTo(vars.width, vars.height);
border.graphics.lineTo(0, vars.height);
border.graphics.endFill();
border.graphics.lineStyle( 1, 0x000000 );
}
```````````````````````````````````````````````
I also tried this and doesn't work either:
var myEgg:Shape = new Shape();
myEgg.graphics.beginFill(0xFFFFFF);
myEgg.graphics.lineStyle(1);
myEgg.graphics.endFill();
this.addChild(myEgg);
Thanks for any help!
jmjen47 is online now Report Post Edit/Delete Message
Dynamic Border For Loading Photos
I'm creating a photo gallery using XML and Flash. I already have XML connectivity working and the photos are all loading properly into one empty_mc on the stage. Now I want to generate a dynamic 10 pixel thick border around each image loaded into the empty_mc. Since the photos are all different dimensions how do I use the lineStyle property to add a border to the empty_mc each time a new photo loads in it?
Thanks.
|