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




Cursor Thing



How do i get a movieclip to go from the cursors postion to a point on the flash movie



FlashKit > Flash Help > Flash ActionScript
Posted on: 04-18-2002, 02:35 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Cursor Thing Again...heh...
Ok, even though the code is right...
my prob is, that when i drag an object... i lose control of the cursor and it stays where the dragable object used to be... Dunno if u understand what i mean, the cursor works fine till i try to drag an object, i get to drag an object, but the cusor movie stops beeing draged, i think thats because the cursor is beeing draged to... and you can drag 2 objects at the same time... am i right?

If not, i would appreciate your help on this.

thanx

Cursor Effect, Trail Kinda Thing...
Hey,

How do you accomplish the effect used on the cursor of this site:
http://www.2dmax.net/

I've seen it on many others, cept they all use a different image for the cursor.. all the same effect though.

Ian

Cursor Move Dpad Type Thing Help
hiya,
i posted this in games because i am working on a game but i thougth it might be more general help required so i am sticking it here as well:

mouse cursor attach thingee

HIya,
need some help here with a thing i am trying to get my brain around
Basically what i want to do is make the mouse into a pointer finger, which i am able to do by making it a custom cursor, so thats not a problem. The tricky bit is; i want the user to be able to operate a switch that has multiple states. i.e. the finger moves over the switch and the user can move the finger up and make the switch move up, move the finger (cursor) down and make the switch move down, etc. But also they can press the mouse button and the finger presses the switch down. I already have all the graphics prepared and the mouse press is easy, buti am having difficluty working out how to attach the switch to the cursor move so that it moves on roll over. Any help appreciated.
It's a gamepad sort of thing and the thumb cursor needs to make the switch react underneath as it moves over it and depress when you press.

exaple to show what i mean:

********How Do I Make A Custom Cursorpick Up Thing Without Losing The Cursor?********
In my game, I have a custom cursor. To pick up objects, you drag them over this mc "inventory". To use them again, you drag them out. But when I pick up an object, the cursor stops dragging? why is that? How can I drag both things?

Making A Thing Any Of Which Will Interact With Any Of Another Type Of Thing
Well i know that title was a bit vague but heres what im trying to do, ive been larning to use flash for the past couple weeks, I'm using flash MX, i am expeirienced in other programming languages. What id like to do is to make an object, in this case a turet, which has code in it and can be duplicated, i know how to do that part, but, i want to be able to make it and copy it, and also have an enemy i can copy, a zobie, and have any of the turrets shoot at any of the zombies that get close. They cant all be pre scripted with eachothers names because i want to be able to create either after the program starts.

Basically, the zombies come out all over during the program and the player clicks where he wants to put turrets and those turrets shoot at whichever zombie is closest to them. Im sure its not that hard, and probably would involve arrays, but since im still learning how flash works im not sure how it can be done. Any help is apriciated, thanks. While i wait for a reply I'm going to read some more on how arays work in flash since i think they may be the answer.

Thing Thing Arena Type Game.
I want to make a shooting game, but I had a question first. How can I make the hand follow the cursor constantly, but never leave a restricted area? I would like to know how, thanks.

Flash Script - Cursor Trick 1: Cross Hair Cursor
This is a dedicated thread for discussing the SitePoint article 'Flash Script - Cursor Trick 1: Cross Hair Cursor'

Flash Script - Cursor Trick 3: Cursor Tracking Effect
This is an article discussion thread for discussing the SitePoint article, "Flash Script - Cursor Trick 3: Cursor Tracking Effect"

Cursor Speed And Direction Math To Jump Cursor
Looking for a little help.

I have a project that implements a jump type of desktop mouse interaction. Basically what this does is ...when the user moves the mouse, if moved fast enough (beyond a set speed threshold) the mouse jumps a predetermined amount in the direction the mouse was originally traveling. So I've tried to break it down this way.

First I need to calculate the speed. Based on the below code I can calculate speed on x and y axis but not sure how to evaluate overall speed as a function of both together.


Code:
attachMovie("mouseMC","mouse_mc",1000);
mouse_mc.onLoad = function() {
Mouse.hide();
};

var vxMouse:Number = 0;
var vyMouse:Number = 0;
var xi:Number = _xmouse;
var yi:Number = _ymouse;
mouse_mc.onEnterFrame = function() {
vxMouse = _xmouse - xi;
vyMouse = _ymouse - yi;
xi = _xmouse;
yi = _ymouse;
_root.speedX =vxMouse;
_root.speedY =vyMouse;
_root.cordX =xi;
_root.cordY =yi;
setProperty(this, _x, _root._xmouse);
setProperty(this, _y, _root._ymouse);
updateAfterEvent();
};
I have also added some code to provide a cursor trail.

Code:
onClipEvent (mouseMove) {
if (i >= 100) {
i = 0
}
i++;
this.duplicateMovieClip("flare"+i, i+10);
_root["flare"+i]._x = _root._xmouse;
_root["flare"+i]._y = _root._ymouse;
}
onClipEvent (enterFrame) {
if (this._name == "flareMC") {
_visible = 0;
} else {
this._alpha -= 5;
this._rotation += 2;
this._xscale -= 5;
this._yscale -= 5;
if (this._alpha<=5) {
removeMovieClip(this);
}
}
}
The next part is to evaluate the direction. Now I have done this in reference to a set spot MC using the following code accept that it doesnt update as the mouse moves therefor its only provides the direction from the starting point. Is there a way to update this on the fly as the mouse moves.

Code:
onClipEvent (mouseMove) {
//mouse angle code
x = this._xmouse;
y = this._ymouse*-1;
angle = Math.atan(y/x)/(Math.PI/180);
if (x<0) {
angle += 180;
}
if (x>=0 && y<0) {
angle += 360;
}
_root.angletext = angle;
updateAfterEvent();
}
Thirdly once I have the the speed and the direction how to I go about jumping the mouse distance x in the direction the mouse was moving?

I hope I explained this well enough...if not please shooot me some questions. Any help would be greatly appreciated.

Hand Cursor Turns To Text Cursor Over Button
if you goto the action section and then click the 13th from the left. ( kris foley) the hand turns to a text thing.

I'm not sure whats going on.

Thanks

http://www.ryanhamiltonphotography.com

Custom Cursor To Return To The Regular Mouse Cursor
How can I get my custom cursor to return to the regular mouse cursor when in the bottom 3rd of my flash movie. I need to do this for nav functions and I want the regular cursor actions in this area. So to recap: within the top 2/3 of the movie I will have my custom cursor, upon entering the bottom 3rd of my movie I need the cursor to switch back and vice verse...

my code below, please any suggestions are very helpful as I have tried several things:

stop();

import flash.events.Event;
import flash.events.MouseEvent;
import flash.ui.Mouse;

Mouse.hide();

stage.addEventListener(MouseEvent.MOUSE_MOVE, moving);
function moving(evt:MouseEvent):void {
if (cursor.currentFrame != 0) {
cursor.gotoAndStop(1);
}
cursor.x = stage.mouseX;
cursor.y = stage.mouseY;
cursor.mouseEnabled = false;
evt.updateAfterEvent();
}





//These three eventlisteners are telling flash to "listen" for specific events
//in our case if the mouse moves and if the mouse button is down or up.
//then if one of these events happens, it calls a function (mouse_down, mouse_up or moving).
stage.addEventListener(MouseEvent.MOUSE_DOWN, mouse_down);
stage.addEventListener(MouseEvent.MOUSE_UP, mouse_up);


// This is how to construct a simple function,
// this function will write in our text field "mouse is moving"
// when the even is raised by the eventlistener

// function just like above, just for the mouse down event.





function mouse_down(e:MouseEvent) {
if (mouseX < 800 && mouseY < 450) {
timer.start();
timer2.start();
}
}

// function just like above, just for the mouse up event.
function mouse_up(e:MouseEvent) {
timer.stop();
timer2.stop();
}

Thanks again and help!

How Do You Get The Hand Cursor? Not The Finger Cursor
how do you get the hand cursor with all 5 fingers spread out, and when u click down the hand looks like it grabs the object.

thanks

MC Follows The Cursor. How To Restrict The MC Movement And Not The Cursor?
I am trying to make something similar to this idea but my MC has a couple of buttons that follow the standard cursor - which is not hidden.
The movieclip movement is working by using:

