UseHandCursor Property On Button Component
Hi all, My problem is to do with the useHandCursor property which I am applying to a 'button' component on my stage. Basically whenever I add a button component to my stage - by default the 'hand cursor' does not display over the button, so by adding the following to an instance of a button: myButtonInstanceOnStage.useHandCursor = true; this works nicely and I get to see the hand cursor appear when hovering over the button - the problem is I will be adding a lot more buttons and was wondering if there is a line of code to put in at the top of my actionscript file that will set all buttons by default to have their useHandCursor property set to true.
Flash: Version 8 Professional Thanks in advance!
SitePoint > Design Your Site > Flash and Actionscript
Posted on: Mar 11, 2007, 17:14
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
UseHandCursor = False; Works With Component Seek And Volume?
Been working on a video section for my site, and have run into a snag.
Using the useHandCursor = false; I've been able to eliminate the hand cursor from showing up over the pause and play component buttons, but I'm having trouble with the Volume, Seek, and Mute.
Any tips or suggestions? I've been trying to name my instances everywhere I can, and using the useHandCursor code, but no luck.
Thankya.
Button.prototype.useHandCursor = False; ...not Quite
I used the Button.prototype.useHandCursor = false; action to hide hand cursor for my site..and that does the trick for all buttons like it's supposed to. However, I have a scrollbar that when you rollover the dragger or up and down arrows while the clip is still playing (the mask layer that 'uncovers' it), the hand cursor shows. After the mask clip stops, the hand cursor is hidden, and it's back to the arrow like I want.
What gives? Any suggestions?
THanks in advance.
Component's Property In ActionScript
I found the the properties of a component in ActionScript are not the same as those in MXML. for example, Within ActionScript code,I can't find the property "id" of RadioButtonGroup, Formitem's "HorizontalGap" property.But I can use those properties in MXML. Would someone kindly tell me why ? and is there some way to resolve this problem?
thanx a lot.
Component Collection Property
I just want to be able to use the parameters tab to add an Array of objects with label and data properties, like the List component does. How do I do that? When I select Collection in the Component Definitions, it doesn't seem to do anything, and when I come it reverts to whatever I had before that.
Need Some Basic Component Property Help.
i bought this great shopping cart component , but i now i need things changed .
in my support page it says:
The following sets the targetURL field value of the cart:
cartEngine.targetURL = "https://www.myDomain.com/myCustomCart.php";
but i dont know where to plug this into , or what the process is to changing this property .
thanks for the help
-chris
Scroll Pane Component Property
What is the property of a scolling MC object of the scoll pane. I need to know the maxscroll of the scrolled MC object.
Or I need to know the event that triggers when the thumb has reached the down arrow.
Attaching A Component And Setting A Property
I'm using attachMovie() to add a movieclip, made up from simple components, to the stage (a FlashMX UI Component)
When I attach the component, I find that I can't set any properties or run any component functions in the same frame!
To get around this, I am creating an clip.onEnterFrame script and then deleting it when a property is set! Silliness!
ActionScript Code:
this.attachMovie("radio button group", "group", this.getNextHighestDepth(), {_x:100, _y:100});
//
this.onEnterFrame = function() {
if (group.button1.getLabel() == "" || group.button1.getLabel() == undefined) {
group.button1.setLabel("hello!");
group.button2.setLabel("there!");
group.button3.setLabel("world!");
} else {
delete this.onEnterFrame;
}
trace(group.button1.getLabel());
};
this seems to be the only way I can find to set any properties for my components! This is going to get really annoying (not to mention it just seems very bad form!).
Can anyone give me some ideas on how to attach and then set property in one function call?
I guess I mioght be able to do it by playing with the attachMovie("xxx", "xxx", 1, {set properties here}); but I reckon that might not work either.
AS3 Setting List Component Property
I know this has got to be simple but I am having a difcult time trying to set the font and the size of the font on a List Component. Does anyone have an example or can point to a place where I can read up on this?
Thanks
Setting Property Of Duplicated Component?
hi there, ive got a radiobutton component on my stage named radio1.
I need to duplicate it and then change a few properties, but i cant seem to get the path/naming right. This is my code:
Code:
i=2;
radio1.duplicateMovieClip("radio"+i, radio1.getNextHighestDepth(), {_x:20, _y:20});
_root["radio"+i].setLabel("test");
i++
if i use a constant name instead of "radio"+i it works but the ["radio"+i] seems to be the problem, could someone help me with this? (using flash mx)
Stage Property Of Application And All Its Component
Sorry it is a little bit about flex but I have nowhere to ask. so.
Code:
<?xml version="1.0"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
creationComplete="initApp()">
<mx:Script>
<![CDATA[
public function initApp():void
{
txt.text += txt.stage;
txt.text += stage;
//result is nullnull
}
]]>
</mx:Script>
<mx:Text id="txt"/>
</mx:Application>
not only the components added on Application and all kind of DisplayObject added in a UIComponent cannot access their stage property. which make me cannot use KeyboardEvent.
Please help please
Content Property Of ScrollPane Component
iI have tried ur below mentioned code (copied from ur tutorial - "Dynamic Movie Clips and the ScrollPane") in one of my project. But the "scrollPane.content" is not showing the path to the movieClip. And also the scrollPane is not showing any movieClip attached to it. Even it is not showing the vertcal scrollbar. It is blank
scrollPane.contentPath = "scrollMovieClip";
mcMain = scrollPane.content;
Please help me !
thanks
Aneesh Babu
Setting Property Of Duplicated Component?
hi there, ive got a radiobutton component on my stage named radio1.
I need to duplicate it and then change a few properties, but i cant seem to get the path/naming right. This is my code:
Code:
i=2;
radio1.duplicateMovieClip("radio"+i, radio1.getNextHighestDepth(), {_x:20, _y:20});
_root["radio"+i].setLabel("test");
i++
if i use a constant name instead of "radio"+i it works but the ["radio"+i] seems to be the problem, could someone help me with this? (using flash mx)
[F8] Help With List Component Setting Alpha Property On Map
I have been working on an interactive map for a hospital and am almost done. I have a list component that is filled with locations. Upon selecting an item on the list it needs to highlight a building on the map by chaning the alpha setting on a highlight movie clip. The problem comes when you pick a different location. You must click it twice to set the value. I need the list to change the alpha setting on the first click. Here is the related code.
code: function defineproperty() {
}
myListBoxListener = new Object();
myListBoxListener.change = function(eventObj) {
var eventSource = eventObj.target;
var theSelectedItem = eventSource.selectedItem;
var theSelectedItemLabel = theSelectedItem.label;
var theSelectedItemData = theSelectedItem.data;
var buildingpropertyA:String = "_root.mapgraphic.mcgmove.mcgmap.buildings.";
var buildingproperty:String = buildingpropertyA.concat("", theSelectedItemData);
if (count == 1) {
setProperty(buildingproperty, _alpha, var2);
count = count - 1;
} else {
setProperty(buildingproperty, _alpha, var1);
count = 1;
}
setProperty("_root.mapgraphic", _xscale, 80);
setProperty("_root.mapgraphic", _yscale, 80);
setProperty("_root.mapgraphic.mcgmove", _x, -379.7);
setProperty("_root.mapgraphic.mcgmove", _y, -160.6);
};
myListBox.addEventListener("change", myListBoxListener);
This seems a bit complex - here is the link to the map in it's current state:
http://s129542311.onlinehome.us/mcg/
Jeremy
MXML Component As Actionscript Class Property
I am trying to create a custom actionscript component that has an HTTPService property that I define in MXML and pass to the "service" property of a DatabaseNavigator component. However I keep getting null object errors. Here is my code:
index.mxml
Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:db="database.containers.*" layout="absolute" width="700" height="700">
<mx:Style source="assetscss
scsadmin.css"></mx:Style>
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.events.IndexChangedEvent;
import database.containers.DatabaseNavigator;
]]>
</mx:Script>
<mx:Fade id="fader" duration="1000" alphaFrom="1.0" alphaTo="0.0"/>
<mx:HTTPService id="databaseService" resultFormat="xml" method="POST" />
<db:DatabaseNavigator service="{databaseService}" host="localhost"/>
</mx:Application>
DatabaseNavigator.as
Code:
package database.containers
{
import mx.containers.TabNavigator;
import mx.controls.Alert;
import mx.events.FlexEvent;
import mx.rpc.events.ResultEvent;
import mx.rpc.http.mxml.HTTPService;
public class DatabaseNavigator extends TabNavigator
{
private var _host:String;
private var _username:String;
private var _password:String;
private var _database:String;
private var _service:HTTPService;
private var metaData:XMLList;
private var params:Object;
public function DatabaseNavigator()
{
super();
params = new Object();
addEventListener(FlexEvent.INITIALIZE, superInitHandler);
}
public function get host():String {
return _host;
}
public function set host(value:String):void {
_host = value;
}
public function get username():String {
return _username;
}
public function set username(value:String):void {
_username = value;
}
public function get password():String {
return _password;
}
public function set password(value:String):void {
_password = value;
}
public function get database():String {
return _database;
}
public function set database(value:String):void {
_database = value;
}
public function get service():HTTPService {
return _service;
}
public function set service(value:HTTPService):void {
_service = value;
}
private function superInitHandler(event:FlexEvent):void {
params.host = host;
params.username = username;
params.password = password;
params.database = database;
try {
if(!service) {
throw(new Error("Error: Databse service not specified"));
} else {
service.addEventListener(ResultEvent.RESULT, serviceResultHandler);
service.send(params);
}
} catch (error:Error) {
Alert.show(error.message);
}
}
private function serviceResultHandler(event:ResultEvent):void {
Alert.show(event.result.toString());
}
}
}
Button Property
Hi there,
I made a flash movie with some MC's and buttons.
The buttons I used are invisible, but they i the way of the layer above it.
Can I disable only these button and keep the other ones enabled?...
who can help me out?
thnx...
Button Property Working For 1 Button, But Not The Other Two...
I have a keyframe waiting for user input.
I have 3 buttons on this frame:
ManualEnrollment
DemoCardButton
DemoDLButton
I call this first thing under that frame:
setProperty(ManualEnrollment, _visible, 0);
setProperty(DemoCardButton, _visible, 0);
setProperty(DemoDLButton, _visible, 0);
ManualEnrollment - is now invisible
DemoCardButton - still visible
DemoDLButton - still visible
WHAT THE
I have gone back, went into properties, copied the name and pasted it to make sure I didn't misspell something, it's not misspelled.
What am I missing?
On(hold) Button Property ?
hi
im trying to work a virtual tour by flash, and i would like to get the buttons that takes to the next or previous frames to keep playing the movie until i release the click.
i mean, i click, it goes frame by frame without stopping and when i release the click it stops in the frame that currently was playing.
i hope you understand what im trying to say.
if you check http://www.abwebsite.com/parque.htm you can see what my problem is. i have to click the button everytime i want to go to the next frame or previous frame.
Button Undefined Property
I hope this is really easy for someone, but I just started using flash 2 days ago, so need some basic help
I am trying to move to a specific point at a timeline, and when i did it for the button "gallery" I put an instance name "gallery_btn" and put in this code which my prof gave me
gallery_btn.addEventListener(MouseEvent.CLICK, gallery);
function gallery(event)
{
gotoAndStop(75);
}
I have altering this code for a button "Info", which has the instance name "info_btn to arrive at this
info_btn.addEventListener(MouseEvent.CLICK, info);
function info(event)
{
gotoAndStop(75);
}
When I play Movie it gives me error 1120: access of undefined property info_btn.
(Maybe worth noting that there is a period at the end of the error code)
What am I doing wrong?
Thanks!
How To Set Property To A Dynamic Button?
Hello, friends
some code look like this:
var i = 1;
while(i < 6){
newX = new Number(i * 25);
newY = new Number(187);
newW = new Number(22);
newH = new Number(22);
_root.createClassObject(mx.controls.Button, "button"+i, i, {label:i, _x:newX, _y:newY, _width:newW, _height:newH});
i++;
}
"button"+i.enabled = false;
the last line is syntax error, is there any way can I set property to a dynamic variable like above?
or how can I concat a string and a variable as a new variable?
I'd very appriciated if any one can help me out, thanks in advance.
a newbe
How To Change The Property Of A Button?
I want to animate a button crossing the screen in a random route.
So, I decided to influence the x_position of the button randomly.
However, the x_position of a button cannot be changed, only the x_position of a movie. But a movie does not have the functions of a button.
So what should I do?
UseHandCursor
I want the hand cursor to come up when the user rolls over a movie clip, instead of the arrow pointer.
I think you can do it with useHandCursor action, but I can't seem to get the script right.
Can anyone help me?
UseHandCursor?
I have a series of movie clips that each have a mouse event associated with them.
They work fine but I'd like the hand cursor to show when a user rolls over them.
Is there a quick way to tell it to do that?
I've tried various combinations of
e.target.mouseEnabled = true;
e.target.useHandCursor = true;
And things along those lines... but I'm missing something.
Thanks.
UseHandCursor()?
i have this simple code
Code:
p_innerObj.addEventListener(MouseEvent.MOUSE_UP, p_onMouseUp);
works great function is called and everything... but... HOW do i get the hand cursor to show up on this?
i looked it up and found this..
flash.display.SimpleButton.useHandCursor
does this mean i HAVE to create a SimpleButton to use the hand cursor?
thanks in advance!
Help With 'useHandCursor'...
I will try to explain this as clearly as possible, and I have also uploaded a sample file if you want to see what's going on.
I have a project where there will be a masked movie clip on my main timeline. This MC will only move side to side when a user clicks a button on eother side of the MC. The result will be a side scrolling gallery. It works fine, but the button 'hand' cursor needs to be gone when you are at one far end or the other. I can figure out how to ALWAYS turn it off, but not just only on the one frame where it's needed. Currently the MC has this AS in its instance on the main timeline:
Code:
onClipEvent (enterFrame) {
if (_root.pressedRight) {
this.nextFrame();
} else if (_root.pressedLeft) {
this.prevFrame();
} else {
this.stop();
}
}
And the left control button has this code:
Code:
on (rollOver) {
useHandCursor = false;
}
on (press) {
pressedLeft = true;
}
on (release) {
pressedLeft = false;
}
on (dragOut) {
pressedLeft = false;
}
The code for the right button is identical except every 'Left' value is replaced with 'Right'
If you look at the files you will see there are right and left buttons IN the MC, but these purposely don't have any actions, they are just to provide the visual reference on where to click, they could actually just be graphics, and will be in my final files. The actual triggering buttons lie on top of the MC instance in the main timeline.
Just to be really clear on what i WANT it to do is I want both triggering buttons to have the hand cursor except when the MC is at the begining frame (for the left button), and the end frame (for the right button). I think the buttons just need an if/else statement based on the position of the MC, I just don't know how to accomplish this. MUCH THX in advance for any help!
UseHandCursor & ID3
Hi all, I've two questions:
1) I need to use my_btn.useHandCursor = false; on over than 10 buttons. Instead of defining it 10 times I want to define it one time like _global.style.setStyle but it doesn't work.
Someone know if I can or not and what is the command?
2) Someone know if Sound.ID3 works on streaming files?
Thanks to all
New MX Button._name Property Problem
I've spent hours and hours trying to solve this. I can usually find answers to my questions by searching the existing posts, but this time I can't find any reference to this.
I have a button called Gbutton. It has an instance name of Abandonment. I also have an xml file from which I want to get an expression and load it into a dynamic text field.
This is the line of code that I have been trying to use to get the correct expression from the xml file:
if(terms[i].id == Gbutton._name)
Gbutton._name is supposed to return the instance name of Gbutton, but it doesn't.
If I manually insert the instance name like this:
if(terms[i].id == Abandonment)
The entire thing then works perfectly.
I would really appreciate any help. I have several of these buttons, and I'd hate to have to hard code the instance names into each related actionscript.
Thanks a bunch,
Debbie
Change Property Of Button - No () Instance Name
i want my button to change it's opacity onrelease.
i know i just have to name the instance of the button and then
ActionScript Code:
setProperty("button1", _alpha, "80")
BUT i have like 50 buttons on the page and i'm not planning to name all the instances to be able to catch the property.
- can i do the same with something like
("this", _alpha, "80")
("self", _alpha, "80")
???
please help, me facing naming instances like mad )
Property Inspector - Button Size
I'm just starting out with Flash and have a quick question. When I add a button to the stage and resize it, is it possible to click some button in the Property Inspector to make the button return to its original size? I know I can click Edit > Undo Scale but let's say that's not an option any more because that was 101 changes ago. I don't want to delete my button and bring it back by getting it from the library again. Can I click on something that will resize the size of my button to the size it was when I first added it to the stage?
Cannot Set .text Property Of Txt Field On Button
Hi,
having problems setting the .text property on a textfield that is on a button symbol..
Code:
btn_top.txt_1a.text = "hi";
I copied the textfield on put it straight on the stage and doing this I was able to set the .text property, so I know that the other properties of it are correct - dynamic etc.
btn_top is the instance name of the button.
thanks
This.useHandCursor = False;
this.useHandCursor = false;
I put this code on an invisible button so the cursor doesn't show as a hand It works fine in the player with "test movie", but not when the swf is loaded in the browser in an html page.
Any ideas why?
Usehandcursor Problems
Hi,
I have a movieclip that plays when the mouse rolls over it, and I have made the useHandCursor = false. Now when the movieclip plays, I also want buttons to appear over it and when the mouse rolls over the buttons I want the hand cursor to appear.
I've tried putting the buttons in the movieclip and putting moviename.buttonname.useHandCursor = false, but that's not working. And if I put the buttons in a separate movie clip and just put that on top of the first movieclip on the stage, the first movieclip stops playing when I roll over the buttons.
Does anyone have any ideas on how to make the hand cursor appear *only* when the buttons are rolled over and not appear over the entire movie clip?
thanks,
nitakt
UseHandCursor For All Clips?
Hey Folks,
I'm using Flash MX 2004 prof. I want to apply '..useHandCursor = false;'
to all of the clips in my movie. Do I have to set this for every movie
clip in my movie individually, or is there a way to set this property
for all clips all at once?
I've tried
_root.useHandCursor = false;
_root.classificationMenu.useHandCursor = false;
Neither works. It does work, though, when I reference a specific clip...
Thanks,
Tripp Lowe
UseHandCursor Problem
Hi guys. Having a problem with a flash document: when I have my web page with the swf opened, ALL the links (including from other pages that might be simultaneously opened) seems to turn the mouse a bit crazy...
Check out: http://www.mentalfactory.com/carina/asd/contactos.asp
So, try to get the mouse over any link from that or any other page...
Sure I have several verifications for the useHandCursor true or false, in onEnterFrame's... is that a problem? Well, but I always make it "if hitTest the _root" or something. I don't understand...
Thanks
UseHandCursor Problem
I'm loading an external jpeg into an empty movieclip and would like the handCursor to appear when the user rolls over the movieclip. I've tried the following code with no success:
ActionScript Code:
onClipEvent (mouseMove) {
if (hitTest(_root._xmouse, _root._ymouse)) {
this.useHandCursor = true;
trace("mouse over")
}
}
The trace works but handCursor does not change from the arrow to the hand.
How To Get UseHandCursor To Work?
i got an MC named btn
and this code:
ActionScript Code:
btn.addEventListener(MouseEvent.CLICK,wasa);
btn.useHandCursor=true;
function wasa(e:Event):void
{
trace("[ressrdf");
}
and the cursor does not change!!!! why?
UseHandCursor Over A MovieClip
hello everyone,
Is useHandCursor = true possible somehow over the MovieClip? My problem is that i have a script, that changes the text inside the button. But when i change type of the button to Button, i cannot acces the TextField inside this button. When using a MovieClip, then textField is accessable, but overing button with mouse, doesn't give a cursor change!
Any help would be much appreciated.
Tanks in advance!
Universal UseHandCursor
Hi
Is it possible to set useHandCursor = false for all movies within a site (inc. external movies) rather than setting it for each instance?
thanks
Curtis
UseHandCursor Is Not Working...
Hi,
I have created a custom cursor. All works fine in navigating within the flash movie. I have a button that links to an external website. When the mouse is moved over it, I don't want the hand cursor to appear. I have tried button.useHandCursor = false; in every way and place that I could but that hand is still there. What shall I do?
Thanks in advance.
P.S: Please don't be too complex in instructions, I am not even a newbie to scripting...
UseHandCursor - Not Working
Hello all.
I have a movie clip on the main time line. Nested in that movie clip is a button. I don't want the had cursor to show, and I am unable to make it so.
I've tried the following:
button.useHandCursor = false; //action frame on _ root main time line
MCInstanceName.button.useHandCursor = false; //action frame on _ root main time line
this.useHandCursor = false; //this AS was attached to the button itself
Am I missing something simple?
this.useHandCursor = false;
UseHandCursor And StopDrag
Hope this is an easy one, I have an mc which is moveable (startDrag) and a mouse listener that detects if _xmouse has passes a certain co-ordinate, if it does then I tell the mc to stopDrag. Part of the moveable mc can extend beyond that point and If the user continues to drag the hand cursor persists despite me asking otherwise, even tried to delete the onPress event.
Thanks
Mikeb
Attach Code
var isMoving:Boolean = false;
target_Mc.onPress = function() {
this.startDrag();
};
target_Mc.onRelease = function() {
this.stopDrag();
};
var mouseListener:Object = new Object();
mouseListener.onMouseDown = function() {
isMoving = true;
};
mouseListener.onMouseMove = function() {
if (isMoving == true && _xmouse>=370) {
//delete target_Mc.onPress;
target_Mc.stopDrag();
target_Mc.useHandCursor = false; //this doesn't work until the cursor is dragged out of target_Mc
updateAfterEvent();
}
};
Mouse.addListener(mouseListener);
UseHandCursor To A Sprite
Hi,
I got a Sprite and I want to enable the hand cursor when rollover like a stardar button,
I try sprite_name.useHandCursor = true; but I think that only works for a SimpleButton
Cheers
rS
Problem With UseHandCursor?
I have a number of buttons I am using to trigger certain actions, however I do not want the handcursor to show up when the mouse is over these buttons.
I am using:
PHP Code:
but1.useHandCursor = false
but2.useHandCursor = false
but3.useHandCursor = false
but4.useHandCursor = false
but5.useHandCursor = false
but6.useHandCursor = false
but7.useHandCursor = false
but8.useHandCursor = false
but9.useHandCursor = false
but10.useHandCursor = false
but11.useHandCursor = false
but12.useHandCursor = false
but13.useHandCursor = false
but14.useHandCursor = false
but15.useHandCursor = false
but16.useHandCursor = false
but17.useHandCursor = false
but18.useHandCursor = false
each of the buttons has been named correctly and they are all set as menu items, help me out!
thanks!
UseHandCursor = False; ?
My first post is question
How to move HandCursor from button? i have the code:
Quote:
myButton.useHandCursor = false;
but i dont know where to put it?
I tried in Layer 1 and (blank) Layer 2 , nothing happens.
Problem With UseHandCursor
hi all,
does anyone know whats wrong with this piece of code. i have a text field within a movieclip and i would like the hand cursor to show when the mouse passes over it. but the hand won't show, i'm not sure if the text field is influencing the outcome.
thanks for any help
Quote:
var mc:MovieClip = new MovieClip();
mc.useHandCursor = true;
addChild(mc);
var printfield:TextField = new TextField();
printfield.border= true;
printfield.selectable = false;
mc.addChild(printfield);
UseHandCursor On Non-Sprites
I haven't been able to figure out through my searches how I can enable the hand cursor on objects that are not Sprites or MovieClips or SimpleButtons. I have a List component and now matter what I have tried I can't get that friendly hand mouse icon to appear. Same thing goes with TextField objects, they can't seem to accept a hand cursor on mouse over.
Is there a simple way I can do this for either of those situations?
|