Flex :: Photo Gallery - Resizing Image Whilst Keeping It Central

Mar 4, 2010

I am using a mx:Resize effect to change the width of an image in Flex (leaving the height to look after itself) but I want the image to remain vertically centered on the page. Whilst I could calculate the aspect ratio of the photo, and work out the new y value to keep it centred, I would have to include a mx: Move effect too, and I am hopful that Flex has a simpler way. This is for a photo gallery where images are loaded at run-time, and swapped about.

So I really would like to avoid recalculating the aspect ratio and vertical position every time the updateComplete event fires, I tried putting my image inside a mx: VBox with verticalAlign="middle", thinking that the box would do all the centering for me, but this only seems to happen when the app first starts - i need it to gradually adjust the position during the period where the effect plays (to keep it central even when part-way through).

Here's a stripped-down example (which doesn't work):
<mx:Application xmlns:mx="[URL]" layout="absolute" width="600" height="600">
<mx:Resize id="fxResize" target="{imgPhotoA}" widthTo="350" duration="500" />
<mx:Button x="10" y="10" label="Resize" click="fxResize.play()" />
<mx:VBox id="boxPhotoA" x="100" y="20" height="500" width="350" verticalAlign="middle" borderStyle="solid" verticalScrollPolicy="off" horizontalScrollPolicy="off">
<mx:Image id="imgPhotoA" width="60" maintainAspectRatio="true" source="[URL]"/>
</mx:VBox></mx:Application>

View 2 Replies


Similar Posts:


ActionScript 3.0 :: Make A Flash Photo Gallery That Displays All The Image Files In A Certain Directory With The Usual Photo Gallery Functionality

Sep 1, 2009

Just trying to make a flash photo gallery that displays all the image files in a certain directory with the usual photo gallery functionality.

View 1 Replies

ActionScript 2.0 :: Resizing Images For Photo Gallery

Feb 1, 2007

I have built a photo gallery connecting to a data base through php. Each photo loads in on a targeted movie clip. Is there any way to resize the image using flash before its displayed?

View 2 Replies

ActionScript 2.0 :: Photo Gallery XML - Html File Shows The Extra Image In The Gallery But The Swf Doesn't

Feb 17, 2008

i am trying to add extra images to the photo gallery attached. I would have thought it is easy and it seems so. I add an extra image to the gallery. I publish it. The html file shows the extra image in the gallery but the swf doesnt. driving me crazy, cant work it out?

View 14 Replies

ActionScript 3.0 :: Create A Scrolling Background Whilst Keeping The Car Static In The Centre Of The Screen?

Aug 17, 2011

Ok i have been looking at a racing game and have used the tutorial from this link here:[URL]...What i am having trouble with is trying to create a scrolling background whilst keeping the car static in the centre of the screen. Ane example of what im trying to do is here:[URL]...So i have tried incorporating the code from that scrolling background example, into the car racing game itself but i am having trouble doing so. Is there any way that the code used from the scrolling background can be input into the racing game example to create this scrolling background effect?

View 1 Replies

IDE :: Way To Preserve A Stroke Whilst Resizing

Feb 24, 2009

I would like to know if there is a way of maintain the stroke size whilst resizing my object with actionscript.I have an object that imported from Illustrator with a 7pt stroke and would like that stroke to maintain its aspect even when resized to 10%

View 1 Replies

ActionScript 2.0 :: Resizing Two Movie Clips Whilst Adjusting It's X,y Position?

Jul 26, 2006

I am trying to resize a 2 or more movieclips, but when I resize them I want them to have a relative postion to one another for example decreasing the size of two movieclip touching each other, I would like the movieclips to maintain a relative x,y position.. so if decreased or increased in size they will still look the same.This movie clips are on the stage, so I can not attach it from the library.

View 1 Replies

ActionScript 2.0 :: Image Gallery And Resizing?

Jan 26, 2009

I have been racking my brains trying to figure out how to do this but I can't! The two pictures I have given are different sizes to represent different browser sizes. The 'menu' stays the same size in the same position and the image/ greyblock scales proportionally to the browser keeping the same border sizes around the image.

View 2 Replies

IDE :: Photo Gallery Using XML - Image Sizes

Sep 9, 2009

How can i fix the ImageHolder (Movie Clip size) that holds the images loaded into it. At the moment I have sized the photos to the size I want, but if a photo is not that "Specific" size it will overlap my text next to it... How can I fix the size of this movie clip to show the images without it blowing out my design? I have sized all the images to: 230px x145px If they are not this size the design will not work, I need to fix the window to 230px x145px

View 1 Replies

ActionScript 2.0 :: Load First Image In Photo Gallery?

Nov 22, 2006

I have done a photo gallery using the following code. However, I need the first picture to appear as the movieclip is loaded. What shall I introduce to this script? Or what would I have to change?

myPhoto = new XML();
myPhoto.ignoreWhite = true;
myPhoto.onLoad = function(success) {
//portfolioTag = this.firstChild;

[Code]....

View 3 Replies

IDE :: Image Distortion In Xml/Flash Photo Gallery?

Mar 9, 2009

I used the Photo Gallery using xml and Flash tutorial and created a nice gallery with thumbnails I increased the size to accommodate a 800x533px size picture however when the images are imported they are distorted to a size that looks to be around 900x400px I am using flash 8.

View 1 Replies

ActionScript 3.0 :: XML Photo Gallery Default Image Loading

Oct 15, 2010

I have a photo gallery on my site that is generated using AS3 and XML. Everything works great but I'd like to have the images that relate to the first thumbnail appear automatically when the movie loads.

Here's my code:
Code: Select all//DEFINE ARRAYS
var thumbnailsArray:Array = new Array();
var productDescriptionArray:Array = new Array();
var magazineArray:Array = new Array();
var mediumArray:Array = new Array();
var largeArray:Array = new Array();
[Code] .....

View 9 Replies

ActionScript 2.0 :: Photo Gallery Using XML And Flash - See Only 1 Thumbnail Image?

Aug 7, 2005

I learned from great kirupa tutorial and implemented the thumbnail gallery in my site.If I open the site in browser Opera or Firefox (FP 8.0.0.447) i see only 1 thumbnail image - is it bug in Player? In IE 6 I have FP 7.0.19.0 and I can see all thumbnails in the navigation bar - also correct.

View 8 Replies

ActionScript 2.0 :: Xml Photo Gallery - Image Sizes And Quality

Aug 23, 2006

I've been working with the xml photo gallery tutorial on this site, and pretty much have it the way I want, except I am having some serious issues with the image sizes and quality, and cannot figure this one out.. The problem is that when the jpg images are loaded in dynamically they look horrible in quality. I searched and searched for an answer to this and couldn't really find anything that I had already tried... The only thing I could really think of was to rebuild my site at a larger scale and publish with 'match movie' instead of 'percent'.

After all that work... I'm having something very crazy going on, but it should help diagnose the problem.. When I rebuilt the site and re-did the images to match the exact pixels, for some reason now they are super big. I've looked at my code and can't see any scaling going on.. I don't know what is happening, so I'm going to supply all available resources:

[Code]...

View 5 Replies

ActionScript 2.0 :: Scale Photo Gallery Image Proportionally?

Feb 27, 2009

This script loads the images dynamically using xml so getting the size of the image to use as a start provides to be a problem, since there is no image to begin with.I found script to be able to scale an image with the stage here:But this only works on a image that is already in the flash file, not one that is loaded dynamically like I'm doing with xml.

View 3 Replies

Jquery :: Flash-like Photo Gallery Large Image Animation

Jul 12, 2011

I'm doing photo gallery and like to enlarge an image when I click on it with some animation like it's in flash (the picture slowly expands first by x-axis and after by y-axis and the space around the picture dims), that it scales to it's largest possible size to fit in screen, but it can be any other animation. I found some topics about this, but I don't want to use any 3rd-party plugin (including flash, drupal...) to do it. Maybe it can be somehow done by jQuery...

View 1 Replies

ActionScript 3.0 :: Photo Gallery - Add Rollover Image To Show Before And After Images?

Jan 10, 2010

im making a web page that must containt photo gallery (noncomercial use). i downloadet allready comleted photo gallery and now i need to update it.evrything works fine, but i need to add rolower image so it will show me before and after images when i rollower on image.

View 2 Replies

ActionScript 2.0 :: Photo Gallery - Last Image Clicked By User Not Disappear

Jan 23, 2011

I have just started using flash. I needed to do this presentation for a client. In one scene I have provided him with a photo-gallery, where some 30 photos are placed randomly ...when playing the movie (published as projector) user will click any photo to watch it. For this I have used swapdepth so that photo, user clicks comes to front. Also applied drag to all these photos.

My code look something like this:
on (press, dragOver) {
startDrag(_root.pic6);
} on (release, rollOut, dragOut) {
stopDrag();
} on (press, release, dragOver, dragOut) {
_root.x +=2;
_root.pic6.swapDepths(_root.x);
}

For doing this first I converted the photo to button ...then converted this button to a movie clip and gave a instance name to this. Then I went into the movie clip and applied the above code to the button placed inside the movie. Applying all this to all photos I placed them randomly on timeline. The problem is : code is working fine, it is dragging photos, bringing them to front etc. But I have user to go back and play another scene to continue the presentation. Problem starts here, the last photo clicked by user remains there, even though it is not present in that scene.

View 9 Replies

ActionScript 2.0 :: Photo Gallery - How To Make Image Window Smaller

Jun 25, 2004

I found this really neat photo gallery on flashkit but there is no support or readme included. Hoping one of you actionscript gurus can sort through the AS and how to size this thing.. the AS code does have comments but I am not a coder. I'd like to make the image window smaller and the overall movie smaller. 325x325 or so.

View 10 Replies

ActionScript 2.0 :: Poor Image Quality Using The Xml Photo Gallery Tutorial?

Aug 22, 2006

I modified a version of the xml photo gallery tutorial featured on this website, and am using that. But when my images pop up the quality is horrible. I've gone through and checked everything I know to look at. Then I decided to build my flash site twice as big, and use pictures that were twice as big to get some quality. This didn't work either..

View 4 Replies

ActionScript 2.0 :: Lightbox Photo Gallery - Enlarging Clicked Image?

Sep 7, 2010

I Managed to insert a photo gallery using lightbox...however, would like to make some changes:
1. Fixed previous and next buttons, been playing around with the code, with no successful result.
2. I have a group of photos, and if I want to enlarge the one I click, I cannot. Whatever photo I click, always the first one of the group appears.

This is the code I have in my html file:
HTML Code:
<head>
<link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />
<script src="js/prototype.js" type="text/javascript"></script>
<script src="js/scriptaculous.js?load=effects" type="text/javascript"></script>
<script src="js/lightbox.js" type="text/javascript"></script>
[Code].....

View 1 Replies

ActionScript 2.0 :: Photo Gallery - Adding External Text For Each Image

Dec 22, 2003

I was trying to use the photo gallery tutorial from this site the code was done by sbeener I wanted to use the same concept for adding external text for each image. So far I have only been able to figure out how to load the text but I have not figured out how to be able to change the text to correspond to the image.

[Code]....

View 6 Replies

ActionScript 2.0 :: XML Photo Gallery - Go Back To The Beginning Image & Start All Over Again?

May 18, 2005

I've used kirupa's 'Photo Gallery Using XML and Flash' tutorial & modified to make my gallery, you can view it here: ZedMedia.org by clicking on the photos section in the main page. what i want to do is, instead of reaching the end of all my photos and it stopping, i want it to go back to the beginning image & start all over again. i want the opposite to appen at the start. when the previous_btn is pressed i want it to go to the end of the gallery.

View 3 Replies

Flash :: IDE - XML + Photo Gallery Tutorial - Image Open Up From The Scrolling Thumbnails

Nov 1, 2006

i want each image that opens up from the scrolling thumbnails below to have another set buttons relating to the main image. for instance:

[Code]...

numbers = buttons linked to another set of external images that are related to the big image. the problem is i don't know what controls the thumbnail/main image when i click on the scroller (i'm kinda lost in the code). so right now i have only one set of numbers regardless of which big image opens up.

