Hello All - thanks for the interesting input. For those who DO want to enable the RollOver and RollOut functionality, I did finally get it working - and all using code that already existed within the SimpleButton.as file.
If you open up the file, and scroll way to the bottom, there are in fact "onRollOver" and "onRollOut" functions defined - but only for the purpose of broadcasting the signal to turn the Halo Effect on and off when hovering the mouse over. All I added was the actual lines of code to "DispatchEvent". What I overlooked first time around, was that I had "buttonRollOver" and "buttonRollOut" in order to stay consistent with the other functions within the Class File. So after I changed the code in MY Class File containing the Button reference, to broadcast "buttonRollOver" and "buttonRollOut", it started to magically work. So, that's all you gotta do - is add two lines of code (one for each function) in the SimpleButton.as file, and you are good to go!! Thanks again for your help on this - Mike -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Scott Hyndman Sent: Tuesday, March 28, 2006 6:35 PM To: Flashcoders mailing list Subject: RE: [Flashcoders] Using onRollOver and onRollOut inside a Class File?? It's not really up to the component developer to decide what may or may not be done with any control. Of course there are limits to this, but I would expect that with any visual component a roll over event is a reasonable thing to expect. Swing (MouseMoveListener), Cocoa (tracking rects), and the .NET framework (the MouseEnter event) all have support for this functionality. I'm not coming down on V2. It's a basic framework for basic needs...I'm just saying. Scott -----Original Message----- From: [EMAIL PROTECTED] on behalf of Charles Parcell Sent: Tue 3/28/2006 5:54 PM To: Flashcoders mailing list Cc: Subject: Re: [Flashcoders] Using onRollOver and onRollOut inside a Class File?? My question to you would be, why would you expect a button to broadcast that it being rolled over? There is no standard UI reason for it. The only real action that a standard button is good for is clicking. Charles P. On 3/28/06, Mike Anderson <[EMAIL PROTECTED]> wrote: > > Hello Michael - thanks for the reply - > > I guess my real question is, why isn't "onRollOver" and "onRollOut" > natively part of the Events that the Button Components can broadcast? > > In the help docs, there is only 1 mentioned Event - which is "click" - > > It just seems odd, that I have to use one method of adding an Event > Listener for Click, and a totally different type of "Add Event Listener" > method for adding other types of events. > > Do you know why that is? > > Is it for the purpose of not reinventing the wheel, and borrowing > events that already exist in other components, and applying it to > others? I know that all the components in Flash are reduced to their > lowest common denominators - and that they import their core functions > from other core classes - again, for the purpose of not having any > redundant code & not reinventing the wheel. > > Thanks for your help on this, and to help me further understand how > this all works. > > Mike :) > > > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of > Michael Bedar > Sent: Tuesday, March 28, 2006 2:32 PM > To: Flashcoders mailing list > Subject: Re: [Flashcoders] Using onRollOver and onRollOut inside a > Class File?? > > Whats wrong with this? > > myButton.onPress=function(){ > // > } > > Alternatively, use delegate to call a function from the correct scope. > > myButton.onPress=Delegate.create(this, myButton_Click) > > > On Mar 28, 2006, at 1:06 PM, Mike Anderson wrote: > > > Hello All, > > > > I am getting very confused here, on how to get the "onRollOver" and > > "onRollOut" events to be broadcasted whenever the mouse moves over a > > Flash Component, contained within a MovieClip using a Class File. > > > > The component in this particular instance, is the Push Button. When > > reading the documentation, the only "events" that are mentioned is > > the > > > "click" event. To my knowledge, when using a Class File attached to > > a > > > MovieClip containing a Push Button component, there is only one type > > of syntax that can be used for adding listeners. > > > > For example: > > > > myButton.addEventListener( "click", myButton_Click ); > > > > And you usually place this statement inside of the onLoad function > > of the MovieClip class itself. > > > > Then the function that handles the event, conforms to the method of > > how functions must be written inside of a Class File: > > > > private function myButton_Click( evtObj:Object ):Void > > { > > //code here... > > } > > > > Since you can't use a listener object (like you would if you were > > simply putting functions in the root of the movie itself), and then > > have a statement of listenerObject.onRollOver = function() within a > > Class File, I am wondering how I can force the onRollOver and > > onRollOut events to get properly broadcasted. > > > > Please keep in mind, I am trying to keep 100% of my code inside of > > my Class Files. I know a simple solution could be simply > > highlighting the actual Push Button within the MovieClip, and then > > directly apply an "on(event)" function to temporarily accomplish my > > goals - but this totally defeats the purpose of creating a > > separation between Flash App > > > and Source Code. > > > > I also looked at the SimpleButton.as Class File in which the > > Button.as > > > Class is based on. Oddly enough, there are "onRollOver" and > > "onRollOut" > > functions in there, but it doesn't Dispatch Events - it simply > > activates the "highlight" option when the user rolls over the button. > > > I thought that was pretty weird... I manually edited the Class > > File, so that a Dispatch Event of "onRollOver" and "onRollOut" would > > be broadcasted, but still no dice... > > > > Could any of you point me in the right direction, on how to > > accomplish > > > this using only Class Files? Since V2 components, AS 2.0, and Class > > Files are being pushed so hard as the preferred way of doing things, > > it simply baffles me why these other events wouldn't be available to > > the developer. Sorry, but "click" just isn't doing it for me - I > > need > > > more events out of my components. > > > > Thanks in advance, > > > > Mike > > > > _______________________________________________ > > Flashcoders@chattyfig.figleaf.com > > To change your subscription options or search the archive: > > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > > > Brought to you by Fig Leaf Software > > Premier Authorized Adobe Consulting and Training > > http://www.figleaf.com http://training.figleaf.com > > _______________________________________________ > Flashcoders@chattyfig.figleaf.com > To change your subscription options or search the archive: > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > Brought to you by Fig Leaf Software > Premier Authorized Adobe Consulting and Training > http://www.figleaf.com http://training.figleaf.com > _______________________________________________ > Flashcoders@chattyfig.figleaf.com > To change your subscription options or search the archive: > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > > Brought to you by Fig Leaf Software > Premier Authorized Adobe Consulting and Training > http://www.figleaf.com http://training.figleaf.com > _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com