상세 컨텐츠

본문 제목

플래시 액션스크립트 TAB으로 포커스이동시 포커스 칼라관련 또는 안나오게 하는 방법

ADOBE/ ActionScript

by AlrepondTech 2020. 9. 22. 18:47

본문

반응형

 

 

 

=================================

=================================

=================================

 

 

 

 

 

 

 

출처: http://psinke.wordpress.com/2010/01/12/flash-actionscript-3-focus-rectangle-color/

 

Flash Actionscript 3 Focus Rectangle Color

By default Flash adds a very ugly yellow focus rectangle around interactive objects. But luckily with a little scripting this can be adjusted.

Pretty much all you need to do is hide the one flash generates, and create your own.

Here’s a bit of AS3 to make it work:


button_mc.tabIndex = 0;
button_mc.focusRect = false;
button_mc.addEventListener(FocusEvent.FOCUS_IN, showFocus);
button_mc.addEventListener(FocusEvent.FOCUS_OUT, hideFocus);

So ‘button_mc’ is my button movieclip instancename, now let’s setup a simple glow effect when the button get’s focus:


var glowIn:GlowFilter = new GlowFilter(0x003822,0.6,6,6,2,2);
var glowOut:GlowFilter = new GlowFilter(0x003822,0,6,6,2,2);


function showFocus(evnt:FocusEvent):void{
Tweener.addTween(button_mc.buttonBG_mc, {_filter:glowIn, time:0.5});
}
function hideFocus(evnt:FocusEvent):void{
Tweener.addTween(button_mc.buttonBG_mc, {_filter:glowOut, time:0.8});
}

I’m using caurina for the glow effect. So I’ve imported the library like so (also including the Event namespace for the actual working of the events):


import caurina.transitions.Tweener;
import caurina.transitions.properties.FilterShortcuts;
import caurina.transitions.properties.DisplayShortcuts;
import flash.events.Event;
import flash.filters.GlowFilter;


FilterShortcuts.init();
DisplayShortcuts.init();

And there you have it; a nice glow around my button when I press TAB, or click it.

 

 

 

=================================

=================================

=================================

 

 

 

출처: http://www.actionscript.org/forums/showthread.php3?t=149889

 

Hi all

I was struggling with preloaders till i found this tutorial
http://www.bit-101.com/blog/?p=946
this allow me to preload in 1 SWF, and works

the thing is that when finished preloading, and started my real app, it now shows a Yellow Rectangle Focus on the Main window... to say that the focus is of the size of the stage.
if you press TAB or click on stage it goes away.
I want to get ride of it, and i tried focusRect = null everywhere but without working
Before using this prealoder, it wasn't showing. and if i come back to regular loading also doesn't show.
does anybody has a clue?
    
 10-12-2007, 07:00 PM   #2
Sekhar
Marketer/Technologist


Join Date: Aug 2007
Location: San Diego, CA
Posts: 434


Making it null will make Flash use the stage setting - assign stage.stageFocusRect = false.
    
 10-12-2007, 07:07 PM   #3
eka
Registered User


Join Date: Oct 2007
Posts: 4


Quote:
Yes, that worked out just right!

Thanks!!
  

 

 

 

=================================

=================================

=================================

 

 

 

출처: http://help.adobe.com/en_US/as2/reference/flashlite/WS5b3ccc516d4fbf351e63e3d118ccf9c47f-7d0a.html

 

Home / Flash Lite 2.x and 3.x ActionScript Language Reference / ActionScript language elements / Global properties

_focusrect property

Specifies whether a yellow rectangle appears around the button or movie clip that has keyboard focus. If _focusrect is set to its default value of true, a yellow rectangle appears around the currently focused button or movie clip as the user presses the Tab key to navigate through objects in a SWF file. Specify false if you do not want to show the yellow rectangle. This is a property that can be overridden for specific instances.
If the global _focusrect property is set to false, the default behavior for all buttons and movie clips is that keyboard navigation is limited to the Tab key. All other keys, including the Enter and arrow keys, are ignored. To restore full keyboard navigation, you must set _focusrect to true. To restore full keyboard functionality for a specific button or movie clip, you can override this global property by using either Button._focusrect or MovieClip._focusrect.
Note: If you use a component, FocusManager overrides Flash Player's focus handling, including use of this global property.
Note: For the Flash Lite 2.0 player, when the _focusrect property is disabled (such as Button.focusRect = false or MovieClip.focusRect = false ), the button or movie clip still receives all events. This behavior is different from the Flash player, for when the_focusrect property is disabled, the button or movie clip will receive the rollOver and rollOut events but will not receive the press and release events.
Also for Flash Lite 2.0, you can change the color of the focus rectangle by using the fscommand2 SetFocusRectColor command. This behavior is different from Flash Player, where the color of the focus rectangle is restricted to yellow.
Availability
Flash Lite 1.0
Example
The following example demonstrates how to hide the yellow rectangle around any instances in a SWF file when they have focus in a browser window. Create some buttons or movie clips and add the following ActionScript in Frame 1 of the Timeline:
See also
_focusrect (Button._focusrect property)_focusrect (MovieClip._focusrect property)




  •  
  •  
Home / Flash Lite 2.x and 3.x ActionScript Language Reference / ActionScript language elements / Global properties

Product support

Legal Notices | Online Privacy Policy

 

 

=================================

=================================

=================================

 

 

 

반응형


관련글 더보기

댓글 영역