ActionScript 3.0 :: Case Statement -- Mouse Position?
Feb 20, 2009
I've got a slider on my navigation bar that rides along with the mouse; movies play perpendicular to it as I scroll. If I click on the movie, I link out to another page (easy enough). However, the actual slider doesn't do anything more than look nice. I know that if I don't make this thing child proof, I'm going to catch grief about it. So I tried to set up a switch that links out according to range values y<0 && y>125. As it stands, I don't get any errors, it just always goes to default. I'm missing something.I could always try a gia-normous 'if' statement, but I thought that I'd give the switch a try.
View 4 Replies
Similar Posts:
May 26, 2011
I am trying to get my pages through Case Statement But.
[Code]...
View 6 Replies
Dec 17, 2008
I'm trying to use the value from a combo box in a switch case statement but it isn't working
Code:
var switchValue:int = 0;
switchValue = int(cmbColour.selectedItem.data);
switch(switchValue) {[code]....
View 4 Replies
Nov 2, 2010
I see Switch statement in:
switch() {
case 'string': ...;
}
but would hope if I could do this?
View 1 Replies
Jan 16, 2009
I'm trying to use switch/case staement instead of if/else but it's not working. Here's the code.
ActionScript Code:
//working code
function checkTarget(drag){[code].............
View 3 Replies
Feb 18, 2004
How do you do a range using switch statement in ActionScriptFor example:
score = txtScore.text
switch(score)
{
[code].....
View 3 Replies
Feb 18, 2004
How do you do a range using switch statement in ActionScript For example:
[Code]...
View 3 Replies
Nov 27, 2002
Is there such thing as a "select case" statement in actionscript? If there is what is its format?
View 2 Replies
Jan 18, 2010
I have a large group of functions.The function to be called depends on the value of a var (which is a int);I could make a long case statement along the lines of this
PHP Code:
var Pos:int = 0;function test1():void{ trace("Test 1");}function test2():void{ trace("Test 2");}function test3():void{ trace("Test
[code]....
View 3 Replies
Dec 30, 2009
I am trying to figure out how to apply the is operand or the instanceof in a case statement to determine which datatype a interface object belongs too. keep getting errors
switch (IOjbect is)
{
case Tile:
[code].....
View 2 Replies
Jun 14, 2010
I can't for the life of me come up with anything that works...
function setCurrentCMI(id){
if (_level0.strInteraction+id==""||_level0.strInterac tion+id=="undefined") {
//does nothing, user hasn't been here yet
[code]......
View 0 Replies
Sep 22, 2010
I've been creating an application using the Adobe AIR Packager for iPhone (command line style).The app consists of a lot of screens that provide various information, and the navigation is handled all in the document class via an event-triggered function that uses a large switch-case statement to determine what screen to go to.
When we compiled it through the iPhone Packager and tried to test it on one of our phones, it would load up to a blank screen.
After some error testing it was revealed that the switch-case itself is causing a problem (changing it to an if-else that had the same functionality worked just fine). Does anyone know whether this is a known issue, or if something can be done to fix that other than converting it to an if-else.
View 1 Replies
Jan 7, 2012
How i write the inline conditional statement in Flex with two expressions(case) [code]...
Flex compiler only check the first expression and on behalf of that give result.But i want to check both statement and show result.
View 4 Replies
Jan 14, 2010
I am working on a site, that has 5 main pages: the home, and four sub-pages. Essentially, I have an element that slides up over the screen anytime you click "from" the home page to one of the remaining pages. Consequently, when returning to the home page, the element slides away / off the screen.
I am thinking the best way to handle this is with a conditional statement, but not really sure at all how that code would look especially in relation to position. My thinking for the code would be as follows:
[Code]...
View 1 Replies
Feb 1, 2006
Basically the x position of the mouse should control the play position of a movie. Do I need something like an event handler (I'm not sure exactly what these do, but I've seen similar scripts that seem to use them).
View 2 Replies
Nov 12, 2009
I have an Input Text area that users can edit and then submit. I need to be able to show, on screen, the cursor's current position as they type. I don't need to know where the mouse is but all work-arounds I've found so far can only tell me the mouse position. The font for the text is 'courier' or 'courier new' and the Input Text area is scrollable.
View 8 Replies
Jun 6, 2011
I have some trouble with the conversion applied by BlazeDS to the name of the properties when this name begins with a lower-case letter followed by a capital letter. I have an ActionScript class similar to this:
[Code]...
View 1 Replies
Mar 28, 2010
tween from one position to mouse position
View 1 Replies
Oct 29, 2009
I have a map application that when I use the mouse wheel the map will scale up or scale down. The next thing I want to do is to focus on the mouse pointer while zooming on the part of the map.
I have this code...
function focusMousePosition(){ onMouseMove = function (){ Stage.width = _root._xmouse; Stage.height = _root._ymouse; updateAfterEvent(); }}
var mouseWheelListener = new Object();var wheelNum:Number;
mouseWheelListener.onMouseWheel = function(wheelNum){ focusMousePosition(); if (wheelNum > 0){ map._xscale *= 0.9; map._yscale *= 0.9; }else{ map._xscale *= 1.1; map._yscale *= 1.1; }}Mouse.addListener(mouseWheelListener);
View 3 Replies
Mar 9, 2010
Code:
addEventListener(MouseEvent.MOUSE_WHEEL,mouseWheel);
function mouseWheel(event:MouseEvent) {
Map.scaleX = Map.scaleX + event.delta*.01;
Map.scaleY = Map.scaleX;
}
The problem with this code is that it scales from the registration point (0,0). Due to the other transformations I'm doing to this image at various times, it isn't possible to move the registration point. The image is larger than the stage and the user is able to drag it around. I want the mouse wheel to zoom in on the place the mouse is hovering over (or at a minimum...the center of the "view" they have...aka the stage)I tried doing this:
Code:
internalPoint = new Point(Map.mouseX, Map.mouseY);
externalPoint = new Point(stage.mouseX, stage.mouseY);
var matrix:Matrix = Map.transform.matrix;
[code]....
Which, incidentally, I'm using that whole portion of code to zoom into the state they will be in when they use the mouse wheel.
View 1 Replies
Sep 29, 2011
how to put mouse coordinates into an if statement, but as an 'if more than' but also 'if less than'. Something like:
Code:
if (mouseX > 190, but also <210) {
//do something
}
Is it possible to also do a similar thing to also include the Y position, to create a box of some sorts based on mouse position?
Something like:
Code:
if (mouseX > 190, but also < 210, mouseY > 20, but also < 100) {
//do something
}
I think it may have something to with setting each position as a var and pushing them into an array, but I can't get my head around it.
View 4 Replies
Jun 24, 2009
I have an if statement that says:
Code:
this.onEnterFrame = function()
{
if(_root._xmouse >= 612)
[code]...
I get a trace but the tween does not happen.
View 1 Replies
Apr 1, 2007
I'm trying to write an if statement so that when the user clicks on my button i tween some content in.
Here is my AS Code:
ActionScript Code:
if (news.onRelease == true){
function newsContent(){
[Code]....
View 3 Replies
Apr 21, 2010
I have MC masked with TEXT,when the user moves his mouse down more text appears from the bottom and when he moves it goes bakc to the original position...I do not want the mouse wheel .. I woudl like to do it by mouse hovering...
View 5 Replies
Jan 1, 2010
I am trying to get the mouse's position even when it is outside of the flash window. How can I do this?stage.mouseX/Y only returns the mouse position on the stage, not when the mouse is outside. Is there another way?
View 5 Replies
Oct 30, 2011
What I'm trying to do is create a program that, depending on 2 variables, multiplies another variable by a static number. Heres the code I have so far:
[Code]...
View 1 Replies
Dec 10, 2003
I want this on an MC:
[AS]
i = 0;
switch(thing){
case 0:
[code]....
Basically what I'm wondering is, will I lose the value of i in the first switch once I'm out of the switch? Can the second switch read the 1st switch?
View 8 Replies
Oct 29, 2011
Im trying to create a program that, depending on 2 variables, multiplies another variable by a static number. A friend suggested I use case/switch instead of if/else statements,which is what I was using before.
[Code]...
View 1 Replies
Apr 11, 2010
The closest I have come to is the basic mouse hide and then mouse show, however this only gives the illusion of the cursor not being there, however you can still use it. I would like the cursor to be 'disabled' within the flash movie for a limited time. Either by it disapearing and then reappearing, or by it being frozen in place
View 2 Replies
Jan 12, 2009
How can i use mouse position in as3?
View 1 Replies