Re: [Flashcoders] Resizing a background image only.And keeping aspect ratio.

2008-02-03 Thread Pedro Kostelec
Perhaps sth like this would work: original_picture_width=550; original_picture_height=400; picture_mc.width=stage.stageWidth; picture_mc.height=(stage.stageWidth / original_picture_width)*original_picture_height; I am not sure it is completely as3, becasue i just started learning it, so you

Re: [Flashcoders] Resizing a background image only.And keeping aspect ratio.

2008-02-03 Thread Pedro Kostelec
Oh, It is picture_mc.scaleX and not picture_mc.width and picture_mc.scaleY instead of picture_mc.height At least i supose On Feb 3, 2008 12:29 PM, Pedro Kostelec [EMAIL PROTECTED] wrote: Perhaps sth like this would work: original_picture_width=550; original_picture_height=400;

Re: [Flashcoders] Resizing a background image only.And keeping aspect ratio.

2008-02-03 Thread Kenneth Kawamoto
It could be cleaner, but here we go: private function onStageResize(e:Event):void { var picRatio:Number = picture_mc.width/picture_mc.height; var stageRatio:Number = stage.stageWidth/stage.stageHeight; if(picRatio stageRatio){ picture_mc.width = stage.stageWidth;

Re: [Flashcoders] Resizing a background image only.And keeping aspectratio.

2008-02-03 Thread Vlado Krempl
Thanks for the reply, Cheers, from Sydney, Australia. - Original Message - From: Pedro Kostelec [EMAIL PROTECTED] To: Flash Coders List flashcoders@chattyfig.figleaf.com Sent: Sunday, February 03, 2008 10:29 PM Subject: Re: [Flashcoders] Resizing a background image only.And keeping

Re: [Flashcoders] Resizing a background image only.And keeping aspectratio.

2008-02-03 Thread Vlado Krempl
Thanks for the reply, will give it a go. Cheers, from Sydney, Australia. - Original Message - From: Kenneth Kawamoto [EMAIL PROTECTED] To: Flash Coders List flashcoders@chattyfig.figleaf.com Sent: Sunday, February 03, 2008 11:03 PM Subject: Re: [Flashcoders] Resizing a background image

Re: [Flashcoders] Resizing a background image only.And keeping aspectratio.

2008-02-03 Thread Vlado Krempl
Kenneth, Works fantastic. Thanks. One problem though, in the browser ( IE ) the image shows up small and only resizes when you adjust the browser. Is it possible to have the image in the browser and have the image touching the sides at all times. Here is a great example site.

Re: [Flashcoders] Resizing a background image only.And keeping aspectratio.

2008-02-03 Thread Ivan Dembicki
Hello oops private function onAddedToStage(e:Event=null):void { onStageResize(); } private function onStageResize(e:Event=null):void { picture_mc.width = stage.stageWidth; picture_mc.height = stage.stageHeight; picture_mc.scaleX = picture_mc.scaleY = Math.max (picture_mc.scaleX,

Re: [Flashcoders] Resizing a background image only.And keeping aspectratio.

2008-02-03 Thread Pedro Kostelec
You mean you want to update it all the time(the image size)? Try sth like this: private function init():void { stage.addEventListener(Event.ENTER_FRAME,onEnterFrame); } private function onEnterFrame(event:Event):void { var

Re: [Flashcoders] Resizing a background image only.And keeping aspectratio.

2008-02-03 Thread Ivan Dembicki
Hello private function onAddedToStage(e:Event=null):void { private function onStageResize(); } private function onStageResize(e:Event=null):void { picture_mc.width = stage.stageWidth; picture_mc.height = stage.stageHeight; picture_mc.scaleX = picture_mc.scaleY = Math.max

Re: [Flashcoders] Resizing a background image only.And keeping aspectratio.

2008-02-03 Thread Ivan Dembicki
Hello oops again :) private function onAddedToStage(e:Event):void { onStageResize(); } private function onStageResize(e:Event=null):void { picture_mc.width = stage.stageWidth; picture_mc.height = stage.stageHeight; picture_mc.scaleX = picture_mc.scaleY = Math.min(picture_mc.scaleX,

Re: [Flashcoders] Save MC as JPG

2008-02-03 Thread Dave Mennenoh
Nobody? I am still not figuring this out. Using getPixel() on certain clips is returning #FF when it's cleary not a white pixel. But it makes no sense. On one clip it works, on another it doesn't. Both are just movie clips containing imported bitmap images. I've searched for problems with

Re: [Flashcoders] Save MC as JPG

2008-02-03 Thread John McCormack
Has the frame definitely loaded when you read the pixel? Have you some code to give us a clue? John - Original Message - From: Dave Mennenoh [EMAIL PROTECTED] To: Flash Coders List flashcoders@chattyfig.figleaf.com Sent: Sunday, February 03, 2008 2:24 PM Subject: Re: [Flashcoders]

Re: [Flashcoders] Save MC as JPG

2008-02-03 Thread Hans Wichman
Hi, can u put a test online? With fla that is. greetz JC On Feb 3, 2008 3:24 PM, Dave Mennenoh [EMAIL PROTECTED] wrote: Nobody? I am still not figuring this out. Using getPixel() on certain clips is returning #FF when it's cleary not a white pixel. But it makes no sense. On one clip it

Re: [Flashcoders] Save MC as JPG

2008-02-03 Thread Dave Mennenoh
OK -it seems to be the BitmapData.draw() method that is failing. On just certain images (though all are jpeg's imported into Flash and turned into MC's) draw() is copying an all white image, and on some it works. It doesn't seem to be a size issue since some rather large images are working.

Re: [Flashcoders] Save MC as JPG

2008-02-03 Thread Hans Wichman
Hi, are you loading all images from the same domain? greetz JC On Feb 3, 2008 4:00 PM, Dave Mennenoh [EMAIL PROTECTED] wrote: OK -it seems to be the BitmapData.draw() method that is failing. On just certain images (though all are jpeg's imported into Flash and turned into MC's) draw() is

Re: [Flashcoders] Save MC as JPG

2008-02-03 Thread John McCormack
Might it be this... public checkPolicyFile : Boolean Specifies whether Flash Player should attempt to download a cross-domain policy file from the loaded object's server before beginning to load the object itself. Set this flag to true when you are loading an image (JPG, GIF, or PNG) from

Re: [Flashcoders] Save MC as JPG

2008-02-03 Thread Dave Mennenoh
Sorry... I have it figured out now. Some of the clips I was given had their registration points at bottom left, instead of top left. Changing them all to top-left cured the issue. Funny how those little things can trip you up for a day! Dave - Head Developer http://www.blurredistinction.com

Re: [Flashcoders] Resizing a background image only.And keeping aspectratio.

2008-02-03 Thread Kenneth Kawamoto
Vlado, The site you're referring is slightly different, i.e. my code shows ALL regions of the image while maintaining the aspect ratio, but the site fills the Stage and crops the image if the Stage aspect ratio does not match the image's. There is also a minimum width/height of the image and

[Flashcoders] Dynamic upload of bunch of images with automatic smooth.

2008-02-03 Thread Irene Johansson
Hello all you fine people! I have a big problem with uploading smooth images. What I do is, i load XML file, parse it loop through it, create movieclips, and load images into thos movieclips (if image is specified in xml) for(var k:Number=1; k=itemNr; k++){ usrNr++; var walker1:MovieClip = new

[Flashcoders] AS3 dynamic scrollbar that resizes onStageResize, but is not fullscreen- script?

2008-02-03 Thread Irene Johansson
Hello again :) I was googling a lot but i could not find any as3 scrollbar that automatically resizes when windows is bigger. Has anyone seen/ is a proud owner, and does not mind to share that kind of script. Cheers Irene ___ Flashcoders mailing list

Re: [Flashcoders] Dynamic upload of bunch of images with automaticsmooth.

2008-02-03 Thread Muzak
Check the example in the docs. You need to create a copy of the original (loaded) image, add it to the display list and remove the (original) loaded image http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Bitmap.html Here's an example of loading an image and displaying a

[Flashcoders] Simple compression algo?

2008-02-03 Thread Dave Mennenoh
Hi all, I've been working on allowing users to dowload a jpeg from a movieClip in AS2 and came up with a simple, yet novel compression idea, that's a bit like RLE but not quite. Basically it is this - analyze the image pixel by pixel to get the hex color codes into an array. Then, make a new

Re: [Flashcoders] Simple compression algo?

2008-02-03 Thread Juan Pablo Califano
Interesting stuff. I assume you're creating the jpeg on the server since you seem to be passing the raw bitmap data (compressing the pixel data with your algorythm). Perhaps another approach worth trying is creating the jpef directly on the Flash app. Have you tried it? I've done that with

Re: [Flashcoders] Resizing a background image only.And keeping aspectratio.

2008-02-03 Thread Kenneth Kawamoto
I don't know how you are loading/adding the image to the Stage, but just fire image resize command as soon as the image is ready. For example: private function fillStage():void { picture_mc.width = Math.max(stage.stageWidth, minW); picture_mc.height = Math.max(stage.stageHeight, minH);

Re: [Flashcoders] Simple compression algo?

2008-02-03 Thread Glen Pike
Sounds a bit like Run Length Encoding Dave Mennenoh wrote: Hi all, I've been working on allowing users to dowload a jpeg from a movieClip in AS2 and came up with a simple, yet novel compression idea, that's a bit like RLE but not quite. Basically it is this - analyze the image pixel by pixel

RE: [Flashcoders] Simple compression algo?

2008-02-03 Thread Claudius Ceteras
Hi, Hi all, I've been working on allowing users to dowload a jpeg from a movieClip in AS2 and came up with a simple, yet novel compression idea, that's a bit like RLE but not quite. Basically it is this - analyze the image pixel by pixel to get the hex color codes into an array.

[Flashcoders] Flex Lists

2008-02-03 Thread Andrew Sinning
Where do the folks on this list go for Flex questions. I'm looking for a Flex-Newbies list. Thanks. ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Re: [Flashcoders] Flex Lists

2008-02-03 Thread percepticon
Flexcodersof course :D Sent via BlackBerry by ATT -Original Message- From: Andrew Sinning [EMAIL PROTECTED] Date: Sun, 03 Feb 2008 21:35:45 To:Flash Coders flashcoders@chattyfig.figleaf.com Subject: [Flashcoders] Flex Lists Where do the folks on this list go for Flex questions.

[Flashcoders] Problem with datefield disabled ranges

2008-02-03 Thread JD Hoover
Hi, I'm using a datefield component Flash 8 and want to disable dates from an external xml file created from a mysql db.The two instances are instantiated from the library. Trace of the disabled date array is: {rangeStart: new Date(2008,2,6), rangeEnd: new Date(2008,7,3)},{rangeStart: new

[Flashcoders] Properly embedding flash with html.

2008-02-03 Thread Vlado Krempl
Hello everyone, Question: When embedding a flash movie in HTML - Is everyone using the Publish settings that flash CS3 comes with AC_RunActiveContent.js etc or is the SWF OBject still the preferred way? Cheers, Vlado Krempl M 0433 781740 Please consider the environment before printing