ActionScript 2.0 :: Building An IF Statement To Work With PixelBreakers Swfmacmousewheel?

May 14, 2004

building an IF statement to work with PixelBreakers swfmacmousewheel, I cant quite get my head around it. Heres where I am at.

Actionscript Code:

MouseWheel.addListener(this);function onMouseWheel(delta:Number):Void { this.emptyScroller._y += delta * 3;}

I want to stop scrolling once emptyScroller._y = 0, so the content doesnt get scrolled right off the edge of the browser. I want to say something like: if emptyScroller._y < 0... "stop scrolling upwards, but allow the user to still scroll downwards until y = someVar"

View 3 Replies


Similar Posts:


ActionScript 2.0 :: If Statement Inside If Statement Won't Work

Mar 30, 2011

why this code won't work

[Code]...

I'm sure you can put if statements inside other if statements, seriously I can't figure it out

View 4 Replies

ActionScript 3.0 :: If Else Statement Does Not Work?

Oct 21, 2009

have a very common function i use in educational quizes that self rate the user depending on their score (resulting from answering multiple choice questions). So I have set up a variable called score no trouble...but when i implement my trust "if else" heuristic from AS2...i get all these errors and my flash file does not work.

stop();
if (score <= 5){ endMsg.gotoAndStop("score1");} else if (score > 6 and score <= 11){ endMsg.gotoAndStop("score2");} else { endMsg.gotoAndStop("score3");}

[code]....

View 6 Replies

ActionScript 3.0 :: If Statement Does Not Work?

Jan 3, 2011

the problem is that for some reason my if statement doesn't work

Code:
if( key.isDown( Keyboard.UP ) )
{

[code].....

View 2 Replies

Actionscript 3.0 :: The If Statement Doesn't Work

Jun 14, 2009

im trying to make a website based on a tutorial. when a certain button is clicked a selected page will load when the previuos page plays the OUT:label and hits the end label which are situated on the every pages mc timeline. Tyhe problem is that the function doesent work

the function is like this

Code: Select all
kontakt_btn.addEventListener(MouseEvent.CLICK, newPage); 
function newPage(e:MouseEvent):void

[code]...

View 3 Replies

Tweener For /if Statement Doesn't Work?

Dec 23, 2009

I am executing a hittest when a chicken meets a crocodile; the chicken is afraid for the crocodile and turns back flying up in the air and back on the ground. In fact most of it works, allthough I can't get the wings to stop fluttering. As soon as the chicken returns on the ground, this must happen.This is the piece of code where it is about: (the function winger() is called once at the hittest)

[flash=]function winger()
{
var counter:int=0;[code].......

without the counter it works. changing it into an if-statement with the counter af the 2nd tweener, doens't work either.

View 1 Replies

ActionScript 2.0 :: Simple If Statement Won't Work?

Feb 18, 2006

I am using Flash 8, and for some reason, my if statement won't work. I have a scrollbar which scrolls a movieclip (that contains AS loaded material (eg. attachmovie). I want it so that only when the material is longer than the scrollbar do I see the scroll bar.For some reason, it doesn't work. The traces don't even work!

if (scrollbar._height < menu_mc._height) {
scrollbar._alpha = 100;
trace("works");[code].....

View 2 Replies

ActionScript 2.0 :: IF ELSE Statement Doesn't Work?

Aug 24, 2009

I'm doing a simple array test...I thought I could have values in an array and then run it through a loop and have a IF this value equals "x" do whatever, ELSE do this.

I have the value on a button and it doesn't work.The loop runs but the IF ELSE statement doesn't do what I THOUGHT it should do. It runs every value through the script as if the IF ELSE statement doesn't matter. Am I missing something?Here's the flash code (see below):

var myArr:Array = new Array;
myArr = ["red", "green","blue"];
function checkArr (checkTest){[code].....

View 7 Replies

ActionScript 3.0 :: Switch Statement Work With HasOwnProperty

Jan 24, 2012

Is it possible to have switch statement work with hasOwnProperty :

[Code]....

View 4 Replies

ActionScript 2.0 :: Nested If Statement That Refuses To Work Properly

Oct 28, 2009

I have written a nested if statement that refuses to work properly. My fla file consists of the main timeline and a movieclip. The problem lies in the pwrbtn function. I need the pwrcomp Boolean to prevent the call to firstpage() from happening more than one time. However when I test it keeps cycling so my traces are frame2, true, frame2, true, so on and so forth. Have I just made some small mistake that Im not seeing?

[Code].....

View 2 Replies

ActionScript 2.0 :: XML - Make The Final Trace Statement Work?

Oct 17, 2006

I have the following code in the main timeline:

[Code]...

how to make the final trace statement work?

View 5 Replies

ActionScript 2.0 :: If Statement Inside MovieClipLoader Object Work?

Aug 25, 2008

I recently built a preloader using the MovieClipLoader object. I used the following events: OnLoadComplete, OnLoadProgress and onLoadStart. I registered my listeners etc and then I decided I wanted to get a bit fancy. So I decided that within the onLoadProgress I would add an"if" statement, this if statement would basically say if the loaded content equals 70 then animate the preloader graphic off the screen using tweening (very simple). The onLoadProgress is continuously called while the content is being loaded but it seems that it does not want to correctly execute my if condition.

Here is the code for the onLoadProgress.
loadListener.onLoadProgress = function (target:MovieClip, bytesLoaded:Number, bytesTotal:Number) {
trace("onLoadProgress");
txtLoaded.text = String (Math.floor (bytesLoaded / bytesTotal * 100)) + "% loaded";
mcProgress._xscale = bytesLoaded / bytesTotal * 100; // address the bar
[Code] .....

View 5 Replies

ActionScript 2.0 :: Swfmacmousewheel - Get Flash To Scroll With A Mouse Scroll Wheel On Both PC And Mac

Jun 16, 2010

I am having endless trouble trying to get flash to scroll with a mouse scroll wheel on both PC and Mac. Pixel Breakers code "swfmacmousewheel" seems to be the way to go but despite everyone raving about how amazing it is and showing many version of it working very nicely, I cant get it to work. I've followed all the instructions I can find as carefully as possible but I get nothing. I just want something similar to this > [URL]

View 2 Replies

ActionScript 2.0 :: Call The ImageSize Function With The If Statement It Doesn't Work?

Aug 18, 2006

Code:
_global.picWmax = 436;
But when I call the imageSize function with the if statement it doesn't work.
Code:
function image(){

[Code]...

View 3 Replies

ActionScript 2.0 :: First Requirement Of The If Statement When Type In The Proper Input And Go Straight To The Else Statement

May 14, 2009

Having a few problems with what I thought was a simple if statement. Here is the code:

[Code]...

I can't quite figure out the small problem with the code. It seems to just bypass the first requirement of the if statement when I do type in the proper input and go straight to the else statement.

View 7 Replies

ActionScript 1/2 :: Execute Code In Previous If Statement If Second If Statement Is Executed?

Aug 31, 2011

if (variable == 1){
//code
//Execute this code.
} else if (variable == 2) {
//code

[Code]...
 
I dont want to copy the code from the first into the second and the first and second into the third.
 
My mind isn't working and there is probably an extremelly simple way to get this working.
 
I know I could used functions but for some reason it stops the instance referencing working: _root["bullet"+j] doesnt work in a function.

View 7 Replies

ActionScript 2.0 :: Loading Data From XMl File And Uses It To Run An If Statement. If Statement Fails?

Oct 10, 2008

The Flash movie contains 2 Text files, one Component button, and 1 component checkbox.The purpose of the application is to load an XML file(works)Populate 2 text fields with information from the XML file(works)Compare the two text fields, if they contain the same information then the checkbox, via AS is told to be selected. (Heres the problem);

Heres the code:

Code:
runCode_btn.onPress = function() {
data_xml = new XML();
data_xml.ignoreWhite = true;
data_xml.onLoad = function(success) {

[code]....

The idea behind this app is that its an electronic form. The user fills it out, the information is then sent to a newly created XML file, months later the open the XML file in flash, and Flash fills out text fields and check and or unchecks Checkboxes based on the XML data.CheckBoxes are mandatory.But I don't see how I'll be able to use them if i can't create and condition statements based on the loaded Data.

View 1 Replies

ActionScript 3.0 :: Another 'if' Statement Inside An 'if' Statement?

Sep 22, 2010

I need to write an if statement inside an if-else statement. But no matter how I write it it keeps giving me a syntax error.The syntax error is "1083: syntax error: else is unexpected".[code]No matter how or where I place the braces, it keeps giving me errors.

View 13 Replies

ActionScript 3.0 :: Use A For Statement To Create An If Statement

Jul 12, 2010

what I'm trying to do is create an else if argument for each object in an array based on a user set number

Code:
for(var i:int=0; i < numberOfElseIfs; i++){
GENERATE AS3 CODE
}

to which I want it to GENERATE THE FOLLOWING CODE:

Code:
}else if(baskets[i].used == false){
baskets[i].used = true;
drawButton(i);
}

the problem is obviously that the compiler reads this code rather than understanding I'm trying to regenerate the code within the for loop...does that make sense :S? So basically I need as3 to read the code between the for statement as if it is going to echo that out later. Is this even possible?

View 4 Replies

ActionScript 3.0 :: Write Another "if Statement" Inside Another If-else Statement?

Sep 22, 2010

I have a script which is giving me a lot of trouble since I have no idea how to write another "if statement" inside another if-else statement. I keep getting errors, I guess I don't know where to put the braces exactly...

example:
if(bla == bla) {
<------------how would I write another if statement here?
}else if (bla == bla){
}

View 3 Replies

Flash :: "IF" Statement, Within A For Statement, To Control Movieclip Within Movieclip?

Dec 18, 2011

I have a movieclip on the screen called "mc_bg". Within this movieclip are 7 movieclips called "barrier1" through "barrier7".From main.as I want to be able to do this call:

for (var i: int = 1; i < 3; i++ ){
trace("got here")
trace(mc_bg["mc_barrier" + String(i)])

[code]....

View 1 Replies

Flex :: Specify Swc When Building A Swf?

Jul 7, 2010

I have implemented some utility classes in Flex that I want to use in multiple AIR projects. I have created a swc which contain these classes. I am working on a Linux machine and do not have FlashBuilder. So I am using the compc and mxmlc command line SDK tools. My problem is that I have not been able to find a way to specify the swc when building the standalone project. A tutorial suggested the following command: mxmlc -load-config /opt/flex/4.1.0/frameworks/air-config.xml -library-path=/path/to/utility.swc hello.mxml. However, using that gives me the error hello.mxml: Error: Unable to locate specified base class 'mx.core.WindowedApplication' for component class 'hello'. Everything works fine if I move all code from the swc to a single monolithic pro ject. The code for the standalone project is:

<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" windowComplete="completeHandler();">

[Code].....

View 1 Replies

ActionScript 3.0 :: Building A XML File?

Nov 25, 2009

I am creating a tool for use at the office. It has, at this point, about a dozen text fileds. From these textfields I want to build an XML document using AS. The way it needs to work is when a user enters text into these fields and hits the submit button that text is put into the propper tags. Each time the user hits the submit button another block of XML code is added to the file.

Here is most of the code. I am building this on another computer which is not online so I am only showing the important stuff here. It works so far but the only output I have seen is a trace. I could have the user manually copy and paste this output to the XML document but I would rather have the document built by the program each time the user hits the submit button. Am I even on the right track here? I have the correct output, now how do I add this output to an existing XML file?

function loadFile(){
var fileName:TextField = docName; //loading an existing XML file.
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.Complete, loadXML);

[code]....

View 2 Replies

Building An Item In Flash

Aug 18, 2009

I have no idea what to call it or where to start looking, so I am putting it in the generic and hopefully someone can point me to the right forum or area. Here is my project and I am trying to teach myself how to do these things. I had great help in making buttons on here a while back, now I am trying to build an object right in flash. The easiest thing for most to relate to is a computer that is being built from scratch. So, You start with a base picture of an open sided computer with a list of components underneath. By draggin those components to the box, it snaps them in place. You can also remove them the same way. When done, you click a tally button and it shows a list of all the components you added with product numbers.

View 2 Replies

ActionScript 3.0 :: Building An MP3 Player?

Sep 25, 2009

I have the below actionscript almost working for playing mp3s. This isn't dynamic or anything. Just links to songs (from buttons) that should null each other out when clicked on. The first song loads fine. However, the second song will not load. I must be missing something. Or maybe I took the wrong approach? Any help would be great.

[Code]...

View 2 Replies

ActionScript 3.0 :: Add Variables Building On The Fly?

Oct 16, 2010

I remember reading somewhere how you can add variables building on the fly but can't find any references. What I have is a MovieClip in my library. I will use it to create several Menu Items.
 
This is what I have written:
LessonButton = new mcLessonBtn();LessonButton.name = "menuLesson"+i;this.addChild(LessonButton);

View 6 Replies

Media :: Building Server For FMS?

Nov 30, 2010

I have built a flash app that utilizes an rtmp feed to stream video and I want to be able to stream my own content. I am looking into building the machine that will run Flash Media Server and was looking for some pointers before I get started.
 
My flash based application runs independently on a large touch screen and is going to be the only pc accessing this server, so I was wondering how beefed up the server needed to be. I would like to get it stream three live hd feeds. Can I run Flash Media Live Encoder and Flash Media Server on the same machine?

View 2 Replies

Building An App To Call A .swf Game?

Aug 7, 2011

I'm looking to build a flash application that acts as a "shell" around a flash game.I only need it to do some pretty basic functions:

1) Calls a PHP script I wrote to determine a few things (if user is logged in, what their userid is)

2) If the php file says the user is logged in, the "shell" should let the user play a .swf flash game that I wrote. And, after they are done playing my .swf game, I want the game to pass out a parameter (score). Again, the "shell" will call a prewritten php script to store the score.

3) If the php file says the user is NOT logged in, the "shell" should display a login box (username/password).

My main challenges have been getting one flash application to call another. (ie: the shell app calling my game). Is this possible?

View 1 Replies

How To Implement Interactive Building Map

Dec 16, 2009

I need to build an "interactive floorplan" for a shopping centre (or two). Many shopping centre websites already have this (eg Bluewater in the UK). Traditionally, the way to build such a floorplan / map is to do it in Flash. The actual floorplan is a Flash asset and the data that describes which retailer is in each location is fetched from the webserver as XML. That way editors can update the location of retailers without having to edit and recompile the SWF file. However if the floorplan itself changes (for example, a larger shop is split into two smaller ones) then the map has to be edited. Another disadvantage is that the data isn't readily available to third parties for mashups etc. So apart from Flash what would you consider using to achieve the same effect? I know of SVG but IE doesn't support it.

View 1 Replies

Actionscript 3 :: Building A New Dictionary Out Of An Old One?

Aug 31, 2010

I'm working with a large set of hierarchical taxonomic terms, where each term ("203") has a matching "term203" movie clip on the stage, and am having trouble getting a recursive function to return all of a given term's descendants.There is a main Dictionary() object with the following nested organization for each term:

{ [object Movie Clip] : { "tid":203, "parent":99, "name":"Culture", selected:false, "otherData":"etc" } }

...where the [object Movie Clip]'s instance name would be "term203". All of these object:subObjectArray items ("terms") are stored in a master taxonomy:Dictionary() object.I've been trying to make a recursive function (which is in itself already a little above my head) that takes the click.target of a movie clip and returns a new Dictionary() object with all of the children and grandchildren and great grandchildren (etc) of that term, in the same, nested organization described above.

The code below traces the right number of recursive loops, but the returned Dictionary() object only contains the first run's terms (only the immediate children of the requested term).

var taxonomy:Dictionary = new Dictionary();
// ...Term info is loaded into taxonomy from a JSON-style text file)
// ...MOUSE_OVER event listeners are added to each

[code]....

I certainly do not claim to be the most efficient AS3 programmer, so I am open to alternative configurations. However, after trying static and nested Arrays, I would prefer to continue using the Dictionary() object as my main pool.As noted, only the immediate children end up animating in the revealChildren() function. It's mystifying to me then, that in the getAllChildren() function, all of the descendants trace sequentially (well in no particular order) in the output window.Also I can't get any sort of name or property out of the subSet Object. That could be the problem.I've only tested it as far as 'two generations,' but it seems that only the first round of calling the function successfully adds those terms to the new Dictionary() object and returns it intact to the animating function.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved