ActionScript 1/2 :: Center The Image When Click The Movieclip

Oct 30, 2009

i am new with flash, and i had swf which contains big image it will resize to best fit. when i double click the image the clicked position come to center of the stage. i achived little bit, it zooming but image not come to center position. i have attached the fla file in it i have used this script to zoom on double click and bolded 2 lines are to position the image.

[Code]...

View 16 Replies


Similar Posts:


ActionScript 3.0 :: Center Image/movie Clip On Click?

Oct 23, 2009

i am trying to center the image once clicked, i have multiple images(4) and want them to open dead center on the stage i would also like to close the opened image when the next one opens and return it to original position!

what i have got so far:-
 
stop();port1_mc.doubleClickEnabled=true;
var centerX:uint = stage.stageWidth / 2;var centerY:uint = stage.stageHeight / 2;
port1_mc.addEventListener(MouseEvent.DOUBLE_CLICK, go);
function go(evt:MouseEvent):void{
//opens image to the stage  gotoAndPlay (2);}

View 5 Replies

ActionScript 2.0 :: Image Pan - Want To Center/scale Relative To Position At Click?

Aug 19, 2006

I've recently taken Krilnon's tutorial on interactive image panning, and have a need for more complexity. My image to be panned (relative to user's mouse movement) has several 'hot spot' buttons placed within. Each hot spot, when clicked, is to smoothly zoom and shift within the mask, with pertinent info displayed next to each, once zoom and shift is complete. almost like I'm making a motion tween, where the final position is known, but the start position is wherever the BG image is when the user clicks the nested button. I need to determine the x-position at the moment of click of the button (different for each button), and then, I think, use a simple-math "stagger-step" method of moving and scaling, until I've reached my final dest. here's the link to the tutorial I originally referenced:If anyone knows of a tutorial or example out there, I'd love directions to it(them). or,

View 1 Replies

ActionScript 3.0 :: Why Does Movieclip Center On Click (using The Drag Method)

Aug 19, 2011

I have a movieclip, that is draggable (horizontally), i have this code (helped achieved by Kglad!):It has a nice effect, but when i click to drag the movieclip jums to its registration point.
 
var completeTween:Boolean;
var finalMouseY:int;
var startMouseY:int;
mc.addEventListener(MouseEvent.MOUSE_DOWN, onDown1);

[code]....

View 19 Replies

ActionScript 2.0 :: Center Image In A Movieclip?

Mar 23, 2010

I try to put an extern image in my flash movie. No i have problem to center it.This is the code i tried to use:

Code:
var container:MovieClip = this.createEmptyMovieClip("container", this.getNextHighestDepth());
var image:MovieClip = container.createEmptyMovieClip("image", container.getNextHighestDepth());
var listener:Object = new Object();

[code]....

But I can't see the picture....

View 2 Replies

ActionScript 3.0 :: How To Center Image To MovieClip

Jul 7, 2011

As the title says, I'm trying to figure out how to center and image to a movie clip. I am familiar with centering images to the stage.
imageLoader.x = (stage.stageWidth - Number(rawW)) /2;
imageLoader.y = (stage.stageHeight - Number(rawH)) /2;
But I do not know the correct actionscript phrases to implement this same concept into my movie clip known as "gallery_mc".

View 2 Replies

ActionScript 2.0 :: Center An Image/movieClip?

Nov 10, 2004

Now I am trying to center an image/movieClip. Below is how I get everything going

Code:
var k = _root.createEmptyMovieClip("stage", 50);
k._x = 400;
k._y = 300;
var p = k.createEmptyMovieClip("bigImage", 0);

[Code]...

View 4 Replies

ActionScript 2.0 :: [MX] Center An Image/movieClip?

Nov 10, 2004

Now I am trying to center an image/movieClip. Below is how I get everything going

[code]...

View 4 Replies

ActionScript 3 :: Getting Index (Click Event) Of Loaded MovieClip Image

Jan 11, 2011

I am loading a set of thumbnail images from an array [hard coded] into a movieclip symbol on the stage. I have two arrays with the thumbnail and the full size image having the same index number. In many examples, "event.currentTarget.contentLoaderInfo.url" returns the full path to the image selected. i just want the index number. Adobe does not make is easy to figure out what other properties are available to me from the contentLoaderInfo. Is 'SelectedIndex' or something like that available? Where does an inspiring AS programmer find the contentLoaderInfo properties and or methods available? Is url the only thing that us usable here?

var thumbnails:Array = ["tn_2010OpenHouse_00.jpg","tn_2010OpenHouse_01.jpg"];
var images:Array = ["2010OpenHouse_00.jpg","2010OpenHouse_01.jpg"];
var thumbX:Number = 10;
var thumbY:Number = 623;
var loader:Loader = new Loader();
loader.load(new URLRequest("images/" + images[0]));
addChild(loader);
loadThumbs();
[Code] .....

Output:
Index= -1
Index= -1
Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.

View 2 Replies

Flex :: Center An Image Horizontally And Vertically In An Image Control?

Aug 14, 2010

How can I center a loaded photo [lets say 200x300] in an image control [lets say 400x600]? My image control has fixed dimensions while my contents have different dimensions and I want them to get centered automatically.

View 1 Replies

ActionScript 2.0 :: Loading A .png Image With LoadMovie() And Center The Image

Oct 20, 2009

I'm loading a .png image with loadMovie() and I need to center the image (for later dragging). I know flash has some issues with loading stuff, but I really need to get the movieclip's width. If someone knows how to get over this and get the movieclip's width

This is a part of a more complex app, so that's why I won't paste any code.

View 3 Replies

ActionScript 2.0 :: Center Movie Can Click / HitTest?

Jun 1, 2006

is there such AS where you can click/hitTest etc. and then it will take you to the next frame but with the whole frame centered?

View 4 Replies

Actionscript 3 :: Set Zoom On Mouse Click Target To Center Of Stage?

Aug 24, 2011

I'm having toruble with an image that I zoom into in flash. I got everything to work, only I want the clicked X and Y coordinats to center to the stage. ( so that the area clicked on always zooms in and position the area clicked to the middle of the stage) the image is a movieclip and it zooms with a tween, but i tried everything but the image wont center the stage..

does anyone have a clue for wich actionscript 3 code I can use to do this?

my code is:

const TWEEN_IN:String = "tweenIn";
const TWEEN_OUT:String = "tweenOut";
var tweenDirection:String;

[Code]....

View 1 Replies

ActionScript 2.0 :: Click To Move + When Click Image - Go To Frame In A Movie Clip?

Aug 28, 2010

I would like to know how to make it so when you click a button, it goes to a different frame within a MOVIE CLIP. Kind of like gotoAndPlay but not a frame in the timeline. I would like it to move to a different frame in a movie clip.

View 1 Replies

ActionScript 2.0 :: Click On A Movie Clip It Is Changed By A Image On Click?

Jul 9, 2010

i want to know that when i click on a movie clip it is changed by a image on click using action script any ver.

View 3 Replies

Xml Image Gallery Appear In Center?

Apr 14, 2010

created in flash. The issue i am having is when an image is loaded it always appears on the left handside attached to the top left point of the stage. Is there anyway i can get these images to load in the centre of the stage? This is the AS that is attached to my flash document.

Actionscript Code:
function initGallery() {  function loadXML(loaded) {  if (loaded) {  xmlNode = this.firstChild;  total = xmlNode.childNodes.length;

[code].....

View 1 Replies

IDE :: Center Swf Image In Browser?

Nov 9, 2009

Is it possible to center an swf in the html or php file, when the swf has a width larger than the browsers width?

View 1 Replies

ActionScript 3.0 :: Get Center Of Image Not Working?

Feb 21, 2010

I have am trying to establish the center of the imags that load so that I can put them in the center of the stage. I am doing this as each image is a different size.
 
Here is the code i have gotten to work before but its not working now and I have been searching to find what I have done wrong with no luck. : ( Would you look it over and maybe you will see what I am doing wrong?
 
 public function placePicture(e:Event = null):void {
rawImage = imageData.image[imgNum].imageURL;
lastImageIndex = imageData.*.length() - 1;

[Code].....
 
and I tried doing all of the above by inserting the loader into a sprite and then applying the code to the sprite and then adding that sprite to another sprite and putting that at 640 and not inserting it in another sprite and trying to straight up put the existing sprite at 640 (hopefully that all makes sense). And I have tried to put it to width/3 and nothing different happens.

View 3 Replies

ActionScript 1/2 :: Center Image Using LoadMovie?

Jul 31, 2010

I'm trying to load an image and center it within a movie clip already on the stage.
 
function loadImage(){  image_mc.loadMovie("fullImage/"+imageNum+".jpg");  image_mc._x= Stage.width/2 - image_mc._width;  image_mc._y= Stage.height/2 - image_mc._width;}
 
I know it's something simple and there are forums dedicated to this topic but I can't seem to view the code examples that the helpers are using.

View 3 Replies

Actionscript 3 :: Center One Image Horizontally?

Nov 5, 2011

with the formula below I can center one image horizontally.

var xPoint= stage.stageWidth / 2 - imgWidth / 2;

In case if I may have more than one image, how can I center them horizontally?

View 2 Replies

Actionscript 3.0 :: Row Counter Of Center Image?

Apr 24, 2009

How do i make this problem solved

problem.gif (72.44 KiB) Viewed 381 times

View 3 Replies

Flash :: Flip Image Around Center?

Jan 5, 2012

To flip an image around the center i am using this piece of code:

// Calculate offset
var offsetWidth:Number = image.contentWidth/2.0;
var offsetHeight:Number = image.contentHeight/2.0;

[Code].....

View 1 Replies

IDE :: Mc Tween Resize Center Of Image?

Jan 23, 2009

I'm just trying to figure out to get my MC to resize from the center instead of the top left? Can I change the registration point or something in AS?

View 1 Replies

ActionScript 2.0 :: How To Center Image In TextField

Oct 4, 2004

I have a dynamic textfield and it is using the htmlText attribute. How do I center an image that is loaded in using the <img> tag?

View 1 Replies

ActionScript 2.0 :: CS3 Movieclip Button - Click To Play, Click To Stop?

Jun 21, 2010

I am building a flash interface and I would like a menu where it is hidden to begin with (just a tab). You click the tab to expand it, and click again to collapse it. I've made a movieclip with animation of the menu opening up and closing, but I can't seem to work out how I'd go about making the movieclip open and close properly.

View 4 Replies

Flash :: Cursor Image To The Center On Mouseout

Nov 17, 2009

I'm a real noobie with flash and I was wondering if somebody could help me with this one. I have this actionsript 3 code, where the cursor image "ball_mc" follows the mouse's position with a slight delay:

[Code]...

1) How can I get the cursor image automatically return to the center of the stage on mouseout? As of now, it stays at the position where the mouse leaves the stage.

2) How can I reverse the movement of the mouse? So that when I, for example, move mouse to the right, the cursor image would move to the left? And when moving the mouse up, the image would go down. The stage is 800 x 250 pixels, in case that makes any difference.

View 2 Replies

ActionScript :: Drawing An Image In The Center Of A Shape?

Oct 20, 2011

I'm trying to draw an image in actionscript, I set it as a BitmapFill within a rectangle. The problem is that if I move the rectangle away from the origin(0,0), in my case I start drawing the rectangle at (20,35), the bitmap background doesn't follow along. The background is always drawn at (0,0) and then repeated, so I don't get a centered image but rather 2 halved images. Here's what my code looks like:

public class PageTileRenderer extends VBox
{
private var sp:Shape;

[Code]....

how to move the background fill origin. Or is there another solution to draw the image centered.

View 2 Replies

ActionScript 2.0 :: Scale-Center Image, Then Show?

Jan 16, 2012

I have a list of artist, each one a mc, in a vertical display. Next to them, I have a holder in which I load the thumbnails one the mouse is over a mc.This images, are being loaded via loadclip.. resize-center and then shown with alpha..But sometimes, the image are shown huge, and instantly resized and positioned.This a dvd project.. so images are not being downloaded..this is the part of the code..

Code:
thumb.onRollOver = function() {
this.gotoAndPlay("rollOver");

[code].....

View 3 Replies

IDE :: Image Alignment - Won't Center Until Resize The Stage

Feb 19, 2009

im creating an xml image gallery and its going well, but for some reason when i add the loaded image to the stage even though i've specified it to go to the center of the stage it doesn't, and won't center until I resize the stage

View 2 Replies

ActionScript 2.0 :: Kirupa Slideshow - How To Center The Image

Jun 10, 2011

I am working on a flash project right now with the help of the tutorials found on this website and decided to use and modify this existing slideshow by Kirupa.

[URL]

What I did was, I resized it according to my projects demands, which is 1024x650 [URL]Everything is working perfectly except for one drawback.

Some of my images are sized 440x650. Normally, when I link that to the XML file provided, it is aligned by default to the left. My current solution was to resize the entire file into 1024x650 creating the illusion that the image is at the center because I included the seamless background on the saved jpeg.My question is this, is there any way I can center the 440x650 image to be displayed in the slideshow?

Kirupa's original code is this one:

[code].....

View 1 Replies







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