Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash


Advertisements:










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


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 (Posted: Oct 23, 2009 6:45 PM)

Sponsored Links:

Related Forum Messages For Flash category:
ActionScript 3.0 :: Center An Image Inside A Movie Clip Via Xml?
i have the following code which works. Its for two buttons either side of a movie clip (holder_mc) which holds the images. The images load but their top left corner go to the 0,0 position of the movie clip (top left). My images are all different sizes and i want them all to be centred. I have looked at alot of threads and cant figure it out.

Posted: 11-27-2011, 06:07 PM

View 2 Replies!   View Related
ActionScript 2.0 :: Click To Move + When Click Image - Go To Frame In A Movie Clip?
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.

Posted: August 28th, 2010

View 1 Replies!   View Related
ActionScript 2.0 :: Click On A Movie Clip It Is Changed By A Image On Click?
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.

Posted: July 9th, 2010

View 3 Replies!   View Related
ActionScript 1/2 :: Center The Image When Click The Movieclip
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]...

Posted: Oct 30, 2009 6:36 AM

View 16 Replies!   View Related
ActionScript 2.0 :: Image Pan - Want To Center/scale Relative To Position At Click?
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,

Posted: August 19th, 2006

View 1 Replies!   View Related
ActionScript 2.0 :: Center Movie Can Click / HitTest?
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?

Posted: June 1st, 2006

View 4 Replies!   View Related
Center Component In Movie Clip?
I'm try to build a photo gallery using the flash components SlideShowPro and ThumbGrid. I have put ThumbGrid inside a movie clip called thumbs_mc that slides in and out when you mouse over it to show or hide the thumbs. That part is working, but I would like to have the stage and thumbs_mc resize to the browser width with ThumbGrid centered inside thumbs_mc.

Resize and scaling the stage and movie clips is not a problem, but I can't figure out how to keep ThumbGrid centered inside the containing movie clip. ThumbGrid is a fixed width component, and the only way I can get it to work is to have the mc the same width as the component. Here's the part of the AS that I'm using to control the positioning now:

Code:
thumbs_mc.x = (sw/2) - (thumbs_mc.my_tg.width/2);
thumbs_mc.y = sh-25;

Posted: 02-18-2011, 05:40 PM

View 7 Replies!   View Related
ActionScript 3.0 :: Click On The First Button Loads Ok But When Click On Second Still Showing The First Movie Clip In The Back
I have read all threads and can not find a solution but i am not somebody with a lots of knowledge about actionscript so here is my problem i am using this script .

[code]....

the problem is that when i click on the first button loads ok but when click on second still showing the first movie clip in the back ,,,,, i have try everything without luck ,,,, i guess i need to keep reading but will like to find an answer to this situation ,

Posted: 12-14-2011, 06:21 PM

View 3 Replies!   View Related
When Add Animation To Library, Movie Clip Goes Far From Center?
when i add my animation to library movie clip goes far from center, why is this happening and how can i fix it?

Posted: 01-10-2010, 11:55 AM

View 5 Replies!   View Related
ActionScript 2.0 :: LoadMovie In The Center Of Movie Clip
(using actionscript 2.0) I have a mc titled 'mc_othersitterimage1' Within 'mc_othersitterimage1' I have one layer with a simple shape that measures 85px x 85px, and I have another layer that has this actionscript on it:

Code:
this.loadMovie(perfectsitterimageURL1);
this._width = 30;
this._height = 30;

('perfectsitterimageURL1' is a variable for an image url. All of the images are NOT the exact same size.) I'd like the image to load in the center of my 85x85 pixel square. I have the registration point in the center of 'mc_othersitterimage1', but it still doesn't seem to work

Posted: 03-31-2010, 06:25 PM

View 1 Replies!   View Related
ActionScript 3.0 :: Detecting The Center Of A Movie Clip?
I am getting some overlap issues when I'm using the hitTestObject function to determine if I am over a particular target area. Is there anyway I can have the center of my movie clip determine if it's over the target area instead of using the whole clip? I am using:

mc.hitTestObject(targeItem);

It is the "mc" that i would like to use the center point instead of the whole movie clip.

Posted: Mar 18, 2009 11:51 AM

View 8 Replies!   View Related
ActionScript 2.0 :: Center A Movie Clip On 100% Stage?
How i can get a Movieclip centered on a 100% Stage?Stage.align = T; doesnt work :/

and this also not works :/
mc._x = (Stage.width/2)-(mc._width/2);
mc._y = (Stage.height/2)-(mc._height/2);

Posted: January 27th, 2006

View 2 Replies!   View Related
Professional :: Zoom To Movie Clip And Center On Child?
I have a movie clip of all counties in the state of Montana (allcnt_mc). Within allcnt_mc there are individual movie clips specific to each county with name equal to the county's name. When clicking on a county, I'd like to zoom to that county and center the stage on it. I've added event listeners to all counties through querying an xml table that has demographic info I am calling into dynamic text boxes. Here is the code I have thus far to load the xml and add the listeners to the county movie clips.

//load xml
var xmlLoader:URLLoader = new URLLoader();
var xmlData:XML = new XML();
xmlLoader.addEventListener(Event.COMPLETE, LoadXML);

[Code]....

Posted: Jul 20, 2010 10:43 AM

View 5 Replies!   View Related
ActionScript 1/2 :: Movie Clip In Center Stage Even Fullscreen?
how do I get a movie clip in the center of the stage, even if it moves to fullscreen

Posted: Mar 2, 2012 9:48 AM

