Custome Cursor
hi to all . i am having a new kinda of prob here... i am using a custome cursor in my movie.. which involves different scenes ,and the cursor has to be different for different scenes . but it only works for the first scene .. and when the other scene starts the cursor suddenly disappears.. this is really weired . can any one help me wid this problem. thanks in advance
FlashKit > Flash Help > Flash ActionScript
Posted on: 05-22-2003, 03:17 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Live Preview And Custome Icon For Custome Flash Components
Hi
are there any tutorials about creating a live preview and custom Icon for custom flash components
I need tutorials about the custom components and how to make a live preview for them and also custom Icons,
basically I want to know if we can put an swf in the live preview field and when we are in the design view of the component that I can interact with the swf like click it and show a copyright message (all at design time not run time of the component)?
and about the custom Icons, flash asks for Fireworks PNG and when I put mine it does not show in the library???
thanks.
Custome Icon
Can anyone tell me how to have a custome icon for my site. Like the one flah kit has in the Adress line
thanks
Custome Update Window
Hi,
Is there a way through java script or action script so that if the user click No on the message to update the browser player to version 9 then I can do a redirect or something else ?.
"Stipple" Custome Line Render Problem
Howdy,
Haveing a rendering issue. I've developed an illustration in Flash 8 (PC ver) useing all lines. Several of these lines are "Stipple" type apposed to "Hairline" or "Solid". I used custom settings, as follows:
Type: Stipple
Dot Size: Tiny
Dot Variation: Small Variation
Density: Very Dense
When I got to "Test Movie" or "Publish" my CPU spins up to 100% and hangs. I was able to successfully render one line quickly, and the full lines on a single frame with no tweening after about 12-13mins of render time. Is there any setting in flash to cause these lines to render more quickly or more reliably?
I'm running the following system:
Athlon XP 2800 at 2.1ghz
ASUS A7N8X-E board
512MB Ram
ATI 9600 Pro 128mb
Any suggestions would be helpful.
- GB.FLCL
*sigh Custome Events In As3 - Again. :sigh:
So, I am trying to pass some arguments through a custom MouseEvent. This is my code:
Document Class (Main.as)
ActionScript Code:
package { import flash.display.Sprite; import flash.events.MouseEvent; import Events.MyCheckBoxEvent; /** * Main Class * @ purpose: Document class for movie */ public class Main extends Sprite{ public function Main(){ //instantiate concrete creators //var cable1:Page = new Cable1(); var cb:CheckBox = new CustomCheckBox(); addChild(cb); cb.addEventListener(MyCheckBoxEvent.CLICK, clickHandler, false, 0, ["ted","john","doug"]); } private function clickHandler(e:MyCheckBoxEvent){ trace(e.argumentArray); } }}
MyCheckBoxEvent.as
ActionScript Code:
package Events{ import flash.events.MouseEvent; import flash.events.Event; public class MyCheckBoxEvent extends MouseEvent { public static const CLICK:String = "click"; private var _argArray:Array; public function MyCheckBoxEvent(type:String, bubbles:Boolean = false, cancelable:Boolean = false, argArray:Array = null) { super(type,bubbles,cancelable); _argArray = argArray; } public function get argumentArray():Array { return _argArray; } override public function clone():Event{ return new MyCheckBoxEvent(type,bubbles,cancelable,_argArray); } }}
So I dont get any compiler errors at runtime, but when I click on the checkbox I get this error:
TypeError: Error #1034: Type Coercion failed: cannot convert flash.events::MouseEvent@10add4a9 to Events.MyCheckBoxEvent.
If I make the argument of the event handler function to be just MouseEvent instead of MyCheckBoxEvent then it works, but it doesnt recognize the _argArray getter.... This is driving me mad! I have spent like 3 hours on this already... I tried casting the Event as a MyCheckBoxEvent and same thing...
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!
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.
Cursor Help
I used a cursor hide/show function loaded with loadmovie action to my site: http://www.kibbutznetwork.co.il/adam
on MAC platform the cursor doesn't appear.
How do i make it available on all platforms?
Thanks
Adam.
Run Away From Cursor
I want to create a button/graphic/mc that moves away if the cursor goes near it, as if repelled/being chased by the cursor. How do I do this?
X And Y Of Cursor
I'm interested in creating an effect whereby the x and y
co-ordinates of my cursor position are displayed in a text box. I have no idea how this is achieved. Cheers
Cursor
Hi all, well im new to flash and wanted to no how i can change the apperence of the cursor. For example in the help>samples there is a fly swatting game, what im after is how to change the cursor to the swat, but im just missing the final link. Please post with any suggestions
Thankyou
Tom
Cursor
Bleh. on kazsh.com these little [ ] Move around behind the cursor. I figured that part allready. But i cant figure out how they go the [] To move to the button on rollover.
Thanx IN AdVanCe
Mike
2 Different Cursor's?
i have made a movieclip with 2 different cursors in it, 1 for normal cursor and one with the hand cursor,
the draging part is not the problem, the problem is. how do i let the cursor change when i'm over a button to the hand cursor, and back when its not?
i tryed setting variables.. but it does'nt work
i tryed searching in this forum (and flashfreaks.nl's forum to) but could'nt find something..
Cursor Help
i was woundering if u new how to make a custom cursor
Cursor
Hi! I used to remember how to do this but now I forgot, even though it's simple. How do I change the cursor's image?Thanks in advance!!
Cursor
how do i display cursor in my flash presentation??
vijayashree
Cursor In A MC
Hi:
I have a MC (name: as) in a movie..
When I move the mouse over the MC I want to have a custom cursor..
Can someone please help me here with an example or some code
Thanks
Uday
Following The Cursor
do you know what actionscripts to use to make something folow the cursor slowly around the screen?
I'd appreciate any help at all...
Cursor
Hey people, i wanna know if its possible with swish2.0 to change the cursor to an image.
cause im making an intro for a multiplayer gaming clan, and i need to change the cursor into a reticule of a scope.
hope you can help me out.
Help With Cursor
I need help with a cursor I have made one and I want it to leave a trail
help would be much appreciated
Cursor Tag
Im not sure exactly what it is called, when you hover over a graphic with the cursor and a little help/name tag pops up after a while.
My question is, can flash do this?
If so how do I program it to?
Thank you for any help
Cursor Help
my code is..
stop();
crosshair_mc.startDrag();
Mouse.hide();
it works, but the crosshair doesn't drag properly, it looks like it drags a couple inches from where it should; it won't rollover a button like it should
Cursor
Is there a way to turn a flash file into a cursor file? or use one of my flash made cursors on a webpage.
Cursor
I have made a customr cursor with three states that are spread across three frames. The states are normal, over, and down. My question is can I get the cursor to change like the current cursor does in flash. i.e. when the cursor goes over a button it turns to a hand etc. etc. Thanks in advance.
Cursor Help
Heya im rather new and need to know if i can get rid of the text slelection cursor in the text area and just have the custom cursor there instead. You can see what i mean here:
http://free.hostultra.com/~xFx/
Eye Following Cursor
hey im trying to make a game where theres a gun that aims at the cursor... i looked at a tutorial for "the rotating eye" which basically made the eye look at the cursor.
it said to use this code:
// eye rotation
a = eye._y-_ymouse;
b = eye._x-_xmouse;
angleA = Math.atan2(a, b);
degrees = angleA/(Math.pi/180);
setProperty ("eye", _rotation, degrees);
i changed it so it wasnt eye and it was gun to work for my game.. but when i try to play it it says:
There is no property with the name 'pi'.
degrees = angleA/(Math.pi/180);
anyone know what to do???
Cursor Help
Hey! I'm making a game and need help.
Can you make me a code that would change to frame 20 in the timeline when a movieclip called "knife" touches my cursor?
If you could, GREAT! I'm a n00bie!
Following The Cursor
Okay, I am trying to make a game where your cursor is the crosshair of the gun you are holding. I know how to do that...but what I need to know is how the gun can follow the crosshair (across the x-axis). Could you help me?
Cursor.
Hi,
is it possible to change the default cursor to a black one, i dont mean a custom cursor,a system one.
cheers,
G
Cursor
how do i put a cursor of my own in the flash movie so its that cursor no the normal arrow?
Cursor Help
Hi, I'm pretty new to flash and I need some help.
I have Flash MX professional 2004, and I made a custom cursor, and placed all the correct actionscript, but when i test it, it wont work when i cllick on any buttons.
Could you help?
Cursor Help
i'm new to flash, i use flash mx 2004. and im making a dress up game. but when you click and pull some thing, it leaves toe couror behing
this is the code i use
Code:
Mouse.hide(); startDrag("cursor", true);
the cursors instance name is
Code:
cursor
click here to see for your self
hope you can help
-yoyo king
Cursor Help
i want my flash to have a custom cursor when it is in the in the site
I assume this means an object will have to scripted to always be at wherever the cursor is and the cursor will have to be hidden, but I dont know how todo that so if anyone could help, i just want to replace the cursor with an image...
V Cam Cursor
I was going to make a band profile with live movie clips in the background. I wanted the user to be able to look round the screen and see what’s going on live. I’ve tried directly linking the vcam to the cursor but it moves to fast and is a lil slow. So what alternatives do I have? Any code would help me even further; I’m not too great at flash. I did find a fla on this site that would be perfect but sadly I lost the link. It featured a minimap in the corner that is relative to the rest of the flash, when you move the minimap you would see a different perspective. Any help?
[F8] Cursor Help
i am having lots of trouble with custom cursors. i have try'd my own scripting and at least 5 tutes and none work! it hides the defalt cursor but my MC cursor wont move. anyone have a solution or even no the problem?
Cursor
hi.
i had an earlier post about an interactive scene with bubbles. i've just updated the code and works quite well except the pin cursor that is meant to pop the bubbles is still not working.
could anyone help?
here is the code:
main class
<as>
package{
import flash.display.*;
import flash.events.*;
public class main extends MovieClip{
private var myBubble:Bubble;
public function main(){
for(var i:int = 0; i < 15; i++){
myBubble = new Bubble(this);
addChild(myBubble);
}
}
}
}
</as>
bubble class
<as>
package {
import flash.display.*;
import flash.events.*;
public class Bubble extends Sprite {
var angle:Number;
var randomSpeed:Number;
var theParent:Object;
public function Bubble(theParent) {
theParent = theParent;
angle = Math.random() * 140 - 200;
randomSpeed = Math.random() * 10;
this.x = theParent.stage.stageWidth/2.5;
this.y = theParent.stage.stageHeight-150;
this.scaleX = this.scaleY = Math.random();
addEventListener(Event.ENTER_FRAME,floatUp);
}
public function floatUp(evt:Event) {
var radian:Number = angle * Math.PI/400;
var vx:Number = Math.ceil(radian) * randomSpeed;
var vy:Number = Math.sin(radian) * randomSpeed;
this.x += vx;
this.y += vy;
}
}
}
</as>
pin class
<as>
package{
import flash.display.*;
import flash.events.*;
public class Pin extends MovieClip{
var mypin = new Pin();
public function addPin(evt:Event){
addEventListener(MouseEvent.MOUSE_DOWN,addPin);
addChild(mypin);
mypin.x = mouseX;
mypin.y = mouseY;
mypin.startDrag(true);
}
public function floatUp(evt:Event) {
evt.target.y -= evt.target.theParent;
if (evt.target.hitTestPoint(mypin.x - mypin.width / 2, mypin.y, true)) {
evt.target.removeEventListener(Event.ENTER_FRAME,f loatUp);
evt.target.theParent.removeChild(evt.target);
}
}
}
}
</as>
i know it has something to do with the addPin function but could anyone tell me what i have to do or show me?
thanks
Following The Cursor
I want a line to follow the mouse's movement in the menu. For example, when the cursor moves to the About link, the line should settle on the About link.
Can anyone help or point to a tutorial? Many thanks.
Cursor
I'm exsperimenting with cursors and
If I put this code for a cursor at the beginning of my code it works meening I'm able to enable the click function of a button and scroll bar. problem is that the cursor is behind every object created with code.
so to get the right depth I placed the code at the end of the script. But now the cursor can't exacute the click function.
is there a way to solve either issue?
ps I also tried
setChildIndex(k, 9); // results = objects created after code start at level 10 lol k9
swapChildren(k, myLastObject);// results = object k not turning into a cursor + external text not loading
Code:
var k:MovieClip = new MovieClip();
k.graphics.beginFill(0xcc1111, 1);
k.graphics.lineStyle(2, 0xff1111, 1);
k.graphics.moveTo(0,0);
k.graphics.lineTo(30, 30);
k.graphics.lineTo(0, 50);
k.graphics.lineTo(0, 0);
k.graphics.endFill();
addChild(k);
Mouse.hide();
function onMove (motion:MouseEvent):void {
k.x = mouseX;
k.y = mouseY;
};
stage.addEventListener (MouseEvent.MOUSE_MOVE, onMove);
Cursor
ok
im making a cursor and this is what i have:
onClipEvent (enterFrame) {
Mouse.hide();
this._x = _root._xmouse;
this._y = _root._ymouse;
}
just a bit of simple code to make a cursor, but heres the hard part i want to have bubbles coming up from the bottom in random sizes between 15X15 pixels and 25X25 pixels and i only want them coming up in random places below the cursor
example: if the cursor is 275 on the x scale i want the bubles to come up 265 and 285 on the x scale but that must change when moved (always 10 pixels on either side tho)
this is a common effect but i may not have wrote it very clear. if i didnt tell me and i will try and fix it.
thanks
Cursor Help? Please...
I am new to this : here is my question:
I have created a custom cursor (a circle) using the following code. The problem is that I would like this circle to change to a square when rolling over a button. Also, I need both cursors (circle and square) to disappear when over my form (input text). Presently, the cursor blocks the "I" symbol that appears, notifying the user to input text.
Any help/guidance/code would be most appreciated!
MY CURRENT CODE IS AS FOLLOWS:
Code:
var cursor:MovieClip;
function initializeMovie ():void
{
cursor = new Cursor();
addChild (cursor);
cursor.enabled = false;
Mouse.hide();
stage.addEventListener (MouseEvent.MOUSE_MOVE, dragCursor);
}
function dragCursor (event:MouseEvent):void
{
cursor.x = this.mouseX;
cursor.y = this.mouseY;
}
initializeMovie ();
Also, I am using action script 3.
Thanks!
-guess
Set Cursor
when I move my mouse over a movie clip, it turns to the hand tool, how can I set it to the default pointer?
Cursor
I made a custom cursor ........ how do I make something appear on it (could be anything, a red line, wiggle, etc) ........ when the mouse is pressed
PS-if i didn't explain that properly let me know
thx
Sandman9
|