View 14 Replies

ActionScript 2.0 :: Flash Photo Gallery (XML) - Pulls Image Urls From An External XML File?

Feb 20, 2008

I've built a flash photo gallery that pulls image urls from an external XML file. The gallery has different image catagories that load their own set of images.The user decided which catatgory they'd like to view by clicking an HTML button in the flash movies parent page...using javascript, this button click sends a variable to the root level of the flash movies with the new XML location...

Trouble is, onces the initial XML file is loaded, the movie has no need to refresh (and read the newly sent variable) ...*Unfortunately the catagory buttons MUST be outside the movie on the page...

View 4 Replies

ActionScript 2.0 :: Make Flash Photo Gallery That Displays All Image Files In Certain Directory?

Sep 1, 2009

Just trying to make a flash photo gallery that displays all the image files in a certain directory with the usual photo gallery functionality.

View 1 Replies

ActionScript 3.0 :: Photo Gallery - User To Be Able To Click On The Image Thumbnail And See An Enlarged Version Come Up Next To It

Sep 2, 2009

I would like to create a simple photo gallery in as3. I would like the user to be able to click on the image thumbnail and see an enlarged version come up next to it. The only galleries I see for flash are XML galleries and it was really complicated the last time I tried it.

View 1 Replies

Flex :: Resizing FileReference Image Then Reuploading - Only Reuploads Original Image

Apr 22, 2010

I can;t figure out how to do this. Someone selects and image after calling FileReference.browse(). I take that image and make a thumbnail in flash. Then I upload that image like so:

[Code]...

All this does it upload the original image. How do I change the fileRef to upload the new thumb? I have traced out the size of the "myThumbImage" and it is correct. I have placed it visually on the stage after creating the thumb, and it seems like it works. But when I upload it to an aspx page (that basically just throws it into a folder), it uploads the original larger image.

View 1 Replies

ActionScript 2.0 :: Photo Gallery - Photo's Start Automatically, Rather Than, On A Button Click?

Oct 27, 2011

its for a photo gallery that I downlowded,the images fades in and out, but only start that when you click a button(timer).I'm trying to founf out where in the script I can change this, so that the photo's start automatically,rather than, on a button click.I have pasted the script below, is that ok, or would people rather a zip file of the files?

// (c) Copyright by Andrew DiFiore. All rights reserved. DO NOT REMOVE.
fscommand("allowscale", "false");
Stage.scaleMode = "noScale";[code]......

View 4 Replies

Flex :: Advanced Image Cropping And Image Resizing?

Apr 26, 2011

I have created a image cropping tool in flex using core copyPixel method.croppedBitmapData.copyPixels(croppedBitmapData, clipCan, new Point(0, 0));I have to crope area of dementions 20*20 and show this cropped area in an image of demention 250*350. Every thing going well.My problem is image distortion.Even i am using this method for smoothing image contents on complete.

private function smoothImage(event:Event):void
{
var bitmap: Bitmap = ((event.target as Image).content as Bitmap);

[code]....

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved