Local To 'other' Local Coordinates
Hi, I have a clip with twenty points in it.
I am trying to do a point hit test with these and a shape a few clips down - but nowhere near the _root.
I have used local to global before but would really like to just see what the coordinates would be on the other clip.
?? Cheers, M@)
Ultrashock Forums > Flash > ActionScript
Posted on: 2003-11-14
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Coordinates Local To Global
I'm trying to figure this out. Maybe one o fyou could help me.
I have a MC that has a 20 x 40 square in it. Its top left corner is the 0,0 point of the movie clip and its bottom left is at 0, 20.
Now if i place this clip on the stage say at 300, 300. Then the locs read as follows.
mcBox._x = 300
mcBox._y = 300
mcBox.TLC._x = 0
mcBox.TLC._y = 0
mcBox.BLC._x = 0
mcBox.BLC._y = -20
Now what I want to do is during movie runtime is to Click a buttom that will make a new instance of mcBox called mcBox1.
On doing so I want to snap mcBox1.TRC._x&y to mcBox.TLC._x&y AND mcBox1.BRC._x&y to mcBox.BLC._x&y.
How can I access the local points or somehow convert it all to a single coordinate system? Not all my ojbects are square. So I highly need to rely on the points TLC, BLC for alignment. Not just the outer boundries of the clip.
Hope I've explained it enough to get some input.
TIA
Firehawk
AS1: Local To 'other' Clip Coordinates
Hi, I have a clip with twenty points in it.
I am trying to do a point hit test with these and a shape a few clips down - but nowhere near the _root.
I have used local to global before but would really like to just see what the coordinates would be on the other clip.
?? Cheers, M@)
Confused About Local And Stage Coordinates
Hello,
I'm trying to make sense out of the coordinate system. Here's my code:
Code:
package
{
import flash.display.Sprite;
import flash.events.Event;
import flash.events.MouseEvent;
public class Main extends Sprite
{
private var circle:Sprite;
private const RADIUS:int = 40;
public function Main():void
{
if (stage) init();
else addEventListener(Event.ADDED_TO_STAGE, init);
}
private function init(e:Event = null):void
{
removeEventListener(Event.ADDED_TO_STAGE, init);
// entry point
circle = new Sprite();
stage.addChild(circle);
circle.graphics.beginFill(0x439391);
circle.graphics.drawCircle(300, 300, RADIUS);
circle.graphics.endFill();
circle.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDown);
circle.addEventListener(MouseEvent.MOUSE_UP, onMouseUp);
}
private function onMouseDown(event:MouseEvent):void
{
trace("
Mouse down");
trace("Local x: " + event.localX);
trace("Local y: " + event.localY);
trace("Stage x: " + event.stageX);
trace("Stage y: " + event.stageY);
circle.startDrag();
circle.addEventListener(MouseEvent.MOUSE_MOVE, move);
}
private function onMouseUp(event:MouseEvent):void
{
trace("
Mouse up");
circle.stopDrag();
circle.removeEventListener(MouseEvent.MOUSE_MOVE, move);
}
private function move(event:MouseEvent):void
{
trace("
Circle x: " + circle.x);
trace("Circle y: " + circle.y);
}
}
}
event.localX and event.localY always print a values within the area of the orginal circle, as if the circle is always centered at (300, 300). In addition, circle.x and circle.y print values relative to the circles original position, even though the documentation says the x value is relative to the parent object, which is the stage. Therefore, I get negative values if the move the circle towards the left.
Is there a method/setting for getting the sprites coordinates within the stage?
Converting To/from Local Coordinates In 3D Space
I'm having trouble moving things on stage in AS3 3D space.
First, shouldn't the following yield a vector 3D that is identical to the first? It doesn't work for me (this line seems pointless, but I was using it as a test, since the next bit of code doesn't work I was trying to find out why)…
Code:
var v3out:Vector3D = this.globalToLocal3D(this.local3DToGlobal(v3in));
Second, if I want to move something 10 pixels to the right (in global coordinates) on stage, how do I do that? I tried the following, but it doesn't work:
Code:
public function move():void {
var v30:Vector3D = new Vector3D(this.x,this.y,this.z);
var pt0:Point = this.local3DToGlobal(v30);
pt0.x += 10;
var v3:Vector3D = this.globalToLocal3D(pt);
this.x += v3.x;
}
Lastly, if I want to set the object at a specific global x/y in the class constructor, would the following be the right way?
Code:
public function Puppet($tweenDest:Number,$delay:int,$repeats:int,$timeBase:int, $timeStart:int,$timeWidth:int,$v3d:Vector3D,$tweenTime:Number, $speed:Number)
{
super();
this.z = $v3d.z;
var pt:Point = new Point($v3d.x,$v3d.y);
var v3:Vector3D = this.globalToLocal3D(pt);
this.x = v3.x;
this.y = v3.y;
....
Thanks!
Local Runtime Sharing? Local External AttachMovie?
I've been trying and searching through the forums but I think I am searching for the wrong keywords.
Is there ANY way of setting it up so that I can use attachMovie/removeMovieClip on external swf's? I've found these runtime sharing options but I am unable to make much sense of them. What I am creating is something that would always be run locally on a machine and not up on the web.
I want to use this one main 'engine' type of file that loads heaps of different movies into it. All of them swf's. Of course I realise that I could do things the loadMovie way, but it seems in this case like an option not really suitable for what I want to do.
Thanks for any tips
Launching A Local Html File From Local Swf ( Flash 8.)
Hello everyone i am having a problem launching a local html file from my swf. i have a button called print that when clicked it is supposed to open the local html file and print out the content. this is the code i used on the button
on (release){
getURL("folder/folder/file.htm","_self");
}
i also tried scripting it on the time line when that didn't work.
any ideas?
Thanks,
kool
User Defines Local Image And Add It To A Local Swf(CD) ?
I have to run flash (swf) locally, which in my case means a CD.
What I want to do is allow the user to have a browse (local) function and pick an image from his hard disk and use that image to see a flash movie (swf) with his/her selected image in it!
Then after the user watched the movie with his/her photo on it, the user should be able to send this movie in a site(upload it). then naturally the user should be able to see it online at that site as well!
So my questions are how to have a browse function that puts the selected image somewhere I would like it to and then use this image in a flash movie (that will be a game with the photo on it).
And I guess then to send it online I do not really have to publish a new swf with the image in it, I can send seperately the swf (game) and the image file to the server through php? Did i get that right?
So far I know flash 8 has a new class for browsing, but how do I take a file selected from a user locally and use it in the movie again locally? load variable can do that but I should know the name of the file selected and also be possible to even select a local file??
Basically it is for educational movie. It will run from a CD. there will be many interactive exercices. At the end of the section there will be one game that in order to make it more personal I want to allow the users to add their photo at the game. So far everything should take place locally. Then if the user desires should be able to send in a specific site the movie he/she just watched(which means with their photo in it).
ANy ideas how I do that.
Even general ideas will help!
Thank you
Problem With Local File And Local Link
Hi to everybody,
I have installed a new version of flash player (9,0,28,0) and when I open a local file like:
c: estindex.html
When I click into some link that point to some local file like as:
c: est est.htm
I don't obtain nothing the page still remain index.html.
If i put the test directory into some server everithing working fine.
I have tried to change some machine and i have tried some old flash file but still the same!
How can solve it without upload all file everytime into some web server and without install some local web server?
Thanks in advance to everybody for any tips and sorry for my bad english!
John
How Can I Get A Local Path Of The Local Disk With Swf
Since FileReference.download() doesn't download multiple files, I want to download files with php ftp_get by FTP.
I need to pass the local path of the local disk where I can download the files from a remote serveur. How can I get a prompt to have a user choose a folder on his computor (local disk), if any way possible?
Local Exe Can't Load Local Swf's Into It?
Hi!
I have created a presentation with Flash that has an exe file which loads swf files to it with loadMovie command.
Some of our clients have had problems with this. They can execute the exe file fine, but it doesn't load any of the swf's or other external files into it. All the files are local on users computer on the same folder.
At some computers this works fine, so it seems like it is some sort of security thing that an exe file cannot load anything external to it. Has anyone had similar problems?
-sumo-
Local Time Of My Country And Local Time Visitor
Dear all,
For a client's website in Holland, I would like to display the current Dutch date and time and I want to show for instance American visitors their local time.
Could anyone help me by providing the code for the Dutch time (as I know how to display the local time of my visitors)?
Thank you very much!
Michiel Schenkius
Cgi - Local
Hi All,
Can somebody explain the meaning and use of cgi-local and how can i make a form in flash which contains information like survey. Can somebody tell me how to do it pls. Please explain this things (if possible treat me as a new flash user and dont know the cgi-local and form thing)for me.
Local So Help
hello i am useing shared objects and i would like to tranfer info in between two different files. i beleive it is in the call up function and not finding the right file because thery are named different but are on the same level on my web page. i am using this function to call up the SO
accessSO = SharedObject.getLocal("mycookie")
this works great to save with the same flash file but i can't get it to work with different ones.
macromedia says it stored them by what the file is saved as but how would i open one that is not what the file name says.
well hope you guys understand. thanks. Pat
Local Url... Sorry But I Had To Ask
Ive made a MC which loads another MC when pushing a button. And it works fine when it is on my computer, but when i put on the internet it won't work. I'm using this command:
on (release) {
_root.hm.txt.gotoAndStop(10);
loadMovie("shootteacher.swf",0);
}
my site is in danish but here it is:
http://www.myg-ind-heaven.suite.dk/d...hjemmeside.swf
Local To Global Example For D/l
I made a quick example for n8w over at Were-Here, who was asking about this. I know it's pretty straight forward, but if it helps anyone, you are welcome to d/l it. It's in the downloads section (duh) at:
http://www.developette.com
hope it helps someone...
Local And Global
hi...
can someone explain me the diff. between a normal variable & a variable created by var
i mean:
a = "name"
var a = "name"
i understand that its a local variable but wats the scope... the guide says its lasts in curly brackets only...
but can we use them across the frames...? on one timeline... or what...?
slightly confusing... i only use var for variables in loop like For (var i=0; i<=10; i++)
thanks
arpit
Local File In Pop-up
Just figured out how to launch a pop-up window, but how if I need to load a local file (say in a CD-ROM)? Flash seems can't recognise the path.
Load Local PDF- On Mac
Hia, tricky one here and cant find any reference to it anywhere online.
Just used the ftoolapp.exe method to open a local PDF on windows machines, brilliant- but now need the equivelant for the macs like yesterday-
anyone know of a sloution to opening a local pdf thru flash on a mac??
cheers
jon
Detecting On Web Or Local
Hi there,
Is there a way to detect the swf be launched on Web or Local...
I am going to add a exit button for my flash video...
If it has been launched on Web I should use java script for EXIT button
If it has been launched on LOCAL I should use Fscommand for EXIT button
Any suggestions?
Cheers
About Local Connection
Can the parameters sent to the receiving side a function? I tried to send an object to the receiving side, but it seems that only properties of an object are sent. Is there any way so that I can send both the properties and method of an object to the receiving side?
Thanks.
Local Connection?
Hey guys,
Can anyone here explain how to use local connection. the explanation on Macromedia was very useful as it only showed how to transfer text fields. How do i send a variable from one movie in one html file to another movie in another html file. Thanks guys
Local To Global Help
I attach a movieholder clip on the stage. And in the movieholder clip i attach another movieclipA. how can i get the stage coordinates of the movieclipA?
Works Local But Not On The Www
hi,
I have school.swf file where i call a extra swf (calander.swf) It is calling some xml stuff. It works perfect on the local pc and preview in dreamweaver. But when I upload it it is not working. The
loadMovie("calendar.swf", "_level0.mc_loadCal");
works perfect in the school.swf. (local and on the net) But the monhthly news (that is the part what is not working) is not working on the net anymore.
this is to call the monthly news;
//_level0.dispNews(_level0.mc_loadCal.MyNewMonth);
NewsDate = new Date();
NewsMonth = NewsDate.getMonth();
_level0.dispNews(NewsMonth);
function dispNews(monthID) {
txt_monthlyNews = "";
txt_monthlyNews.scroll = 1;
Somebody has a idea. (it is a little difficult to descripe the problem) When you guys need more information...... here is the link where you can see the problem;
school.html (leftupper side there normally shoot be the monthly news stuff)
Local Application
Hey all,
I had an idea, and am wondering if I can get some input on how it would be done.
I want to make an application that my customers/visitors can download to search my online database for parts for their cars. Can Flash MX communicate to a DB via an .exe?
I would appreciate any help!
Local Paths
Here's my current problem.
I have a webpage that loads my .swf file from the same path and it works fine.
however, i have an option so that users can download the .swf to their local PC. now, when i specify to load it from their local pc (eg: value="c:/path/file.swf") it simply will not work.
i know that it used to work some time ago when i used Flash5, but not that I'm on FlashMX i cant get it working again.
Any ideas??
Local Connection
Hello all, I was wondering how to use Local Connection between two popups and have them interact together "on the fly".
An example of this is at www.microbians.com. On the first menu system, select Drag Across Windows (Win.IE). If you have any ideas on simple things like this...care to share?
Sharedobject, From Local To Cd
Hi,
My client has a flash which shows his pictures on a cd (his book). He can update the cd byhimself through a control panel that store variables in a sharedobject.
Then he copy the files (swf+jpegs) to a cd... and of course the sharedobject file do not "follow".
My question is :
How to make a sharedobject created and updated locally to "work" when the the same swf is copy on a cd?
Is it possible? If not, has someone an idea to make it?
For security reason, I do not want use a text file...
Thanks
Local Variables
I'm using the local variables actions in flash MX works great...My only pitfall is if the end user moves the file from folder to folder the local vars can't find the flash movie ... is there a way around this... also is way to save .txt files from flash on the harddrive?
thanks
Linking To Local Url
How do I load a movie from another movie... they're in the same folder... I could do it like
geturl("www.something.com")
but it would be better if I could do it like
geturl("this folder/ flashfile.swf")
Please Help
Hashmus
Local MC Quality
I thought it was possible to change the quality of one MC without changing the quality of the entire movie, but I can't get it to work. I want to do it because for this one MC, it looks almost identical on low quality, but it runs much faster. I just told it onClipEvent(load) { this._quality="LOW"; }, but it turned the quality of the whole movie down. Is it impossible, or am I just doing it wrong?
Local To Global ?
Hello,
I am trying to track the position of a movie clip inside a movie clip and convert the coordinates to another movie clip on the main stage. Basically, the localToGlobal function....
Code:
onClipEvent (enterFrame) {
_root.trackx = _root._xmouse;
_root.tracky = _root._ymouse;
localX = _root.dart3.anim3.hit3._x;
globalX = _root.dart3._x;
_root.darttip3 = _root.dart3.anim3.hit3._x.localToGlobal(_root.dart3._x);
}
dart3 is on the main stage. I am trying to convert the coordinates of _root.dart3.anim3.hit3._x to the global coordinates of the stage, or MC "dart3". Why wont this work? Any suggestions?
Regards
~GD~
Non-local Xml Feed
Okay I have a file in which some vars are loaded from and external xml feed. It works perfectly on my local machine, but when I upload it to a webserver(not the same server the feed is on) it no longer loads those vars. I've heard before that this problem exists but I do not know how to correct it. Do I have to draw those vars in PhP then put them back into an xml file on the same server as the swf file?
Please help.
Herk
Local Connection
hi,
I read some old forum replies and tried to get this thing
running but it wont work,can someone tell what the problem is,
file attached,
thx in advance,
Ricky.
Local Connection
hi,
I read some old forum replies and tried to get this thing
running but it wont work,can someone tell what the problem is,
file attached,
thx in advance,
Ricky.
Local Connection
hi,
I read some old forum replies and tried to get this thing
running but it wont work,can someone tell what the problem is,
file attached,
thx in advance,
Ricky.
Pop Ups Work Off Of Local
my pop up windows dont seem to be working anymore. But yet it works off of my machine locally, but when uploaded it doesnt work. This is the code i have on my buttons. It worked before, not sure why its not now? Could it be the new flash player?? If i just type in the url, it works fine, but it doesnt work off of the buttons anymore? very strange.
on (press) {
getURL("javascript:NewWindow=window.open('http://mysite.com/username/picture. htm','newWin','width=1024,height=768,left=0,top=0,
menubar=No,toolbar=No,location=No,scrollbars=Yes,s
tatus=No,resizable=Yes,fullscreen=No'); NewWindow.focus(); void(0);");
}
TellTarget To Non-local MCs
I could work much faster and efficiently if the tellTargets I script would work on non-local movie clips. I don't mean non-local as an external .swf, but to tell a targeted movie clip within a DIFERENT movie clip, to perforn an action.
Sorry hard to explain. But if you do understand you feel my pain. Is this possible? I don't understand why it isn't possible. Instance names are unique.
Please Help!
Thanks in advance!!!
Local File
Hi this is kind of a repost, so apologies but i am still having no luck with opening a local PDF file from within flash.
I use an on release get url action that opens a plank document, i link the url to the directory that my PDFs are stored but nothing happens?
Can anyone help? Thanks again.
Local Connection Help
I think this is a case for local connection but I've never used it before so the title of my post may be inaccurate.
My page has flash navigation that loads in via load.swf
I have load.swf loading in nav.swf.
I need to set a cookine so that when the user hits the back button, nav.swf is present and load.swf is no longer there.
Any ideas???
Thank you very much!
Pete
Local Connection
hello people,
is there anyone knows how to use Local Connection and Passing Variable?
i have a sound file named A.swf and a menu named B.swf
I want to stop(fade out) the sound when menu button clicked(popup) and play(fade in) sound when popup closes.
*i'm setting up the stop sound part..looks like the localconnection is working but when button clicked.. the sound has to repeat (overlap!) in order to fade out..
how can i prevent it?
Local Connection
Hey guys, I have been playing around a little with the flash Local Connection. Right now I just have a simple animation where a ball travels from one window to the other. It works fine except for one thing. As best as I can figure, it should be looping continuously until I close one of the windows, but it isn't. Sometimes it will loop once, but most of the time it plays through, then stops. I was just wondering if anyone has any pointers as to where I am going wrong. I have attached the source file below.
Thanks,
~Steve~
Local Directory App
I am building a little Flash application, that is going to be used on local machines (not the web). I want to be able to dispaly a local directory on the hard-drive and display the files in a text-field. I need to do this without the help of a serverside script, becuase it will all happen locally. Any ideas?
Thanks in advance.
Local Connection
I have a flash website that requires user log-in. Once logged in, you can take "lessons" which open in a pop-up window. I'm using the LocalConnection to pass variables from one movie to the other. It works most of the time, but we've had some problems with reliability. It seems to work flawlessly on our highspeed network, but on DSL outside of our network it sometimes works and sometimes doesn't. Does anyone know of any issues with the LocalConnection as far as reliability or any suggestions to test? Thanks!
Local To Global I Think?
I'm in the process of making a very simple golfing gaming. I am having trouble in getting the ball to fall in the hole. The hole_mc is within the pgreen_mc. The ball_mc is on the root. I need to get the hole_mc _x and _y so that I can make it equal to the ball_mc _x and _y. I just can't get it to work. I think it has to do with the fact that the hole is inside the putting movie. This is what I have done so far and it's not working. Any ideas?
if(pgreen_mc.hole1_mc.hitTest(ball_mc))
{
point = new Object();
point.x = pgreen_mc.hole1_mc._x;
point.y = pgreen_mc.hole1_mc._y;
localToGlobal(point);
ball_mc._x = point.x;
ball_mc._y = point.y;
}
Web Cam Local Save
hi can some one help me i need to save local webcam video+adio
in swf attachvideo0 local cam whit out streamig server please help
Local Connection ?
Question regarding local connections... i need to relay information from one swf to another, and this works fine when i preview it locally, but when i view it online, the variables don't get passed through consistently. it seems to work only a small percentage of the time.
I'm wondering if anyone else has come across any issue like this and how they solved it?
any help would be greatly appreciated.
thanks!!
Local Variables?
hi all!!
im stuck on somthing so easy - grr!
i have my main movie wich loads another swf file into it. in that swf file i have a text box and a button, when i click the button i need it to display "hello" in the text box. my problem is i cant use its _root address.
would it be something like this?:
_local.mc.myText = "hello";
thanks
Local Connection AGAIN HELP Please
Sry I have asked alot about this subject but I just cant get it. I need to use the local connection class to have to 2 buttons in one projector go to the next and previous frames in a movie clip in another projector.
I need your help!
XML - Local Vs Online
My XML seems to be loading in when I test locally, although won't for some reason when I load it up online.
Code:
quoteXML.ignoreWhite = true;
quoteXML.load("http://www.quotedb.com/quote/quote.php?action=quote_of_the_day_rss");
quoteXML.onLoad = function(success) {
debug.text = "XML: "+success;
if (success) {
}
};
http://www.fireflyinc.com/index_dev.html
You can see that it's not pulling the XML, although when ran locally, it does so correctly. Any thoughts? Server side issue?
|