Actionscript 3 :: Set The Yellow Focus Rect To A Movieclip To Enable Tab Navigation?
Jul 26, 2011How to set the yellow focus rect to a movieclip to enable tab navigation? This is my current code:
mymc.tabEnabled = true
stage.focus = mymc
How to set the yellow focus rect to a movieclip to enable tab navigation? This is my current code:
mymc.tabEnabled = true
stage.focus = mymc
I've been trying to figure out how to disable the mouse focus that you see when you tab through a swf file. I'm getting them pop up now and then and the client doesn't want them.I've been trying to work out how to disable focus for the entire movie but I've got nowhere. Is there an easy way to do this?
View 1 RepliesI'm using a keyboard event listener to move a sprite around, however, I have to click on the stage before the keys work. I'm even giving focus to the sprite that is supposed to move and telling flash not to use the yellow box. However, the box shows up around the sprite until I click anywhere on the stage.
Code:
public function activate_photo():void {
stage.focus = photoContainer;
[code].....
I draw a rectangle within another rectangle like this (I use it as a mask):
CanvasBorder.graphics.beginFill(0xf0ff00,0.1);
CanvasBorder.graphics.drawRect(100,100,550, 300);
CanvasBorder.graphics.drawRect((stage.stageWidth/2-Canvas.width/2),(stage.stageHeight/2-Canvas.height/2),250, 150);
CanvasBorder.graphics.endFill();
effectively its a 550x300 box with a 250x150 cutout.
Within one of my functions I need to resize the INNER 'cut-out' box from 250x150 to 150x100 - but keep the OUTER box exactly the same.
Normally when I'd resize a normal rectangle I'd do this:
rectangle .width = 150;
rectangle .height = 100;
I've got a tricky one that's stumping me, could you take a quick look over it I draw a rectangle within another rectangle like this:
Code:
CanvasBorder.graphics.beginFill(0xf0ff00,0.1);
CanvasBorder.graphics.drawRect(100,100,550, 300);
[code].....
I was looking around sites for navigation, and came across this: [URL]. I really like the way the menu with the four to five movies that scroll to the left and when hovering over them, the one you chose expands, pushes the other ones to the right of it away, and shows a description, stopping the movement. I'm thinking that this is partially the same concept as the infinite scroller, but how did they enable the object to "push" the other objects away? Tween class? [URL]
View 2 RepliesThis is a snippet of code in our custom item renderer which is in actionscript:
textCustomItemRendererTempForTab.tabEnabled=true;
textCustomItemRendererTempForTab.focusEnabled=true;
textCustomItemRendererTempForTab.setFocus();
Alert.show( "Without this alert focus goes to next grid " );
keyboardEvent.preventDefault();
keyboardEvent.stopImmediatePropagation();
keyboardEvent.stopPropagation();
Right now tab navigation works (on tab, focus goes to next editable cell) with the alert inserted in the code but I'm not sure why because I believe the alert in the code breaks the flow of event bubbling. However without the alert (which is what we are going for) the focus goes to the next grid in our UI.
You can see the attempts of trying to stop the event from going to other components. I have also tried to call preventDefault() and stopPropagation() on the datagrid when it receives a tab key event.
how to allow proper tab key navigation without an alert?
I created some movieclip buttons, set a statement to disable it, but I can't enable them again when another button is selected?
PHP Code:
pack.addEventListener("click",loadAuto);
function loadAuto(e:Event):void {
portafolio.loadAlbum("pack","1");
if (e.target==pack) {
pack.enabled=false;
[Code] ......
I've created some dynamic movieclips. When I click and hold on one of them, I'd like a different library linked MC to appear, and the new MC to be draggable.
I can make the new MC appear, and I can make it draggable. However, I'm a little lost when it comes to telling Flash to forget about the old clip, and make the new one the 'live' one.
In other words - after a click-hold, I want the new movieclip to be movable without the user having to mouse up and then click again.
Then I test my movie from inside flash 9 (ctrl+enter) the MC I just edited keeps in focus: When I test a game and press UP DOWN etc. The MC inside my fla is moving too, while the compiled swf is playing!
View 0 RepliesI have an input textfield (input_txt) inside a movieclip (mc), how do i clear the focus (blinking cursor)? I want to place this code on the root timeline.
View 6 RepliesI have created menu which has roll over and out animations.What I am trying to achieve is to play the roll over animation when rolling over the menu, but stop the roll out animation IF the focus has been set on a specific movieclip.[cod]I am not sure what I am doing wrong, but if I trace the stage focus inside the if statement nothing happens, but it works if I trace it on else statement(gives null) which means that the if statement is bypassed and the else is played.
View 7 RepliesI have a problem with setting focus on a textfield in a child movieclip from my DocumentClass.
I have a function in my DocumentClass that try to set focus on a textfield in a child movieclip:
private function setFocusOnUserName():void
{
this._mc._txUser.stage.focus = this._mc._txUser;
}
But I get that stage is null.
And I get error message:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at com.ro.main::DocumentClass/setFocusOnUserName()
at com.ro.main::DocumentClass()
I have created menu which has roll over and out animations. What I am trying to achieve is to play the roll over animation when rolling over the menu, but stop the roll out animation IF the focus has been set on a specific movieclip.
Here's my code:
Code:
function menuOut(e:MouseEvent):void
{
stage.focus == contentMc;
[Code]....
if I trace the stage focus inside the if statement nothing happens, but it works if I trace it on else statement(gives null) which means that the if statement is bypassed and the else is played.
When I use <s:Rect> to create a rectangle, I use radiusX to get rounded corners. Problem is all are the same roundedness. Is there something similar to Rect that lets me control the radius for each corner separately? If not, what's the best way to create this from scratch? graphics library or what?
View 3 Replies[Code]...
when i have this line active(the red one) it gives me automatic focus, so no clicking to be able to detect key input so i got that going for me which is nice BUT when i have it active(not commented out) i get this big yellow line which goes away when i click it(seeBelow)
I was working on some blitting code today and after profiling it found that I was creating 1000s of new rectangles. I was shocked because I only had 1 or 2 different new Rectangle() calls or I was using the .rect property of BitmapData.
I started commenting out huge swathes of code until I was left with this code in my sprite class:
canvas.bitmapData.copyPixels(_bitmapData, _bitmapData.rect, destination, null, null, true);
I cached the result of _bitmapData.rect at object creation and my thousand of new rectangle calls were suddenly gone from the profiler.
Why the heck would BitmapData.rect create a new rectangle? Is there a way to check the core libraries or something and confirm this is true?
Does anyone know how to do this in AS3?
View 3 Repliescan I set the keyboard focus for a TLFTextField? I tried stage.focus = myTLF but there is no cursor...
View 2 Repliesim doing an accessible site and i know that objects areaccessible by default. all my buttons were highlighted in yellowwhen tabbing through...then i opened my accessiblity panel to add labels and now theyellow boxes are gone. i've deleted all the additions but still nosign of the yellow boxes.accessibilty is checked for everything, i've gone through thewhole site. nothing seems to be missing. is there some way i canglobally re-set the accessibility settings.
View 5 RepliesCan someone explain why a yellow box sometimes appears when a user clicks a button in a swf? It doesn't happen all of the time and, frankly, it's never been an issue before.
View 1 RepliesI had made a custom Youtube player in Flash CS4 in AS3 with Play/Pause, Mute, Stop, Seekbar and VolumeBar Controls. My problem is "only" with the Seekbar and the VolumeBar. It always shows up a bounded Yellow retangle over the controls when you try to drag it (scrub it) using a mouse which looks really ugly... I have tried every possible ways to remove the tabstop, like tabEnabled, tabIndex , and the like but all in vain. Also I have tried to remove the focus from the stage of the FLVPlayback component, still in vain...
You can see 2 screenshots here... [URL]
From my main flex mxml, I am trying to detect the size of a rect:Rectangle that I created in my InfoBubble.as class. The info bubble itself is created in my InfoMap.as class. How can I access the attributes of the rectangle I created?
Here is the variable portion of the InfoBubble class:
Code:
public class InfoBubble extends Sprite
{
//public var textField:TextField;
[Code]....
how to use actionscript over mxml for flexibility. I have this simple block of mxml that I'm trying to convert to actionscript, but I'm stuck half way though
<s:Rect id="theRect" x="0" y="50" width="15%" height="15%">
<s:fill>
<s:SolidColor color="black" alpha="0.9" />
[Code]....
What's the most efficient way to add the SolidColor in as few lines of code as possible.
In a Flex component that inherits from BorderContainer I'm overriding the updateDisplayList function to draw a rect:
override protected function updateDisplayList(unscaledWidth : Number, unscaledHeight : Number) : void
{
[code].....
Is there a way to remove the yellow rectangle that appears on objects when the Tab key is pressed. This mostly applies to MovieClips that are Simple Buttons.
View 5 Repliesi was trying to mess around with flash and I was hoping I would use TweenMax to scale up a rectangle (instantiated as rect) on mouse over, and then once it is scaled up I wanted to load an swf file to its center (the swf is called CircularPreloader.swf which is a fake preloader, just for messing around porpuse). Well, I tried but it didn't work cuz I kept getting this
error: TypeError: Error #1009: Cannot access a property or method of a null object reference.
at scaleUp_fla::MainTimeline/frame1()
Here's the code:
import gs.*;
import gs.easing.*;
[code]....
I seem to be having problems with rectangles moving from their assigned positions when all I want to do is decrease their width.A game I'm working on simulates an explosive with a fuse. The fuse decreases in size as a clock counts down to 0.I think the problem has to do with local coordinates vs. global coords, but I'm not sure how to rectify the problem. Here is some code:
//fuse
_fuse = new Sprite();
_fuse.graphics.beginFill(0x000000);[code]........
Nowhere in my code does the x position of the fuse change.Aside from this one issue, the rect functions exactly how I want it to.
Im creating a button, with a background rect shape and a text label. Im trying to resize the background rect shape according to the text label.For example, if my text label says "work" the background rect shape will be smaller then if my text label says "employment".
View 1 RepliesSo, I have my fullscreen working, selecting a rectangle to scale to. and everything is good there,.. the issue is that the I have an onresize event, that positions the entire sprite... so.. when it goes into fullscreen, it obviously fires the resize event, which inconveniently slides my content to the right, as it tries to recenter the content. any way I can make it so it doesn't fire the resize event.
View 3 Replies