Actionscript 3 :: Find Current Location Of Mc?

Jun 23, 2011

I'm trying to create a drag motion by using mouse_down then the mc = mouseX. Here is an image of the situation

But when I click, the mc always jumps to its registration point, which is the top left corner atm.

I can't work my head around how to grab the current location of the mc. Note that the mc (all_mc) is wider than the stage.

this.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
function mouseDownHandler(e:MouseEvent) {
this.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
}

[Code]....

Ok I kind of worked out the x location of the mouse in relation to the registration point of the mc (the registration is at the top left):

Math.abs(stage.x - all_mc.x) + mouseX

But how to I select that point of on the mc?

View 4 Replies


Similar Posts:


ActionScript 3.0 :: Current RemoveChild Button Location

Apr 8, 2010

I've got scrpt that switching movie clips inside container_mc and i want to add button inside all that movie clips that will remove current displaying movie clip. When it will be removed i want to be able to choose in navigation any movie clip to display. Here is my navigation script:

[Code]....

View 3 Replies

ActionScript 2.0 :: SwfObject - Passing Current Location In JSP?

Sep 25, 2009

We're seeking to pass current location within an environment to our SWF which is dynamically loading an XML file. Our movie is playing in a webSphere environment using (JSP). We need something that passes a value from the calling embed script into the SWF with either the swfObject embed code. It does not work without a literal path.

HTML Code:
<head>
...

[code].....

View 0 Replies

ActionScript 2.0 :: Overwrite The Current AttachMovie MCs With A New Set Of MCs At The Same Position And Location

Oct 4, 2004

I am using attachMovie function to dynamic attached MCs depending on the database. How can I overwrite the current attachMovie MCs with a new set of MCs at the same position and location after a click on a next button?

View 4 Replies

ActionScript 2.0 :: Floating/Moving Movieclip Within Bounds Of Current Location

Nov 8, 2010

I've creating a site that has a long horizontal line of fullscreen background images. Currently, moving the mouse left and right scrolls the images right and left.

I also have left and right arrows also for cycling through the images. I have several arrays with various bits of data about the images to help with the cycling. 1 array contains all the widths of the images Another contains all the x positions of the containerClips within image_mc.

The images are in a mc like so
mcholder.image_mc.containerClip0
mcholder.image_mc.containerClip2
mcholder.image_mc.containerClip3
....

mcholder is on the root.

