ActionScript 3.0 :: Make Flash Select The Stage?
Aug 13, 2011after you click play on the menu frame for my flash game, and the game starts, you have to click anywhere on the stage for the keyboard controls to work.
View 4 Repliesafter you click play on the menu frame for my flash game, and the game starts, you have to click anywhere on the stage for the keyboard controls to work.
View 4 RepliesI was trying to work out how to make flash select a random number, but between 0 and 5 .
View 8 Repliesif I want to randomly select an image from the stage, by using an array, and send it to the location of a box on stage (ranPair1), how could I do that?
var cardArray = new Array();
cardArray[1] = "twoC, twoH";
cardArray[2] = "threeC, threeH";
[Code].....
I'm trying to find a generic way to select everything on the stage, because when I leave a frame, I want everything to fade out. But the user will be leaving multiple frames, so I would like to do it without specifying various objects depending on what frame they're on. I realize there are a lot of ways to "skin this cat", and I will fall back on something else if this isn't possible.
When I try this, I get an error, "undefined *".
Code:
stage.*.alpha = 0;
I have the following code:
Code:
btn.addEventListener(MouseEvent.CLICK, select);
function select(evt:MouseEvent):void {
addEventListener(MouseEvent.CLICK, unselect);
} function unselect(evt:MouseEvent):void {
removeEventListener(MouseEvent.CLICK, unselect);
}
The idea is to be able to select the "btn" sprite and while it is selected you can click anywhere on stage to deselect it. I thought this would work but somehow after a single mouse click it also executes the unselect function. Since I add this function after the mouseclick I do not understand why it is doing this. Is this not the way to do such a thing?
I don't really know that much about Commands in Flash, but I was thinking this could be a possible Command to create.See, I have this puppet made up of dozens of separate pieces, all on their own layers.It's very tedious to click on 10 different symbols in order to move the character's arm, for example.I was wondering if there was a way to create a JSFL command to select each of the 10 symbols on the stage.
I tried clicking each one, and saving the "Change Selection" actions from the History Panel as a Command, but that is location-based.As soon as I move those symbols to a new location, the command I saved no longer selects them.And I can't select the objects by layer or frame, because it doesn't seem to want to save those either.
I have a Flash as 3.0 project that has 16 movieclips, each movieclip contains 3 images. The first image is the same for all 16 mc's the second image is different for all and the third image is different for all. I have the fla set up so when it is called it will play the first mc and stop. Buttons on the rightside would be used to move the playhead to the desired framename to play all the others.
My question is, each image fades in each clip like a build then stops. Is there a way to code this so when you select a new image to play the stopped previous clip on stage can play backwards so instead of fading in it would fade out, THEN the playhead would move to the frame name and play the newly called clip? So it would work like this
[Code]...
I am creating a quiz game, there are 6 different quizzes. Which quiz is presented will be made by which segment a spinning wheel stops on.
I am reasonably confident I can create the spinning wheel and the quizzes, but how can where the wheel stops choose the quiz?
I'm trying to create a simple "smart" textbox component in Flex, and I want a function inside it that I can use outside of the component to force itself to select all text inside of it.
Inside my SmartTextbox.mxml:
public function selectAll():void
{
this.setSelection(0, this.length);
}
[Code]....
i'm trying to make a character select screen for my game. now i've got a character with an instance name of "Character" and its just one. but i want to make like another scene or something where i can choose the character and the choosen character is used in the game.
View 1 RepliesI have a comboBox and values like basic and advanced. And viewstack container conatains 2 grids.When i select the base option in Combobox, the first grid has to be selected. select the advanced value in comboBox, the second grid has to be selected.
<mx:ViewStack id="viewstack1" width="95%" height="85%" x="0" y="63" >
<tables:KeyMetricsBasicTable basicArrayDataProvider="{basicArrayResult1}" width="100%" height="100%"/>
<tables:KeyMetricsAdvTable advArrayDataProvider="{advArrayResult1}" width="100%" height="100%"/>
</mx:ViewStack>
Flex 4 Combobox is extended with a Text Input that helps in getting to the item that is searched for.I have created a Check Box as an itemrenderer for this Flex 4 Combobox. I would like to Add a Select All and Select None options in the drop down of the Combobox. I know that i could accomplish by editing the dropdownfactory in case of a Flex 3 Combobox. But in Flex 4 the dropdownfactory doesnt exist.
View 2 RepliesHow do you make a movieclip move horizontally from the start of the stage to 3/4 of the stage. Stage size is 700 px by 600 px i want just one row in the middle of the stage. i want that movieclip to disappear right after it reach the end of the 3/4 mark.
View 1 RepliesIn flex the width can be set to 100%,but in flash it seems I can only set the width/height in unit of px.
Is there a way to set the stage to 100% instead of xxx px in flash?
I'm using Flash Professional CS5 if that matters.
I typed out a function in an attempt to make two MovieClips appear on the stage in random locations onClick but I think I either forgot to add something or forgot to take something out.
[Code]....
I am working on a text adventure game which will have at least a few components (a text area for narrative and text input for user input) on the stage at all times. Therefore, I have created those components statically through Flash's WYSIWYG design environment. I gave them instance names "myTA" and "myTI" respectively. I was able to get my main class (the document class for the stage) to interact with them (dynamically adding text one character at a time like a typewriter at runtime), but other classes in the same package don't seem able to recognize the stage components. Below is the relevant [code]...
View 5 RepliesI was wondering if there is a way to make the actual stage dynamic to the content loaded in the flash file.
Firstly the method I am using is importing a external swf to the stage into a container called container. The main stage, lets call it index, is still on default size, and I want this to expand dynamically as content is loaded in. page1 may be 900px width, page2 may be 500px width, and as I load the content the index stage should expand the width to that of the page loaded. Some steps I have tried but did not work.
if page1 button is pressed stage.stageHeight = 900; - not working (how do I set stage size in as3)made a movieclip in page 1 spanning the page size and called it p1_stage so I can reference the data from there. trace(container.p1_stage.height); gives this error: TypeError: Error #1010: A term is undefined and has no properties. at index_fla::MainTimeline/frame1()
Made a swf [URL] some viewers see and hear fine but others are having sound and size issues and I need some practical answers. SIZE: I make the Flash stage the size of the original screen capture video of 1024 x 768 and right now it is set to
[Code]...
Right now my stage dimensions are 980 X 800 px. I need to cut or "crop out" the bottom portion of the footer because its height is too long. So I changed the stage dimensions to 980 X 600 px (and changed the corresponding dimensions in the embed tag in the index.html file to match). Doing this seems to cut out the bottom but at the same time adds space to the top and seems to distort the overall spacing. Is there a simple way to crop out the bottom of the stage (just like cropping out a section of a photo)?
View 5 RepliesI have about 18 checkboxes and I would want to know if there is a way how i can make only one of them be choosen. I.e I can't choose 2 of the boxes an error will occure. I know I could do it with radioboxes but for estetic I prefere checkboxes.
View 3 RepliesIm currently working on a project that requires a sound to played out through one sound card and a diffrent sound to play out through another.I couldnt find anything in the documentation for soundcards. Does anyone no how to select and use a diffrent soundcard in flash?
View 2 RepliesI'm trying to animate a simple stick figure just now. I used an inverted triangle shape for the body,which gives a nice width to the shoulders. Unfortunately, flash doesn't seem to realise that it's a triangle. Due to it's stubborn way of drawing a rectangular bounding box around every shape.
This is getting in the way a lot, as there are parts of figure which are clearly not blocked by the torso, but are blocked by it's big square bounding box, which makes it a nightmare to drag the arms and legs around to where I want them
Is there any way to fix this silly behaviour, and have it only select an object when I click on a visible part of it, and not just anywhere in it's bounding box ?
Here is my XML. I have removed A LOT of what is actually in the XML file I am working with, for simplicity:
PHP Code:
<State><Center ID="BOCC">
<Dispatch><Log>
<LogType>Traffic Collision - Ambulance Responding</LogType>
[Code] .....
I need ONLY the text of the LogType's (FROM CENTER "BOCC" ONLY) to show up in a list component or trace the output.. doesn't matter.. I can formulate it myself.. I just need to only grab this specific data. I do not want to see any other results (e.g. from SOMEOTHERCENTER). Like show:
Traffic Collision - Ambulance Responding
Traffic Hazard
Pedestrian On A Highway
The actual file I'm working with (and can not alter) is [URL].
Supose I have a MovieClip called Egg and I have a lot of Egg instances with unique names (required) or without names.What if I need to write a code who break all these eggs refering to the Main object in Library? Instead to add code for every egg with every name in the Stage.
View 1 RepliesI have a set of variables of type "integer" and I just want to take the greatest of these values, and set as the value for some new variable. How would I do this in as3?
View 2 RepliesI am working a video in Flash CS5 that is roughly 11 minutes long.
I am at the 6 minute mark at the moment and whenever I want to preview the latest changes I click F12 to I press 'alt+enter'. The problem is I have to watch 6 minutes of the SWF to eventually get to the latest part I edited.
This is slowing me down tremendously and I would hate to still be doing this when I am 10 minutes into the video!
Is there a more efficient way to preview?
Perhaps open it in a player that has some proper controls? or even if I could select the starting point of the preview?
If I press 'enter' I see a preview but the sound file does not play so that option is out too.
I am trying to create a Flash application which will allow a user to draw arrows on the screen/canvas by using the mouse. So if they click and hold the left mouse button at coordinates 23,12 and release the left button at 84,45 a line would be drawn between the 2 points with an arrow head at the second coordinate.I also need each individual arrow to be selectable so they can be moved or deleted (I know how to do this part!).
View 1 Repliesis there any way I could print selected text in flash??
View 1 RepliesDoes anyone have any experience or examples of similar functionality to the Iphone's Picker View to the in Flash/AS3? I'm working on a touch screen flash application and would love to use something like this for a time picker, instead ComboBoxes, which are difficult on touch screens.
View 5 RepliesI have a FLV playing in Flash with a full screen button. The problem is I want only the video to be shown full screen, not the entire stage. This is the code I'm using to make the video fullscreen.
function fullScreenUP(event:MouseEvent):void {
if (screenCheck == false) {
stage.displayState = StageDisplayState.FULL_SCREEN;
[Code].....