View 3 Replies!   View Related
ActionScript 2.0 :: Center A Dynamic Created Movie Clip?
I have got a movie clip that is dynamically created with actionscript I then load an external swf into that movieclip. My problem is having it centered when I view it in my browser..How do place I center that dynamic created movie clip? I was trying this but it's not seeming to work.

Code:

var container:MovieClip = this.createEmptyMovieClip("container_mc", 0);
container._x =Stage.width/2;
container._y =Stage.height/2;

Posted: April 7th, 2006

View 7 Replies!   View Related
ActionScript 2.0 :: Center A Movie Clip Within Two Other Clips To The Stage?
I'll start off by saying I'm using Flash 8, Actionscript 2.0, and exporting as FlashPlayer 6.I'm trying to do this long landscape with a movie clip labeled, "mainMovie", let's say it's approximately 3600 x 600, while the stage/document dimensions are 800 x 600 .I have script on it so that moving the cursor to the left or right edge of the stage, the entire movie clip shifts left or right and through the rest of the landscape, similar to the 360 vr tours you see for some real estate sites online.On the main stage, I have that movie clip called, "mainMovie". Inside "mainMovie", is another clip called, "singleStrip", and inside that clip, I have other smaller movie clips through the landscape which are labeled and consist of random stuff, like shapes and items and stuff.

Everything works fine. The extra step that I am attempting is that I want the user to be able to scroll through the clip, "click" on an item, and then that item zooms into the front center stage and plays a small animation about that item. These items that are found throughout the landscape are movie clips themselves with script on them to be recognized as buttons.My problem with that is even though the center of my stage would be x=400, y=300, since my mainMovie on the stage scrolls from left to right, when I put in code to tween the item to a center position, that position is only set to the inside of the movie clip and not the center of the stage. I need to center a movie clip within two other clips to the stage.An example of the path of any of those items would be sort of like,

[code]...

That didn't work. It shifted it to a different position, not being the center of the stage.At another point, I tried to fake it out, placing a movie clip of a red ball on the main timeline in the center of the stage, and changed my code to:

[code]...

This didn't work, either.I do have other code that affects the motion scroll of the mainMovie from left to right, but I don't think this is the problem, I could be wrong.

Posted: July 30th, 2007

View 2 Replies!   View Related
ActionScript 3.0 :: Flash Start At Center Of Movie Clip?
I have a movie clip container that contains 7 smaller movie clips, images converted to movie clips actually. This is a scrolling banner that can scroll left or right.

How do I start in the middle of this banner instead of the far left? That is, when the script first loads I want to be able to scroll left and right, not just right.

Posted: February 28th, 2011

View 1 Replies!   View Related
ActionScript 2.0 :: Center A Dynamically Generated Movie Clip On Stage?
I have created an empty movie clip in the root, I load dynamically some jpg to the empty movie clip, but now I want to center it and I can't I have this code, it centers the movie clip but on the registration point of 0,0 not in the middle of the movie clip so the movie clip will show up nice and centered.

ActionScript Code:
var stageL:Object = new Object ();
stageL.onResize = function () {

[code]....

Posted: 02-04-2009, 04:25 PM

View 9 Replies!   View Related
ActionScript 2.0 :: Change Center (rotational) Point Of A Movie Clip?
Is there a way to move the center point (rotational point) of a movie clip using actionscript?

Posted: May 21st, 2007

View 3 Replies!   View Related
ActionScript 2.0 :: Center A Movie Clip That Is Included In A Flash Popup?
So I am creating a photo gallery and in the process I have created a button that links to a movieclip and plays it to appear as a popup window of the larger picture.

on(release) {
attachMovie("gallery_mc", "window", 1);
window._x = 250;
window._y = 150;
}

I then included a close button that simply posts

on(release) {
this.removeMovieClip(window);
}

I am curious as how to make the movie clip popup centered in the screen as it is now popping up in the upper left hand side of the flash movie.

Posted: June 28th, 2010

View 2 Replies!   View Related
ActionScript 3.0 :: Click A Movie Clip And Get The Surrounding Movie Clips Name?
I am making a grid based game with movie clips of 4 colors. Till now I have completed to populate the clips on the stage randomly. I can trace their names like this

Code:
public function clickCard(event:MouseEvent)
{
var thisCard:Card = (event.currentTarget as Card); // what card?

[Code].....

Posted: November 24th, 2009

View 2 Replies!   View Related
ActionScript 3.0 :: Flash - Play Movie Clip With The Button Click Without Playing All The Movie Clips On The Main Timeline
I'm trying to make a flash website that has clickable buttons that will play different movie clips. But I dont know how to make it to just play the movie clip with the button you click without playing all the movie clips on the main timeline.

Posted: Apr 26, 2009 9:25 PM

View 1 Replies!   View Related
Click Though A Movie Clip?
Make it possible to click though a movie clip. I have a movie clip that's over top of buttons, but I need to access those buttons underneath so that those button are able to move to a different scene.

Posted: 05-05-2010, 11:15 PM

View 1 Replies!   View Related
Keep Center Of The Movie In The Center Of The Scree Regardless Of Browser Size?
My flash movie is 1440x900 but the area where all the important stuff happens in within 1024x768, i am trying to keep the middle in the center regardless of browers size or aspect ratio.

I can center the page but it doesn't work as i need it to. If the browers is small (1024x768) the swf is justified against the left edge, but not keeping the middle in the middle of the brower.

[URL] is an example of exactly what i am trying to achieve.

Posted: 03-23-2009, 09:14 AM

View 13 Replies!   View Related
Copyright 2005-08 www.BigResource.com, All rights reserved