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




Mimic Button's Behavior With MC And Keyboard



In an application driven by keyboard only, I would like to mimic the behavior of buttons...with movieclips!
That means to have the equivalent of the "over","selected" and "unselected" states.
Plus, I would like the MC to trigger an action when it's in the selected state.
To finish, I need a way to "speak" to the buttons...so that I can set it to its last state when recalled later.

What I did for now is:
Group the buttons belonging to the same familly in one and only button.
This button contains as many frames than buttons in the "familly", each frame corresponding to the "selected" state of the button.
(it'll be more clear with the file joined here ;-)
So, for example, my button1 actually contains the representation of 2 buttons: on & off. On frame 1 the button "on" is drawn as selected..and on frame 2 the button "off" is drawn as selected.
That way, it's simply a matter of telling goto(1) to have button "on" selected..and goto(2) to have button "off" selected.

I navigate through set of buttons with an array (going up and down with the arrow keys to move through the sets).

The problem IS: I would like to have a "over" state, giving me a feedback of where I am in my button's set.
So, I think that I would need a system where I can browse through the buttons and have a visual feedback of it.
Then, use another key on the keyboard that would select(unselect) the button..and doing the inverse with the other buttons of the set.

Please would you have an idea..or adaptation of my idea to help me?

Thanks very much!

Code:
var myMap:Array = new Array("btn0", "btn1");
var lenghtmenu:Number = myMap.length;
var posmenu:Number = 0;
//
function menuDown() {
// Left
if (Key.getCode() == 37) {
menu[myMap[posmenu]].prevFrame();
}
// Right
if (Key.getCode() == 39) {
menu[myMap[posmenu]].nextFrame();
}
// Up
if (Key.getCode() == 38 && posmenu-1>=0) {
posmenu--;
}
// Down
if (Key.getCode() == 40 && posmenu+1<lenghtmenu) {
posmenu++;
}
}
var keyListener:Object = new Object();
keyListener.onKeyDown = menuDown;
Key.addListener(keyListener);
please mail to jayme65@gmail.com to receive the fla..Thanks



Ultrashock Forums > Flash > ActionScript
Posted on: 2006-07-26


View Complete Forum Thread with Replies

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

Mimic Button's Behavior With MC And Keyboard
In an application driven by keyboard only, I would like to mimic the behavior of buttons...with movieclips!
That means to have the equivalent of the "over","selected" and "unselected" states.
Plus, I would like the MC to trigger an action when it's in the selected state.
To finish, I need a way to "speak" to the buttons...so that I can set it to its last state when recalled later.

What I did for now is:
Group the buttons belonging to the same familly in one and only button.
This button contains as many frames than buttons in the "familly", each frame corresponding to the "selected" state of the button.
(it'll be more clear with the file joined here ;-)
So, for example, my button1 actually contains the representation of 2 buttons: on & off. On frame 1 the button "on" is drawn as selected..and on frame 2 the button "off" is drawn as selected.
That way, it's simply a matter of telling goto(1) to have button "on" selected..and goto(2) to have button "off" selected.

I navigate through set of buttons with an array (going up and down with the arrow keys to move through the sets).

The problem IS: I would like to have a "over" state, giving me a feedback of where I am in my button's set.
So, I think that I would need a system where I can browse through the buttons and have a visual feedback of it.
Then, use another key on the keyboard that would select(unselect) the button..and doing the inverse with the other buttons of the set.

Please would you have an idea..or adaptation of my idea to help me?

Thanks very much!

Code:
var myMap:Array = new Array("btn0", "btn1");
var lenghtmenu:Number = myMap.length;
var posmenu:Number = 0;
//
function menuDown() {
// Left
if (Key.getCode() == 37) {
menu[myMap[posmenu]].prevFrame();
}
// Right
if (Key.getCode() == 39) {
menu[myMap[posmenu]].nextFrame();
}
// Up
if (Key.getCode() == 38 && posmenu-1>=0) {
posmenu--;
}
// Down
if (Key.getCode() == 40 && posmenu+1<lenghtmenu) {
posmenu++;
}
}
var keyListener:Object = new Object();
keyListener.onKeyDown = menuDown;
Key.addListener(keyListener);

Mimic Button's Behavior With MC And Keyboard
In an application driven by keyboard only, I would like to mimic the behavior of buttons...with movieclips!
That means to have the equivalent of the "over","selected" and "unselected" states.
Plus, I would like the MC to trigger an action when it's in the selected state.
To finish, I need a way to "speak" to the buttons...so that I can set it to its last state when recalled later.

What I did for now is:
Group the buttons belonging to the same familly in one and only button.
This button contains as many frames than buttons in the "familly", each frame corresponding to the "selected" state of the button.
(it'll be more clear with the file joined here ;-)
So, for example, my button1 actually contains the representation of 2 buttons: on & off. On frame 1 the button "on" is drawn as selected..and on frame 2 the button "off" is drawn as selected.
That way, it's simply a matter of telling goto(1) to have button "on" selected..and goto(2) to have button "off" selected.

I navigate through set of buttons with an array (going up and down with the arrow keys to move through the sets).

The problem IS: I would like to have a "over" state, giving me a feedback of where I am in my button's set.
So, I think that I would need a system where I can browse through the buttons and have a visual feedback of it.
Then, use another key on the keyboard that would select(unselect) the button..and doing the inverse with the other buttons of the set.

Please would you have an idea..or adaptation of my idea to help me?

Thanks very much!

Code:
var myMap:Array = new Array("btn0", "btn1");
var lenghtmenu:Number = myMap.length;
var posmenu:Number = 0;
//
function menuDown() {
// Left
if (Key.getCode() == 37) {
menu[myMap[posmenu]].prevFrame();
}
// Right
if (Key.getCode() == 39) {
menu[myMap[posmenu]].nextFrame();
}
// Up
if (Key.getCode() == 38 && posmenu-1>=0) {
posmenu--;
}
// Down
if (Key.getCode() == 40 && posmenu+1<lenghtmenu) {
posmenu++;
}
}
var keyListener:Object = new Object();
keyListener.onKeyDown = menuDown;
Key.addListener(keyListener);

Mimic Button's Behavior With MC And Keyboard
In an application driven by keyboard only, I would like to mimic the behavior of buttons...with movieclips!
That means to have the equivalent of the "over","selected" and "unselected" states.
Plus, I would like the MC to trigger an action when it's in the selected state.
To finish, I need a way to "speak" to the buttons...so that I can set it to its last state when recalled later.

What I did for now is:
Group the buttons belonging to the same familly into one and only button.
This button contains as many frames than buttons in the "familly", each frame corresponding to the "selected" state of the button.
(it'll be more clear with the file joined here ;-)

So, for example, my button1 actually contains the representation of 2 buttons: on & off. On frame 1 the button "on" is drawn as selected..and on frame 2 the button "off" is drawn as unselected.
That way, it's simply a matter of telling goto(1) to have button "on" selected..and goto(2) to have button "off" selected.

I navigate through set of buttons with an array (going up and down with the arrow keys to move through the sets).

The problem IS: I would like to have a "over" state, giving me a feedback of where I am in my button's set.
So, I think that I would need a system where I can browse through the buttons and have a visual feedback of it.
Then, use another key on the keyboard that would select(unselect) the button..and doing the inverse with the other buttons of the set.
Please would you have an idea..or adaptation of my idea to help me?
Thanks very much!

Code:
var myMap:Array = new Array("btn0", "btn1");
var lenghtmenu:Number = myMap.length;
var posmenu:Number = 0;
//
function menuDown() {
// Left
if (Key.getCode() == 37) {
menu[myMap[posmenu]].prevFrame();
}
// Right
if (Key.getCode() == 39) {
menu[myMap[posmenu]].nextFrame();
}
// Up
if (Key.getCode() == 38 && posmenu-1>=0) {
posmenu--;
}
// Down
if (Key.getCode() == 40 && posmenu+1<lenghtmenu) {
posmenu++;
}
}
var keyListener:Object = new Object();
keyListener.onKeyDown = menuDown;
Key.addListener(keyListener);

Mimic Button's Behavior With MC And Keyboard
In an application driven by keyboard only, I would like to mimic the behavior of buttons...with movieclips!
That means to have the equivalent of the "over","selected" and "unselected" states.
Plus, I would like the MC to trigger an action when it's in the selected state.
To finish, I need a way to "speak" to the buttons...so that I can set it to its last state when recalled later.

What I did for now is:
Group the buttons belonging to the same familly in one and only button.
This button contains as many frames than buttons in the "familly", each frame corresponding to the "selected" state of the button.
(it'll be more clear with the file joined here ;-)
So, for example, my button1 actually contains the representation of 2 buttons: on & off. On frame 1 the button "on" is drawn as selected..and on frame 2 the button "off" is drawn as selected.
That way, it's simply a matter of telling goto(1) to have button "on" selected..and goto(2) to have button "off" selected.

I navigate through set of buttons with an array (going up and down with the arrow keys to move through the sets).

The problem IS: I would like to have a "over" state, giving me a feedback of where I am in my button's set.
So, I think that I would need a system where I can browse through the buttons and have a visual feedback of it.
Then, use another key on the keyboard that would select(unselect) the button..and doing the inverse with the other buttons of the set.

Please would you have an idea..or adaptation of my idea to help me?

Thanks very much!

Code:
var myMap:Array = new Array("btn0", "btn1");
var lenghtmenu:Number = myMap.length;
var posmenu:Number = 0;
//
function menuDown() {
// Left
if (Key.getCode() == 37) {
menu[myMap[posmenu]].prevFrame();
}
// Right
if (Key.getCode() == 39) {
menu[myMap[posmenu]].nextFrame();
}
// Up
if (Key.getCode() == 38 && posmenu-1>=0) {
posmenu--;
}
// Down
if (Key.getCode() == 40 && posmenu+1<lenghtmenu) {
posmenu++;
}
}
var keyListener:Object = new Object();
keyListener.onKeyDown = menuDown;
Key.addListener(keyListener);

Mimic Button's Behavior With MC And Keyboard
In an application driven by keyboard only, I would like to mimic the behavior of buttons...with movieclips!
That means to have the equivalent of the "over","selected" and "unselected" states.
Plus, I would like the MC to trigger an action when it's in the selected state.
To finish, I need a way to "speak" to the buttons...so that I can set it to its last state when recalled later.

What I did for now is:
Group the buttons belonging to the same familly in one and only button.
This button contains as many frames than buttons in the "familly", each frame corresponding to the "selected" state of the button.
(it'll be more clear with the file joined here ;-)
So, for example, my button1 actually contains the representation of 2 buttons: on & off. On frame 1 the button "on" is drawn as selected..and on frame 2 the button "off" is drawn as selected.
That way, it's simply a matter of telling goto(1) to have button "on" selected..and goto(2) to have button "off" selected.

I navigate through set of buttons with an array (going up and down with the arrow keys to move through the sets).

The problem IS: I would like to have a "over" state, giving me a feedback of where I am in my button's set.
So, I think that I would need a system where I can browse through the buttons and have a visual feedback of it.
Then, use another key on the keyboard that would select(unselect) the button..and doing the inverse with the other buttons of the set.

Please would you have an idea..or adaptation of my idea to help me?

Thanks very much!
Code:

var myMap:Array = new Array("btn0", "btn1");
var lenghtmenu:Number = myMap.length;
var posmenu:Number = 0;
//
function menuDown() {
   // Left
   if (Key.getCode() == 37) {
      menu[myMap[posmenu]].prevFrame();
   }
   // Right         
   if (Key.getCode() == 39) {
      menu[myMap[posmenu]].nextFrame();
   }
   // Up         
   if (Key.getCode() == 38 && posmenu-1>=0) {
      posmenu--;
   }
   // Down         
   if (Key.getCode() == 40 && posmenu+1<lenghtmenu) {
      posmenu++;
   }
}
var keyListener:Object = new Object();
keyListener.onKeyDown = menuDown;
Key.addListener(keyListener);

please send email to mailto:jayme65@gmail.com to receive the fla..Thanks

How Do I Get A Button To Mimic A Keyboard Shortcut?
I want a button in my flash movie to toggle the zoom in function of the context menu that pops up when you right click a movie. Please HELP!

How Do I Get A Button To Mimic A Keyboard Shortcut?
I want a button in my flash movie to toggle the zoom in function of the context menu that pops up when you right click a movie. Please HELP!

Peculiar Movie Clip Behavior (or Button Behavior?)
Hmm. Weird. My movie clip menu behaves in a peculiar way.

My menu is built like a movie clip, and the buttons inside have regular button behavior. The menu rolls down on roll over and back up on roll out, and the buttons have the regular roll over behavior as well. All this works fine. Now comes the peculiar.

All buttons have the same code, which links to a different frame on the mainstage – except one button that link to an external URL. This button is the only one that works. Okay, so I know as much as there’s a spook lose in link land – I just can’t nail him. When I click the buttons, the menu just jumps up – not rolls up as it should, but jumps like it’s been reset. It doesn’t reset the entire scene, though, because another movie in the same frame keeps on playing.
Please help….!

Following code handles the movie clip from the mainstage:

onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
if (this._currentframe<this._totalframes) {
nextFrame();
}
} else {
if (this._currentframe>1) {
prevFrame();
}
}
}

Following code is placed in the first frame of the only button that works:

this.btn_butik.onRelease = function() {
getURL("myurl", "_blank");
};

And following is placed in the first frame of the other buttons:

this.btn_inspiration.onRelease = function () {
gotoAndPlay("scene_main", "page_inspiration");
}

I haven’t used the onClipEvent before this, so I might be missing something there.

Hope you can help

Button Script To Mimic Incoming Html Code? Help
tricky...

A friend helped me build a script for a nav that allows the html page to direct the playhead in the .swf to go to a frame label. The variable name is navSect, and whenever we load an html page, we put in a script to call a frame label. The actionscript in the flash file looks like this:

if (navSect_in != "") {
_global.navSect = navSect_in;
_root.main.gotoAndStop(_global.navSect);
}

NOW... what I would like to do next is have an invisible button in the nav achieve the same result. is there any way to do this? my scripting is poor, but I imagine it would have to relate: "on mouse rollover, IF navSect has been invoked, cause the identical action to occur."

sounds damn tricky to me, but you bad boys (and girls) always amaze...

thanks,
jason

How To Mimic "focus Frame" Effect With Button?
I am trying to create some sort of focus frame effect on an image. I created a retangle shape button with no fill color inside. Then I attached the button on the image. The problem is, the button becomes clickable only when user touches the BORDERS. (The entire button area would be clickable if it is filled with color, but then it would block the image behind the button. ) Is there a way to get around this, so that only 4 borders of the button would display, and the entire button area would be clickable? I appreciate any help!

Button Behavior.........
I'm fairly new to Flash and have a quick question for you guys...........

I'm trying to build a button panel...
I already have the buttons built with all 4 states. Up, Over, Down and Hit

Up- Button not light up
Over- Button lit up
Down-Button Plays animation with a FlashBulb effect........
Hit-Same as Up

All works fine besides for me to get the animation on the Down state to play I have to Hold the mouse button down and also the animation loops.

I just want it to play the animation only once on Press or Release without having to hold the mouse button down...

any ideas guys???

tia!!

carbon

AS3 On Button Behavior
I'm a student designing the portfolio interface for my senior class site and have a question about button behavior. I've built a name line (that resembles a subway map) to serve as the navigation to each student's portfolio movie clip in the timeline.

I can make the navigation function properly, but I want to figure out a way to make the individual name-button stay in the DOWN state as long as that person's portfolio movie clip is being viewed (even after mousing out), then change back to the UP state when another name-button is clicked.

The name-buttons are currently built as button symbols for simplicity, but I would have no problem changing them to movie clips if that helped with the solution.

Architecturally, the Portfolio page is a movie clip with three layers: navigation (a movie clip with the 19 student name-buttons), student work (all 19 individual portfolio movie clips spaced out in the timeline), and actions. Again, I want to click on a name-button within the nav mc to move to a student's portfolio and have that button stay in the DOWN state until clicking on another.

Button Behavior?
I have a 2 questions about button behavior.
I am working on a pretend banner for casino. five face down cards appear and work like five buttons. When mouse goes over a card (button), a question mark appears on the face down card. When mouse is clicked and released, I would like the face up card to stay faced up.
At this point, the face up card only appears while mouse is depressed, and face down card comes back after the mouse is released. How do
I make face up card remain?
Also, after all five cards have been clicked to face up, I would like WINNER to appear briefly before the user is linked to another page. This sounds more complicated and will probably require code like "if card1up and card2up and card3up and card4up and card5up then display winner and load new page"
Is there anyone so kind as to give me some hints on the best way to accomplish these things? Thank you very much - ACurtis

Wierd Behavior With SortOn (not That Numeric Sort Behavior)
NOTE: I have read a bunch of posts about sorting on numbers with the sortOn function and having 10 come before 2 but this isnt one of those posts.

I have an array of Objects that I created from an xml document.. I'm trying to output all the names in alphabetical order but i'm getting some wierd behavior.. it works for the most part until the end.. it then gives me a few "out of order" names.

when i switch around the order of the xml file it gives me different results after the sort...

Any help would be greatly appreciated!!!


(ive attached a folder with the .fla, .xml and .as files)
------------------------
the .fla code is:
------------------------
myXML = new XML();
myXML.ignoreWhite = true;
var myClassInstance = new MyClass();
myXML.onLoad = function(success) {
myClassInstance.populateArray(myXML);
};
myXML.load("people.xml");

------------------------
the .as code is:
-------------------------
class MyClass {
var peopleArray:Array = new Array();
public function MyClass() {
}
private function populateArray(_xmlData):Void {
var i:Number;
for (i=0; i<_xmlData.firstChild.childNodes.length; i++) {
peopleArray[i] = new Object();
peopleArray[i].id = parseInt(_xmlData.firstChild.childNodes[i].attributes.id);
peopleArray[i].personName = _xmlData.firstChild.childNodes[i].childNodes[0].firstChild.nodeValue;
}
sortAndOutput();
}
public function sortAndOutput() {
var sortedPeopleArray:Array = peopleArray;
sortedPeopleArray.sortOn("personName", Array.DESCENDING);
var i:Number;
for (i in sortedPeopleArray) {
trace(sortedPeopleArray[i].personName);
}
}
}

-------------------------
.xml (excperpt from the file)
------------------------
<?xml version="1.0" encoding="iso-8859-1"?>
<people>
<person id="3">
<person_name>Donna</person_name>
</person>
<person id="4">
<person_name>Lisa</person_name>
</person>
<person id="5">
<person_name>John</person_name>
</person>
<person id="6">
<person_name>Lara</person_name>
</person>
..... more rows....
</people>

Mystery Behavior Of A Button?
I've created a game with (rollover) buttons everywhere. The game looks like professional, although is made with this "not so professional method".... but... I have a problem.

I have a draggable character MC that starts following mouse on (enterframe). The game works like this: I have to rollover to soldiers that appear several times in random. this way I get score.

If I rollover OUTSIDE a marked way, a cannon bomb falls over me and I loose a life.

Here's the problem: I have just to click once to start dragging my clip of the hero, but people not used to play, keeps the mouse PRESSED all time... and in this condition, ANY rollover works.... and you can go anywhere outside the way without dying and without killing soldiers.


Is this an unbreakable rule of flash or there's any way to stop the pressing mouse action or consequence???????

thanks

DuplicateMovieClip And Button Behavior
In MX
I'm creating a series of thumbnail images that when clicked open a description of the image.
I'm using:

duplicateMovieClip(thumbSubProduct, "thumbSubProduct"+z, z);
To create my thumbnails.

At least that's what I'm trying to do. And I can't get the button behavior to work.

I have tried:
onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse, _root._ymouse, true)) {
CurrentThumbButton = this._name;
}
if (!this.hitTest(_root._xmouse, _root._ymouse, true)) {
}
}

Also tried: onClipEvent (mouseUp) {
I also tried putting a button inside the movieclip. No go.

I can't:
1: get a unique name from the movieclip when I mouseover the movieclip. When I do a trace it gives me the names of all the dynamic movieclips.

2: Simply call a function

So I can't get button behavior to work at all with my dynamic movieclips.

Strange Button Behavior.
Hi again,

my button behaves strange in a movie. Sometimes it takes action after one mouse click, sometimes user has to klick it twice to get an effect. Button has action:

on (press) {
gotoAndPlay (180);
}

Do you have any idea, what can be wrong?
I`m getting mad, by trying to find what`s happening with it..

Nerijus.

Automating Button Behavior
I have about 20 navigation buttons, all of which have similar behaviors when they are rolled over and clicked on. On rollover, a white square appears behind the image to show it is 'highlighted.' And when the button is clicked, the white square remains with an additional black border around the square. Simple, right ?

Is there a way to do this dynamically with Actionscript ?

Weird Button Behavior
I'm currently working on something and for the life of me I can't figure out how to solve some problems I am having with my navigation buttons. I'm assuming there is a simple solution, I just have pulled out my hair way too much to figure it out. Maybe it has something to do with the textscroll or the loaded variable text file that has goofed up the buttons. I'm not sure. What happens, is that when you move the mouse over the links, the buttons flash rapidly. They are just supposed to light up in color, and the text is supposed to pop up and stay that way until you remove the cursor, not flash like a millions times a second. I have attached the FLA I am working with..if anyone has any suggestions it would be appreciated.

Thanks.

[F8] Adding Button Behavior On The Fly
Hi all,
Can anyone suggest the best way to approach the following?
I currently am trying to load an array of movieclips (one on top of the other):

Code:
createEmptyMovieClip("content_holder_mc", this.getNextHighestDepth());
content_holder_mc._x = 21
content_holder_mc._y = 121

for (var i = 0; i<return_query.length; i++) {
content_holder_mc.attachMovie("blueMovie", "blue"+i, content_holder_mc.getNextHighestDepth(), {_y:content_holder_mc._height+5, _x:5+i});
}

This all works fine however is there away of adding an onRelease method to the newly attached movieclips rather than adding the code inside the movieclip itself?

Cheers

Inconsistent Button Behavior
howdy folks,

can anyone take a look at the attached file and advise me on this issue: as you rollover the 4 squares, they are supposed to grow and keep their proportionate position within the menu. that works fine

problem is sometimes rollOverisn't calling the _rollOver function, and then sometimes it's the rollOut that doesn't fire.

i've tried a few different methods for triggering the roll behaviors, but this one is the most concise and should work as far as i can tell.

some of the other methods are still in commented code...
this .fla is a CS3 file.

thanks!

[cs3][as2] Menu Button Behavior
hey guys,
any idea how to program a movie clip to behave like a menu button?
if you press down on a button on a menu, you can drag your cursor down to select another item on the menu without releasing, and that second item will become highlighted and react to the onRelease instead.
Is there any way to imitate this behavior with a movie clip, short of using onEnterFrame?
I feel like using an onEnterFrame would be kind of ugly and add unnecessary memory usage... then again I just have no idea how much an onEnterFrame function on a list of buttons would cost in terms on memory usage...

Convert MC To Button Behavior?
Wow, this is a little trickier than i thought it was going to be...
Here's what i've tried:

PHP Code:



TL.createEmptyMovieClip("tn" + i0 + i1,TL.getDepth() + i0 + i1);
TL["tn" + i0 + i1]._x = xpos;
TL["tn" + i0 + i1].width = 100;
TL["tn" + i0 + i1].height = 100;
TL["tn" + i0 + i1].loadMovie(".." + thumb);
TL["tn" + i0 + i1].hitArea = TL["tn" + i0 + i1];
TL["tn" + i0 + i1].useHandCursor = true;




But that doesn't seem to be what i need to be doing. Any tips?

Thanx.

Button Behavior In Loaded Swf
Okay, this is probably an easy one for a none newbie. What I have is main.swf which holds the main navigation movieclip, the main navigation movieclip calls various external movies in level2. When the main.swf file is visited it automatically plays an extermal swf file in my mc_content which is left of the navigation movie clip (it gives visitors some thing to look at).

code for the main buttons areuses var level method)
on (press) {
loadMovieNum("terrier.swf", _root.Level);
_root.Level+=2
}

when someone clicks on a button the external movie replaces the mc_content
and any thing in it.

Okay, so terrier.swf loads --- no problem. Once it loads the terrier.swf has buttons to take them further into what is in this movie file. This movie file is to present art for terrier breeds. So a button within the terrier.swf when clicked should go to an instant name "ratterrier" and then the ratterrier frame has a button to go back to the main breed selection navigation. It is all set up in the _root, no other movieclip inside terrier.swf.

I thought the simple behavior like this would work but it does not on the simulated download / or actually live on line of the main.swf with the loaded terrier.swf:

on (release) {

//Movieclip GotoAndStop Behavior
this.gotoAndStop("ratterrier");
//End Behavior

}

Do I need to use level variables within the loaded external movies too? I did a trace and the trace tells me terrier.swf is in level12 with undefined.

Thanks for any help?
http://www.puppydreamers.com/home.swf

Button Weird Behavior
I have a button (inside a MC that is in a masked layer) with the next code

on (rollOver) {
_parent.forw = true;
}
on (rollOut) {
_parent.forw = false;
}
on (release) {
loadMovieNum("contact.swf",5);
trace ("Hi");
}

The weir thing is that the button response well for the rollOver and rollOut events, but does not do anything with the release event...

Any clue...

Is the first time that I see this

Button Behavior Problem
Hi guys!

I am having a basic problem with button behavior and I am sure someone will
be able to help me!
What I want to create is a button that on the MouseOver state, a jigsaw
puzzle piece will raise (this part I got it), however on the MouseOut part I
am having a problem.
Please see the link and the .fla in it.
Thanks!

www.seabox.com.br/filme.zip

Button Behavior Problem
Hi guys!

I am having a basic problem with button behavior and I am sure someone will
be able to help me!
What I want to create is a button that on the MouseOver state, a jigsaw
puzzle piece will raise (this part I got it), however on the MouseOut part I
am having a problem.
Please see the link and the .fla in it.
Thanks!

www.seabox.com.br/filme.zip

HELP -- Strange Button Behavior?
I´m trying to fix a strange bug, when the user presses on an arcade button from the common libraries, the active window where the flash file is playing becomes inactive, hides behind other windows etc.

On the button is a simple, on (press) { _root.somefunction (i) }

any ideas??????

Simple Button Behavior
Hi All,
I feel this is such a simple issue yet I cannoth find anything on it. I do not understand why I cannot get a created button to behave like a component button with listeners. Due to the created button the size of the .fla file exceeds the forum limit so if you are interested in this please email me and I will forward it to you, about 750 kb. There is something I am missing.
Here is the simple code:

// create a listener object for the Submit button
// this is a component button
btnSubmitListener = new Object();
// register the submit button listener listen for the click events
btnSubmit.addEventListener("click",btnSubmitListen er);
btnSubmitListener.click = function(){
// user clicked the submit button

checkboxStatus.text = "Submit Button pressed";
}
//++++++++++++++++++++++++++++++++++++++++++++++++++ +++++
// create a listener object for the Trace button
// this is a created button
btnTraceListener = new Object();
// register the submit button listener listen for the click events
btnTrace.addEventListener("click",btnTraceListener );
btnTraceListener.click = function(){
// user clicked the submit button

checkboxStatus.text = "Trace button pressed";
}
//++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++++
// create a listener object for the Reset button
// this is a component button
btnResetListener = new Object();
// register the submit button listener listen for the click events
btnReset.addEventListener("click",btnResetListener );
btnResetListener.click = function(){
// user clicked the submit button

checkboxStatus.text = "Reset button pressed";
}

In my final application I guess I could place my code in the button action but everything else I am inputting is done with listeners and there are upgrades to come that will work better that way too. I have tried the Broadcast method but not been successful with that either. Any help would be greatly appreciated.
Russell

Convert MC To Button Behavior?
Wow, this is a little trickier than i thought it was going to be...
Here's what i've tried:

PHP Code:



TL.createEmptyMovieClip("tn" + i0 + i1,TL.getDepth() + i0 + i1);TL["tn" + i0 + i1]._x = xpos;TL["tn" + i0 + i1].width = 100;TL["tn" + i0 + i1].height = 100;TL["tn" + i0 + i1].loadMovie(".." + thumb);TL["tn" + i0 + i1].hitArea = TL["tn" + i0 + i1];TL["tn" + i0 + i1].useHandCursor = true; 




But that doesn't seem to be what i need to be doing. Any tips?

Thanx.

Mouse Behavior Over A Button
Hi flash family. hope you´re ok.
I have a question , hope anyone could help please.
I have a movieclip that follows the mouse pointer and substitutes it , theres no mouse arrow , only the movie clip that i got with easing is following our directions with the pointer . the question is.... Can the movie clip change color or something when i get over a button? , how i get the perfect As for that?
thank you guys
B

Radio Style Button Behavior
Hi, I'm pretty brain drained from this video player project, and a major stumbling block at this point is the following:

I have a List component that is propagated by an XML file with different categories that are instantiated by the user via a series of buttons. So the behavior goes as follows.

User clicks button, button holds highlight, list is propagated, user clicks another button, first button goes dark, second button gets highlight, list is refreshed.

I'm having problems with the first button goes dark part.

Oh wait. I guess I could assign each object to a static array on construction then cycle through that to find the enabled button and dim it.

Well, lets try that. Thanks actionscript.org!

Controlling Button Behavior With Another Button
Is it possible to control the behavior of a button with another button? What I need to do is a have a button go into it's mousover state when I mouseover a different button. Thanks in advance! Bluetech

Button._focurect Disables Also Button Keyboard Access
I'm trying to make my Flash movie keyboard-accessible.
It's a search engine control panel, with a drop list for categories, a textfield and a Search button.

I have set a "halo" effect to enhance the GUI element currently under focus, for both keyboard and mouse interaction.

Everything works fine if I leave the _focusrect active, but it's really ugly and I want to eliminate it.

Unfortunatelly when I set Button._focusrect = false, the buttons recieve focus but are not "pushed" when I press the spacebar (I tried to add Key-specific triggers to a button, but that doesn't work either).

Does anybody know how to help this?

p.s. I already set all the tabIndex stuff...

Use External Data To Affect Button Behavior
I have an external text file called info.txt. Inside it, there is this variable: info=video,resume,press (I want to use this information to know which buttons to disable in my MC).

I load the variable info, then I split the contents and put them into an array using

newArray=info.split(); so that the array contains ("video","resume","press")

What I want to do is then disable the buttons that I have in this movieclip by referencing them from the array.

For example, I want to disable the button with instance name "video" using the data from the array, like this:

newArray[0].enable = false;

But this doesn't work. What's the right way to reference the button?

Thanks.

Scrolling Text - Button Behavior In Flash 4
To start with I'm coding this in MX, but it has to be compatible for flash 4. (client restriction)

I have quite a few pages on this site calling external text files.
The site is here.
http://bigquizthing.com/index2.html

if you click into any of the links you will see the scrolling text.

Let me tell you what I did.
I inserted 4 frames
Frame1: loadVariablesNum("./thetxt.txt", 0);
Frame2: if (text ne "") {
gotoAndStop("end");
}
Frame3:gotoAndPlay("load");
Frame4:stop();

the buttons for the scroll have this behavior:
on (press) {
text.scroll = Number(text.scroll)+1;
}



The problem is the text scrolls 1 click at a time.....normal windows / mac behavior when you hold down a button it scrolls auto.

is there a way to accomplish this in flash 4?
if not, what would you guys do.....I'm not a big fan of mini fonts but I quite a bit of text.

help?
thanks-

Stepon
"bring the noise"

Referencing Loaded External Swf For Button Behavior
Howdy

How does one reference an external swf file that has been loaded into a targeted blank movie clip? Here's the deal. I have several buttons that load external swf and that works fine. I would like to disable and fade back the button if the button's movie has loaded. I can get the buttons to fade and disable but I'd like for them to "come back" after another button is pressed. I just can't figure out how to check if the loaded movie is there.

Any help would be great.
Thanks.

Explain Flash Player Button Behavior.
A new button suddenly appeared on my Flash Player 9.0 control panel which provides some interesting effects(described below).
Question: Is this 'feature' part of the Flash Player 9.0 or did I somehow attach a third party program to it?

Behavior in question:
Button control to the right of the play button on the Flash Player control panel showing three small gray circles arranged in a triangle
with lines connecting the botton two small circles to the top(center) circle.
When the lower left circle of the triangle button (small grey circle) is clicked large circles with inner images appear to float on the screen. As the cursor moves over the screen multiple circle/images appear as floating menu selections.
Each circle/image has a colored border and a tooltip showing the title,rating using stars and video length in mm:ss format. When a particular circle/image is clicked the video begins to play and the colored border color appears in the upper left corner as a large dot of the same color.
Placing the curcor over this colored dot will get its circle/image to reappear in the center of the screen. As videos are played their colors are added to the color dot array(top/left) and thin lines connect each video's image/circles.
This helps with video sequence tracking.

Can you please explain what casues this effect and whether I have any controll over it. Thanks

Get Button Behavior From Externally Loaded Images?
Hello pros,

I am wondering if it is possible to load a .jpg externally with loadMovie(); and have that button-image scale up on mouse over? So far, I can only implement such button behavior with images from the Library. Once the button is clicked then I load a larger image with the loadMovie().
However, I'd like to have quite a few such buttons (20 or so) on a grid in one .swf, and it will be a lighter file if it were possible to have the button images be called externally... without a huge delay.

Is this possible at all?

Thank you for your expertise and help!
apx_ (newbie...)

Best Way To Produce Inertia/heartbeat Behavior For Button/symbol?
Hello!

For a site I'm building, I would like to have the navigational buttons behave with inertia and/or like a heart beating onscreen. For the 'heartbeat' behavior, I guess I could nest the button within a movie clip and just have it loop indefinitely. Is there a simpler way, perhaps with AS?

All feedback welcome.

Thanks!

VicAtomic.

Strange Behavior - Link Text Showing Through Button
I have a menu bar with 4 buttons. When I added links to the buttons, two of them let the link text show through the buttons (not desired), the other two do not (as should be). I can see nothing different about the two buttons in the center. Here is the result:

SOLVED: I don't know why, but for some reason earlier when I switched the location of the two buttons on the menu bar, or perhaps when I added the link action script, a text box with the link text in it got added to the movie itself.

Trying To Mimic Something
well im pretty darn new in flash, just about all i can do is draw circles, create buttons, and some very very minor actionscripting. but i learn best when i dive into things so i wanna try to mimic these buttons:
http://www.templatemonster.com/flash...ates/5221.html

you see that weird stuff in the background when you put your mouse over the buttons - thats what i wanna try, but i have no idea as to how it was created.

so any help to get me started on this would be appreciated.. or if you think something like this could prove to be too advanced for a newcomer - could you suggest something else to try?

thanks a lot.

Can Button Act As A Keyboard Key?
I have created an interface which copies an ATM machine for some interactive user guides. I am trying to make the buttons (which represent the alpha-numerical keypad) act as pressing a key on the keyboard to input information into a input text field. is there any way this can be done?

How To Mimic SQL With Actionscript?
Hi all,
I'm using dropdown boxes to build a query (SQL) that is then run (iteratively) on a series of XML files. The results are sent to arrays... My problem is that with the technique I'm using (snippets below), the code very quickly gets out of hand!!! Can anyone offer suggestions????

This snippet can handle one "Where" clause:

ActionScript Code:
function executeQuery(xmlObject) {
    ++queryCount;
    //
    switch (where1param) {
    case "month" :
        switch (where2.getSelectedItem().data) {
        case "lessThan" :
            for (var n = 0; n < _root[xmlObject].firstChild.childNodes.length; n++) {
                if (_root[xmlObject].firstChild.childNodes[n].firstChild.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.firstChild.nodeValue < where3param) {
                    populateArraysFromQuery(n, xmlObject);
                }
            }
            break;
        case "equals" :
            for (var n = 0; n < _root[xmlObject].firstChild.childNodes.length; n++) {
                if (_root[xmlObject].firstChild.childNodes[n].firstChild.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.firstChild.nodeValue == where3param) {
                    populateArraysFromQuery(n, xmlObject);
                }
            }
            break;
        case "greaterThan" :
etc...

This snippet can handle two "Where" clauses:

ActionScript Code:
function queryTracks(xmlObject) {
    ++queryCount;
    //
    switch (where1param) {
    case "month" :
        //
        switch (where2param) {
        case "lessThan" :
            //
            switch (where5param) {
            case "defaultValue" :
                //
                //\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\
                alert = "You've asked to select tracks where MONTH < " + where3param;
                //\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\
                //
                for (var n = 0; n < _root[xmlObject].firstChild.childNodes.length; n++) {
                    if (_root[xmlObject].firstChild.childNodes[n].firstChild.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.firstChild.nodeValue < where3param) {
                        populateArraysFromQuery(n, xmlObject);
                    }
                }
                break;
            case "month" :
                //
                switch (where6param) {
                case "lessThan" :
                    //
                    //\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\
                    alert = "You've asked to select tracks where MONTH < " + where3param + " AND... MONTH < " + where7param;
                    //\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\//\
                    //
                    for (var n = 0; n < _root[xmlObject].firstChild.childNodes.length; n++) {
                        if (_root[xmlObject].firstChild.childNodes[n].firstChild.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.firstChild.nodeValue < where3param && _root[xmlObject].firstChild.childNodes[n].firstChild.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.firstChild.nodeValue < where7param) {
                            populateArraysFromQuery(n, xmlObject);
                        }
                    }
                    break;
                    //
                case "equals" :

[as2] Need To Mimic A Menu, Can Someone Help
hi, im new to actionscript and i would like to ask if
anyone knows about this kind of menu?

http://www.wingardh.se/php/flash.html

i need to mimic it. but somehow its too complicated,
i guess it is all objects and arrays, and linkages ..

help is much appreciated... thanks...

About Using Keyboard For Button Operation
hi,
plz help me.
i have a big problem.In my movie i put 3d push buttons with numbers like calculator.while u press button 1 i get digit1 typed in text box.(respctively 2,3,4 etc).
now my problem is that i want to operate these buttons with
numeric keys of keyboard.i have got the numbers typed in text box with the help of keyboard(with script "on keypress)
but i want that the buttons in the movie should also get pressed with keyboard.(i.e. when i press numeric key 1 of keyboard,the key 1 of movie should also get pressed like we do it with mouse click)

so plz help me out it's relly urgent.
waiting for u r positive reply

Button Control By Keyboard
does anyone here know how to control a button by on the release of a keyboard button. like for example, "on "g" down, goto and play 5" That parts easy. Its not even "g" down its just"G". What i want to know is......is there a way to script a button to be controled on the release of a button on the key board like, "on "g" release, goto and play 1.

please someone tell me if i made any sence.

Same Keyboard Button Does Different Things
Here is what I need the code for:

if "F1" is pressed then the "0" key goes to and stops at frame 2.

if "F2" is pressed then the "0" key goes to and stops at frame 3.

if "F3" is pressed then the "0" key goes to and stops at frame 4.

Idealistacally, the F1, F2, and F3 keys would only have to be pressed once and not held down in order to change the actions of the "0" key.

If anyone knows how to code this, I would be very appreciative, because I am awful at action scripting!

Can You Have A Button Run A Keyboard Command
I am using flash 5. And I am making a new frontend for my windows98 using flash 5 as a projector AKA(exe) Now I have it working for and .exe for a button. Like I can run windows explorer from a button. My question is can I use a button to run a keyboard command so I can use it to open my start menu? Ctrl + esc keys

Thanks for any help. if you need my file let me know.
Therau

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