Code:
onClipEvent (enterFrame) {
this._x += (_root._xmouse-this._x)/25;
this._y += (_root._ymouse-this._y)/25;
}
At the moment with this code, the button mc follows the mouse over the entire stage. I am trying to figure out how I can limit the movement to a smaller proportion of the stage, by either a hit area or some other method
Obviously I wont want this to effect the normal cursor movement, just the MC that follows it. Anyone give me a clue of how I should go about trying to do this?
Thanks

Set Cursor To I-cursor Usually Seen Over Textfields
I want to us AS to set the cursor so that it's the I-cursor that's over a textfield. In this case, it would be over a text field, but one that's in a movieclip that has an event handler for it. Because of that _parent event handler, the cursor is a hand when the mouse cursor if over that field. Is there some way I can change the cursor to the I-cursor? Do I need to make a bitmap of the cursor and use it as a custom cursor? I'd prefer not to do it that way if I can avoid it.

Please Some One Help Me Its A Little Thing
can sumone help me????

i wanna do a simple flash, and its supposed to look like if there was a identification system, like if u type

User: YoshY

then something like this would appear

User YoshY loged in

but the problem is that i dont know how to do it so could u tell me how???
(u might not have understood this coz i am Brazilian and english is not my first language)

Thanks and please help.... helper if u have ICQ then help me in the UIN shown below(35235145)

How To Do This Thing...............
Well i m creating a new website on Flash 5. Now i want to have a database in which the user will enter there detail. So i want to create something by which the details entered on a form created (on flash) can be added to a database automatically. I mean that when the user will enter his details and press the submit button all the details should be entered in a database on the server. It this thing possible in Flash
I also want to know how can create a feedback form on flash. I mean the user will enter his Name, e-mail etc and all the details r mailed to me on my e-mail account.
Please Help.

1 Last Thing
I figured out how to make a checkbox, and everything works.
Its a 2 frame deal.
Here is my problem. I have like 12 checkboxes. if you check 1 checkbox, all of them turned checked. How can I make this work so each is unique?
Any thoughts?
Thank you for your time.

Is This Thing On?
Hey all.
I am helping someone out with a flash presentation. They know very little about flash, and wanted to do it all himself. Things worked "ok" but now we are getting into some functionality problems (didn't see that coming)
The problem: pause the audio (narration)
The other problem: the audio was just dragged into the timeline. Not as a MC
The other problem: everything is in 1 fla file. Not split into external.

First question is, can a pause button even get put in? Could it work?
This is a VERY low paying job, so if its a lot of work....I prolly wont make it happen.
Thank you TONS for any input

Thanks Man, 1 More Thing Please :)
um...
all my movie will get faster or only shapes??

One More Thing
In reference to my previous post i wanted to mention that the animations work if you hit the refresh button as well. I thought that would be a valuable piece of information.
Thanks
Don

Sorry But First Thing First....
Are there any tutorials that will tell me how to make a flash website.... I have flash mx on a relatives PC and basically i have made reasonably good html website using my own templates e.t.c. and now want to learn flash. Sorry im sure you get this a million times i did try the search couldnt find much.... :S so whats first?

One More Thing
oh and the flash file is not part of a web page, i'm using the projector. it autoplays when the cd is inserted

I Am Almost There. One Last Thing And I'm Done. Please Help
OK!!! I've got this code:
on(release){
getURL("phasp.jpg","_phasp");
}
Every FLASH expert knows that the above code opens this jpg in a new window, ok fine. That I have sorted. now what i want is that this jpg opens in a new window but without having an address bar. In other words, the window to scale to the size of the picture.

I hope I make sense...

Any help will be appreciated.

Trying To Do The Right Thing...
Hi All

I am trying to do the right thing and place all my actionscript on a single frame on the root timeline. I am trying to reference two buttons within a movie clip called intro_mc. The first button start_btn works fine but the second button go_btn will not work. Can someone explain to me where I am going wrong. Thanks in advance


Code:
stop();
intro_mc.start_btn.onRelease = function() {
trace("hit");
intro_mc.gotoAndStop(2);
};


intro_mc.go_btn.onRelease = function() {
trace("hit");
intro_mc.gotoAndStop(3);
};

Ok Here's The Thing
..Ive got a problem im working on, and im wondering which is the best way to go about it.

Theres a certain number of dynamically loaded .jpgs on the screen, every 2 seconds, i delete 10 of them, and load in another new 10 .jpgs (say combined file size of 50k). This will go on and could end up with LOTS of jpegs being displayed say over 5000 over time.