What I would like to do, is instead of continuous scrolling left and right, I only want the user to be able to scroll about 20-30px past each image, (I'm guessing based on the current image_mc._x

When a user clicks an image it tweens into place and onComplete function stores the current image_mc._x value in a currentImageX var.

I'm not sure how to this to limit my left and right scrolling when not clicking.

My current scrolling code is this.

[Coe]......

View 3 Replies

Can't Find Location Of Customized Scrollbar In FLA?

Mar 19, 2009

I had the core of my site down for me, I believe in Flash 8 using AS2. I took over the site and attempted to learn everything that they did, so I could update it myself. The one thing that I can't figure out... is where they put the customized scrollbars they made for my site. There are some scrollPane components in the library, but I can't see where he put the custom scrollbars. The homepage link is here:The blue scrollbars are what I'm trying to find. When I add more content I want to be able to use the same scrollbars. If you need the FLA, I'll send it to you. I am pretty sure there is some default location that they're stored in though, and I'm just not seeing it

View 10 Replies

ActionScript 3.0 :: Find Location Of Image?

Oct 14, 2009

I downloaded a tutorial fla file and it contains 2 images of cars which seem to be under a folder called "bitmap assets" seen in the library panel. Now, since i have not created them, is there a way for me to somehow access them directly?

View 2 Replies

Flex :: Find Workspace Location Using ANT?

May 13, 2010

I'm working on a build script in the Flash Builder version of Eclipse. This build script needs to import launch configuration .launch files into the user's workspace. However there doesn't seem to be an available ANT var for determining the workspace location. While stepping through the available vars with intellisense I noticed that ${osgi.instance.area} does point to my current workspace but when I tried to echo it back in a running ant script it just spat out "${osgi.instance.area}" and not the path.

View 3 Replies

ActionScript 3.0 :: Find Location Of Element In Array?

Nov 4, 2010

given an arrayA = [a, b, c] and
arrayB = [a1,a2,a3]

by using array[0].name, it will return "a", is there any function that i can get the number "0" when i do something to "a" ?

I hope i make it clear here Xp

because i have 2 array here, i wanted to do something when the position of an element in an arrayA is same as the position of another element in arrayB.

for example
trace(array[0].name); -> output = A
trace(array[0].?????); -> output = 0

View 7 Replies

ActionScript 2.0 :: Find Out Current URL?

Jan 18, 2009

I've got two different domains and both of them direct to the same website. This website has a menu on top made in Flash (the rest is HTML, so the page must be reloaded everytime I click on an option or I need new content).

But this Flash movie has to show a different animation depending on the URL.

What can I do to find out the current URL in ActionScript?

View 2 Replies

ActionScript 3.0 :: How To Find Current MovieClip

Dec 7, 2009

I am creating a flash file to display products.
 
Product details and images are stored in XML File.
 
What i am trying to create is something similar to banner on [URL]
 
The addition to this is that products will be scrolling right to left automatically if there is no interaction from user, and product at the center will remain highlighted.
 
I have created a long strip of Products cover with a mask, the long strip keeps moving to give a scrolling effect.

View 2 Replies

Professional :: Find A Child's Location In Parent's Coordinate Space

Jul 21, 2010

I've created a map of Montana counties. Each county is a seperate MC withing the larger parent clip (allcnt_mc). When a county is clicked on, I'd like to center that county on the stage and zoom to its extent. The challenging part has been telling the parent (allcnt_mc) where to tween to. Since each individual county is a child of the parent, they have their own coordinate space referencing that of the parent.

Is there a way I can query the location (x,y) of a child in the parent's coordinate space? With this number, I could calculate the distanct between the parent's current reg. point and that of the child, indicating the distance that the parent would have to move to be centered on the stage. I was trying to use localToGlobal but could not figure out how to use it.

[Code]....

View 8 Replies

ActionScript 2.0 :: Find Current Level Number?

Nov 6, 2010

I need to trace the current level number that I am working on. So say I have 3 swf's loaded onto different levels (_level0, _level1, _level2, _level3), and each has a button, so when I press the button in level1, the number will trace 1, press button in level2, number will be 2, etc.

View 1 Replies

ActionScript 2.0 :: Find A Way To Highlight Current Thumbnails?

Dec 7, 2007

I wanted to find a way to highlight current thumbnails, and I successfully did this by using the tutorial in the archives found here

My question is, when the thumbnails FIRST load and the first image is loaded, how can I get the first thumbnail to already be highlighted? Here is what I've tried and cannot figure out why it isn't working.

in the firstImage function, I added this:

[Code]...

View 1 Replies

ActionScript 3.0 :: Find Out Current Page Url From Embedded Player

Jun 14, 2010

How to find current page url from flash without calling javascript function. I was trying to get the url of the current page where my player has been embeded. I wrote this function.

function getCurrentUrl():String{
var Url:String = ExternalInterface.call("function get_url(){return document.location.href;}");
return Url;
}

This function works in firefox and chrome but doesn't works in IE.

View 0 Replies

ActionScript 3.0 :: Find The Current Frame Of The Main Timeline

Jun 12, 2011

I want to find a way to get the number of the current frame of the main timeline using code in the timeline.

So like in frame 10 of the timeline I put in some actions. I want to make a variable that gets the number of the current frame so I can use it later.

Something like this:

ActionScript Code:
var framenum:uint = currentframe;
gotoAndStop(framenum + 3);

View 1 Replies

ActionScript 2.0 :: Use The Var ClipName To Find The Location Of Each Movie Clip Found On _root In The Next Line?

Jan 20, 2005

// code to find out all the movieclips on _root
for (var property in _root) {

if (typeof _root[property] == "movieclip") {
var clipName = _root[property]._name;

// I am trying to use the var clipName to find the location of each movie clip found on _root in the next line

//the next line gives me "undefined" why?

clipBounds = [clipName]getBounds(_root);

}
}

View 2 Replies

ActionScript 3.0 :: Find Nested Movieclips Current Position Relativ To Stage

Oct 6, 2009

I have a movieclip, which attaches to another movieclip, which scrolls.On click I want to be able to drag that movieclip away from the one it was attached to. When I just removeChild it, it's position changes. I want it to stay in the same spot until it's dragged.Any suggestion, on how I can give it that same position, when not attached?

View 1 Replies

Actionscript 2 - As2: __FILE__ Equivalent In Flash - Find The File Name Of The Current Running Application?

Jan 13, 2010

i wrote an swf application using action script 2,i want to be able to know the file name of the current running swf file.i know that in php i have __FILE__ to get current running php file, is there something like that in flash?

View 1 Replies

Professional :: Incorporate "find A Location" Functionality Using The User's Zip Code?

Jan 27, 2010

I'm currently working on a project where I want to incorporate "find a location" functionality using the user's zip code. Basically, the user needs to be able to type in their zip code and once they hit the submit button, they are then taken to a page where it lists all locations available. Mind you, the website is ALL Flash. Currently, it's in ActionScript 2.0, but I could (at least with these pages) convert to ActionScript 3.0 if needed.

View 8 Replies

ActionScript 3.0 :: Memory Monitor That Allows To See The Memory Leaked And Find Its Location?

Sep 26, 2010

I have an FPS monitor running and notice that I am getting choppiness here and there, bringing my game from 40 to 27 fps and back and forth at certain stages. I have an idea of where it is happening, but do not know for sure. I looked up quite a few memory monitors but haven't found anything decent yet. Is there a memory monitor that allows you to see the memory leaked and find its location? If not, how about just he memory leaked?

View 4 Replies

ActionScript 1/2 :: Make An Object Tween From Its Starting Location To The Location Of A Mouse Click?

Apr 27, 2009

I am trying to make an object tween from its starting location to the location of a mouse click. I have a script, but it has a very annoying ease to it.I would LIKE the object to mantain a certain speed during while traveling from its starting location to the mouse click location.

View 16 Replies

Professional :: Button File Opens In Saved Location / But Won't Open In New Location

Aug 21, 2011

I created a simple button that displays an error messeage: "error opening 'url" when I test the movie, but does play and opens in browser after publishing. However, it won't open in the browser in a different location. I pasted the html code in a web page but it doesn't work there nor opens in the browser in a differnet location from where it was originally published and saved. Why is that?

View 13 Replies

ActionScript 2.0 :: Move MC From One Location (x / Y) To Another Location

Feb 16, 2005

How can I move my MC from one location (x, y) to another location (x1, y1) wirh action script..?.. and I would like to have my motion tween rounded to (x,y) so it will look sharp.

View 8 Replies

Media Server :: Find The Find PStreamName In Access Plug-in?

May 18, 2010

I must rejected all users outside Denmark from our live streaming (c-ip) and this is done in an access plug-insBut now I need to open up one of the streams, but I can't get the streaming name in the access-plug-ins only in the Auth-plug-ins.I cant use x-page-url or s-uri I need pStreamName. in access-plug-in like thissetStringField(m_pAev, IFmsAuthEvent::F_STREAM_NAME, pStreamName);but I cant get it inside  the access-plug-in

View 1 Replies

Accessing A Location In One SWF From Another SWF?

Jul 11, 2009

I have a series of swfs that I've connected via loadmovie. This works well with I press the NEXT button, but not the PREVIOUS button. The PREVIOUS button starts at the beginning of the called movie. I need it to start at a specific location. Is that doable? If yes, how? I tried adding the gotoandplay after the call to the swf, but no luck.

View 2 Replies

Get Location With Flash?

Oct 28, 2010

is it possible to show my Town (find by IP) / Town of my Provider in Flash File?

View 2 Replies

ActionScript 2.0 :: CSS Var Location?

Sep 12, 2004

How do you change this code so that it works when the swf timeline its on, is loaded into a movieclip on a main swf stage (_root.loadarea)It works fine on its own but dont when loaded into the loadarea mc.

Code:
var format = new TextField.StyleSheet();
var path = "http://www.kirupa.com/developer/mx2004/code/flash.css";
var quick = "<br><p class='one'>The quick Kirupa jumps over the lazy dog.</p>[code]..........

View 2 Replies

XML Location Change In Flash?

Mar 26, 2009

I have a flash file that calls a XML file to give it commands, such as color etc...

I want to change the name of the XML file, but am not sure how to change it in flash so that the SWF knows where to find the XML.

View 2 Replies

XML Loading Variable Location?

Jun 15, 2010

I have been working with xml sheets to load a menu and in order to load a submenu or to go to a submenu of a submenu, I was wondering if it is possible to load a variable location for an xml.

For example, if I had the variable xmllocation which was a string that said where in an xml a certain menu was, is it possible to use the xmllocation variable for something like this:

( if xml.xmllocation.length() > 0 ) do something;

whenever I tried messing around with it, it would actually go to look for "xmllocation" in the xml instead of check what the string is. So what I guess I am really asking is, is there a way to tell it not to be so literal?

View 2 Replies







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