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
Similar Posts:
Nov 27, 2011
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.
View 2 Replies
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
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
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
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
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
Feb 18, 2011
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;
View 7 Replies
Dec 14, 2011
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 ,
View 3 Replies
Jan 10, 2010
when i add my animation to library movie clip goes far from center, why is this happening and how can i fix it?
View 5 Replies
Mar 31, 2010
(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
View 1 Replies
Mar 18, 2009
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.
View 8 Replies
Jan 27, 2006
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);
View 2 Replies
Jul 20, 2010
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]....
View 5 Replies
Mar 2, 2012
how do I get a movie clip in the center of the stage, even if it moves to fullscreen
View 3 Replies
Apr 7, 2006
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;
View 7 Replies
Jul 30, 2007
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.
View 2 Replies
Feb 28, 2011
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.
View 1 Replies
Feb 4, 2009
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]....
View 9 Replies
May 21, 2007
Is there a way to move the center point (rotational point) of a movie clip using actionscript?
View 3 Replies
Jun 28, 2010
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.
View 2 Replies
Nov 24, 2009
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].....
View 2 Replies
Apr 26, 2009
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.
View 1 Replies
May 5, 2010
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.
View 1 Replies
Mar 23, 2009
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.
View 13 Replies
May 11, 2009
I have 3 images... I created 3 movie clips for each one (a_mc, b_mc, c_mc). It shows up as one behind the other, but what I want is to: click on the movie clip that is shown as the last one (or the second one) and have it appear at the front (a swap with the first) with a nice transition.
var mcA:Array=[a_mc,b_mc,c_mc];
for(var i:uint=0;i<mcA.length;i++){
mcA[i].addEventListener(MouseEvent.CLICK,f);[code]....
View 4 Replies
Nov 13, 2009
I found an old post from January that suggested saving the original image as an SWF via Illustrator. I tried it, but my clip is still registering clicks in transparent areas.
Here's a link. [URL]
All I'm trying to do is allow the drawing to be dragged around the screen, but I don't want it to be clickable in the transparent areas where the green background shows through.
how to eliminate the pale cast that the transparent areas are making? The background to the drawing shows totally transparent in Photoshop, but the boundaries of the movie are visible because the supposedly transparent areas of the movie are slightly masking the background.
View 7 Replies
Sep 22, 2011
I am doing some interactive file when i click a movieClip it should stop at frame 4 and when it is roll over it goto frame2 and when i roll Out it should come back to frame 1. But the problem is when i click a movie clip it should no roll out.
View 6 Replies
Aug 29, 2011
Is there a action script that can identify weather a loaded movie clip was clicked on?
View 4 Replies
Apr 30, 2009
i have made a movie clip so that you can drag and drop it with this code:
on(press){
startDrag(this,false);
}
on(release){
stopDrag();
}
thats all good, but i need a way so that after you release it and then click on it again it will move to a specific place on the stage,
View 9 Replies