The thing i'm not sure about, is to allow these .jpgs to be cached or not? I'm worried that its going to fill up the users tempory space for cacheing files, but of course if you allow cacheing then it saves on download time.......which way is best??

thanks for any help..
boombanguk

Oh And One More Thing...
i have two movie clips that do exactly the same thing... yet one works when i put it on the time line and one doesn't...

any ideas... all it is is a one second fade... the logo works and the other mc doesn't...

they are identical... i even recreated the other mc... thinking that it might have just been a glitch in my flash program...

The First Thing I See....
..when I load my index.html is the swf square (empty) and then
loads the image.
How I do to evit this?

Thanks

Is There Such A Thing?
i need to be able to load text into a dynamic text field and for it to be able to scroll??

really need some help peeps

One More Thing.....
I need some bad help with forms....as in email/comment forms and newsletter forms!

p.s.
same thing applies for what i was saying earlier....about the verbal thing!

Fly In Thing
Here's something I made a while back. (I think I even posted it on this site, but that was with an old account, and I can't even remember the account's name anymore...)

Recently souped up to be faster, more efficient, and just overall, cooler.

You give it a picture (Bitmap image or something you just drew in Flash-doesn't matter which) and it constructs it, pixel by pixel. Each individual pixel flies in from the sides of the screen. The trouble is that it takes a little long and is nowhere near practical for anything-uses way too much CPU power. And even when I'm really pushing it in terms of CPU usage, it still takes longer than i'd like for it to finish.

Well, regardless, the image that it winds up with is 100% perfect, and it stops once it's done. Puts in pixels from top to bottom.

Some Thing To Know About XML/AS2
you just can't trust childNodes to be ordered in the way you expect it when enumerating them with [i]. had to check node names

The Tag Thing..
i know i have seen this effect before but i cant find the tutorial

can someone help me...

i did a search and couldnt find it..

look at the attach

One More Thing.....
I need some bad help with forms....as in email/comment forms and newsletter forms!

p.s.
same thing applies for what i was saying earlier....about the verbal thing!

Xml Thing
Hi,

Iv'e been developing a little app using flash/xml. It works perfectly, but sometimes it doesn't load the xml...

The usual scripting I use is something like this:


Code:
var myXML:XML = new XML();
myXML.ignoreWhites = true;
myXML.onLoad=function() {
//All to be done with the xml's info
}
myXML.load("xmlURL.xml");
What am I missing?

One More Thing....
How would I go by adding flash to jewelry to make it look like it is reflecting in the sun so to speak? Here is an example of what I am talking about: Example

Help With This Little Thing Please.
Ok, well I've been messing around trying to improve on my actionscript and I came up with this:


ActionScript Code:
my_color = new Color(object_mc);
myColorTransform = new Object();
object_mc.onEnterFrame = function() {
    my_color.setTransform(myColorTransform);
    myColorTransform.ra = 50;
    myColorTransform.rb = _root._ymouse;
    myColorTransform.ga = 40;
    myColorTransform.gb = _root._xmouse;
    myColorTransform.ba = 12;
    myColorTransform.bb = (_root._xmouse-_root._ymouse);
    myColorTransform.aa = 40;
    myColorTransform.ab = 70;
    var xMouse = _root._xmouse;
    var yMouse = _root._ymouse;
    if (Math.abs(xMouse-this._x)<1) {
        xMouse = this._x;
        yMouse = this._y;
    } else {
        this._x -= (this._x-xMouse)/6;
        this._y -= (this._y-yMouse)/6;
    }
};


I have been trying to make this MC rotate via _xmouse/_ymouse but I can't seem to get it to work. Any quick help for me?

How To Do This Thing
Please anyone tell me how to make navigation like this site http://www.kurtnoble.com/ have. This is done with actionscript or with motion tweening.

An Amazing Thing, That I Don't Know How To Do
Hello... thank's to view this post..... I' was searching in internet for amazing flash sites.... and in one of this sites appear a thing that I can't explain very good... it's like a pop up but is a new window that doesn't have the borders and title of the "Internet Exporer"... I don't know if you understand what I mean..... but here is the link http://www.sub7designs.com/test/ ....

If you know how they do that.... can you explain it... or make a litle explanation

thank you very much


CaVi21

I Tried The Count Thing
var a, b;
var score = 0;
function makeProblem () {
a = Math.ceil(Math.random()*12);
b = Math.ceil(Math.random()*12);
problem = a+" + "+b+" = ";
}
function checkAnswer () {
count++;
if (count == 10) {
gotoAndPlay ("Scene 4", 1);
} else {
// they got it right
if (answer == (a+b)) {
score++;
answer = "";
rightAnimations.gotoAndStop(Math.ceil(Math.random( )*5));
makeProblem();
// they got it wrong
} else {
wrongAnimations.gotoAndStop(Math.ceil(Math.random( )*5));
}
}
}
makeProblem();

thats the code i did, but that doesnt seem to count i think the count is in the wrong spot but i cant figure out where to put it, if i move it i get errors.

No Way Some Thing Is Wrong
no way
i make it step by step as you told me
the first mc loop and the second dosen't show up

can you send me a simple mc as i want to do to my e.mail

i will be glade if you do

Help Please On Open Thing?
I have recently purchased flash 5, it is a great program, but $300, f*** that, i got it at a discount place for $150.

Ok, on to the question, I want to know how to make a link(or whatever it is called in flash) open up in the movie, like a box slides in with my writing and stuff in it, all i can figure out how to do is to open up info from another separate creation in a different window, please help?

LoadMovieNum F*****G Thing
loadMovieNum ("loops.swf", 2);

First is the above code correct??? and second is that I have loops.swf loading into level 2 because I have another .swf loading 1 it works at the moment but this one doesn't WHY?? andis there a better to have two loadmovies running at the same time...

the other is track1.swf and I want this in level 1

ok thanks guys and gals

D

For Musicman 1 More Thing
hey,
dude how do i set the code to work where do i put each one of them, in the movie clip or where to make him move foward..

angle = walker._rotation * Math.PI / 180

d = 10

walker._x += d * Math.sin(angle)
walker._y += d * Math.cos(angle)
Thanx in advanced
Advanced sky|::...

Hello I'm New To This Whole Thing, And Flash...
I hope the get to know this site more better sooner or later, and make new friends! I'm glad to join!! I hope that this site and the people will help me out a lot, and I will learn from it all. Thank you!

Sorry One More Thing On The Last Post:
I meant to say that sometimes my tweens are smooth and nice; sometimes they are jerky and wierd...

want to know what the secret is to have them smooth all the time.....

thx ahead of time guys

Impossible Thing 1
HI,
First I sent a question how to disable keyboard, now I’m asking IS IT POSIBLE?

The Wierdest Thing
I run this script and it works but then the last duplicate of my movieclip always dissapears I do not get it. Also if anyone can give me suggestions how to make this code more flexible so it can be used by many movieclips at the same time that would be great I am having trouble making this easily customizable, functional, and adaptable for all movieclip instances on my stage.
onClipEvent (load) {
_parent.stop();
num = 20;
n = 1;
ini_timer = Math.ceil(getTimer()/1000);
}
onClipEvent (enterFrame) {
elapsed_timer = Math.ceil(getTimer()/1000);
if (elapsed_timer>(ini_timer + 2)) {
while (n<=num) {
_parent.ball.duplicateMovieClip("ball" + n, n);
_parent["ball" + n]._x += _width * n;
n += 1;
}
}
}

One More Thing - I Hope
Can I get a button to open a word document or do I have to zip it and link it to the zip.

Thanks!

Kate

Cant Get This Thing To Print
I'm a newbie to Flash and posted this questionn there with no results so I thought I'd try here.

With a little help from my friends here in FK, I figured out how to make my scroll bar work! :-)

Now I need to figure out how to make it print. On my main timeline, I have 3 layers, the second layer is the one I want to have print. It's nothing more than about 4 pages of text.

I've got my button all set up and ready to be assigned an action.

When I try adding the "Print" action, by default it gives me this code:

on (release) {
printNum(1, "bmovie");
}

That seems to print out the 1st layer in the movie, not the 2nd layer I'm trying to print. So I switched the 2 layers around, and that didn't help. I changed the

on (release) {
printNum(1, "bmovie");
}

to

on (release) {
printNum(2, "bmovie");
}

and that didn't help.

Any ideas on how to solve this? I;m using Flash MX

Thanks

Copyright © 2005-08 www.BigResource.com, All rights reserved