Ask a Question related to Macromedia Flash, Design and Development.
-
alex #1
Help - Fixing Image Size in Picture Scroller...
Hello,
I have developed a simple picture scroller that connects to my backend MySQL
Database to retrieve the image filenames etc. This all works fine except
for the fact that users may want to upload images of different sizes - extra
large, large, small etc. My picture scroller will only show the images
within a specific area around 380 pixels wide and 250 pixels high...
As in normal web page development, this problem is easily overcome by simply
telling teh "dynamic image" that it MUST be a pre-set size so whatever the
size of the image in reality, it will be shown on the web page in the size i
want it to be (this may end up distorting the image but thats not a
concern). The problem is that for some reason, Flash wont allow me to do
this same type of update whereby i can give the image(s) a pre-set size...?
So i have a picture scroller at the moment, that shows parts of images
because the images are far too large and are not being resized within the
animation itself - how can i overcome this issue...?
I would appreciate ANY feedback on this...
Many thanks,
Alex
alex Guest
-
DHTML image scroller with layers
I'm hoping someone here can point me in the right direction. I have a website with a photo gallery and 12-15 photos in each gallery. The... -
Javascript image scroller
Greetings to all who read this... I need a bit of help here... I want an image scroller that instead of having to define each image i want it to... -
Dynamic image scroller asp flash
Hi, I m searching a flash solution ( i m not using flash..but dwmx 2004 and databases) to display pictures from a database recordset ( records... -
Fixing window size of flash projector
Hi, I am using the fscommand to fix the width of the my movie, but I want to be able to stop people resizing the projector window because I have... -
Fixing size of flash player
Hi, I have created a movie to go a cd. When the customer puts the cd in their computer it runs an autorun file runs the movie in the flash player.... -
Adam Albright #2
Re: Help - Fixing Image Size in Picture Scroller...
On Tue, 14 Sep 2004 07:47:31 GMT, "alex" <ahe@blueyonder.co.uk> wrote:
Use _width = and _height = in combination or _xscale = and _yscale =>Hello,
>
>I have developed a simple picture scroller that connects to my backend MySQL
>Database to retrieve the image filenames etc. This all works fine except
>for the fact that users may want to upload images of different sizes - extra
>large, large, small etc. My picture scroller will only show the images
>within a specific area around 380 pixels wide and 250 pixels high...
>
>As in normal web page development, this problem is easily overcome by simply
>telling teh "dynamic image" that it MUST be a pre-set size so whatever the
>size of the image in reality, it will be shown on the web page in the size i
>want it to be (this may end up distorting the image but thats not a
>concern). The problem is that for some reason, Flash wont allow me to do
>this same type of update whereby i can give the image(s) a pre-set size...?
>
>So i have a picture scroller at the moment, that shows parts of images
>because the images are far too large and are not being resized within the
>animation itself - how can i overcome this issue...?
>
>I would appreciate ANY feedback on this...
>
>Many thanks,
>
>Alex
>
Adam Albright Guest
-
alex #3
Re: Help - Fixing Image Size in Picture Scroller...
Hey,
Thanks for your reply...its very much appreciated...
I just want to confirm that this will automatically make 100% sure that ALL> Use _width = and _height = in combination or _xscale = and _yscale =
images will be shown within my designated area at the exact size i want them
to be (even though most if not all of them will be far larger than i need
them to be)...?
Once again, your advice is very much appreciated...
Regards,
Alex
"Adam Albright" <AA@ABC.net> wrote in message
news:q6sdk0tim9r9jid84jl21j5o23atkh5ba1@4ax.com...MySQL> On Tue, 14 Sep 2004 07:47:31 GMT, "alex" <ahe@blueyonder.co.uk> wrote:
>> >Hello,
> >
> >I have developed a simple picture scroller that connects to my backendextra> >Database to retrieve the image filenames etc. This all works fine except
> >for the fact that users may want to upload images of different sizes -simply> >large, large, small etc. My picture scroller will only show the images
> >within a specific area around 380 pixels wide and 250 pixels high...
> >
> >As in normal web page development, this problem is easily overcome bythe> >telling teh "dynamic image" that it MUST be a pre-set size so whateversize i> >size of the image in reality, it will be shown on the web page in thesize...?> >want it to be (this may end up distorting the image but thats not a
> >concern). The problem is that for some reason, Flash wont allow me to do
> >this same type of update whereby i can give the image(s) a pre-set> Use _width = and _height = in combination or _xscale = and _yscale => >
> >So i have a picture scroller at the moment, that shows parts of images
> >because the images are far too large and are not being resized within the
> >animation itself - how can i overcome this issue...?
> >
> >I would appreciate ANY feedback on this...
> >
> >Many thanks,
> >
> >Alex
> >
>
alex Guest
-
Der Zählmeister #4
Re: Help - Fixing Image Size in Picture Scroller...
alex wrote:
> Hey,
>
> Thanks for your reply...its very much appreciated...
>
>>>>Use _width = and _height = in combination or _xscale = and _yscale =
>
> I just want to confirm that this will automatically make 100% sure that ALL
> images will be shown within my designated area at the exact size i want them
> to be (even though most if not all of them will be far larger than i need
> them to be)...?
>
> Once again, your advice is very much appreciated...
>
> Regards,
>
> Alex
hi Alex,
some time ago, i posted a reusable generic function for loading
a picture onto a target area, with automatic smart-resizing
capability. i post it here again. you might find it useful.
-----
The Count, Singapore
Learning Objects (e-Learning) Consultant
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~
// The following function will load a picture (.swf movie or
// .jpg still) stored in a file called strFileName and
// automatically fit it into a rectangular target area called
// mcTargetArea which is a MovieClip (or at least an Object
// with _x, _y, _height and _width properties)
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~
function LoadPicture(strFileName, mcTargetArea) {
createEmptyMovieClip("mcHolder", 1);
var mcpH = mcHolder;
//
mcpH._x = mcTargetArea._x;
mcpH._y = mcTargetArea._y;
mcpH.th = mcTargetArea._height;
mcpH.tw = mcTargetArea._width;
mcpH.createEmptyMovieClip("mcInner", 100);
mcpH.mcInner.loadMovie(strFileName);
//
mcpH.onEnterFrame = function() {
var mcpI = this["mcInner"];
var myh = mcpI._height;
var myw = mcpI._width;
var myxs = mcpI._xscale;
var myys = mcpI._yscale;
if (myw>0) {
var xScale = this.tw/myw;
var yScale = this.th/myh;
var mScale = Math.min(xScale, yScale);
mScale *= 0.99;
this._width = this._width*mScale;
this._height = this._height*mScale;
delete this.onEnterFrame;
}
};
};
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~
Der Zählmeister Guest
-
alex #5
Re: Help - Fixing Image Size in Picture Scroller...
Hi,
I just noticed your rather comprehensive reply - i will test the solution
later today - but just wanted to say thank you for posting it...!! :-)
Regards,
Alex
"Der Zählmeister" <the_count@mozilla.com.sg> wrote in message
news:ci9m8k$rl8$1@mawar.singnet.com.sg...ALL> alex wrote:
>> > Hey,
> >
> > Thanks for your reply...its very much appreciated...
> >
> >> >> >>Use _width = and _height = in combination or _xscale = and _yscale =
> >
> > I just want to confirm that this will automatically make 100% sure thatthem> > images will be shown within my designated area at the exact size i wantneed> > to be (even though most if not all of them will be far larger than i>> > them to be)...?
> >
> > Once again, your advice is very much appreciated...
> >
> > Regards,
> >
> > Alex
>
>
> hi Alex,
>
> some time ago, i posted a reusable generic function for loading
> a picture onto a target area, with automatic smart-resizing
> capability. i post it here again. you might find it useful.
>
> -----
> The Count, Singapore
> Learning Objects (e-Learning) Consultant
>
>
>
>
> // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~
> // The following function will load a picture (.swf movie or
> // .jpg still) stored in a file called strFileName and
> // automatically fit it into a rectangular target area called
> // mcTargetArea which is a MovieClip (or at least an Object
> // with _x, _y, _height and _width properties)
> // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~
> function LoadPicture(strFileName, mcTargetArea) {
> createEmptyMovieClip("mcHolder", 1);
> var mcpH = mcHolder;
> //
> mcpH._x = mcTargetArea._x;
> mcpH._y = mcTargetArea._y;
> mcpH.th = mcTargetArea._height;
> mcpH.tw = mcTargetArea._width;
> mcpH.createEmptyMovieClip("mcInner", 100);
> mcpH.mcInner.loadMovie(strFileName);
> //
> mcpH.onEnterFrame = function() {
> var mcpI = this["mcInner"];
> var myh = mcpI._height;
> var myw = mcpI._width;
> var myxs = mcpI._xscale;
> var myys = mcpI._yscale;
> if (myw>0) {
> var xScale = this.tw/myw;
> var yScale = this.th/myh;
> var mScale = Math.min(xScale, yScale);
> mScale *= 0.99;
> this._width = this._width*mScale;
> this._height = this._height*mScale;
> delete this.onEnterFrame;
> }
> };
> };
> // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~
alex Guest



Reply With Quote

