ActionScript 3.0 :: Query - The NewLoader Function Needed A Different Variable Everytime The Loop Increments?

Sep 20, 2011

I am currently working on a picture slide show tutorial and i fully understand whats going on, except when a variable that gets placed outside a "for" loop that gets used within the "for" loop to create multiple loaders. Secondly, i would of though the newLoader function would of needed a different variable everytime the loop increments? I know i'm so incorrect but I was hoping someone would straighten me out on it here is the code too

[Code]...

View 3 Replies


Similar Posts:


ActionScript 3.0 :: Get A Variable (thumbnailBarMovement) To Accelerate Up To 5 In Increments Of 0.1?

May 8, 2011

Im trying to get a variable (thumbnailBarMovement) to accelerate up to 5 in increments of 0.1 (thumbnailBarSpeed).

[Code]...

View 1 Replies

ActionScript 2.0 :: Prototype Function - Key Press In Increments?

Dec 29, 2003

I have this prototype function:
[AS]
MovieClip.prototype.moveRight = function() {
// when it enters the frame
this.onEnterFrame = function() {
oldx = newx;
// if timelineMC._x less than or equal to howFarRight
if (timeline._x<=howFarRight) {
[Code] .....

Which works great except that it scrolls the whole thing all at once. Is it possible to put some kind of increment in there so that on a key press it only moves a certain amount of pixels?

View 8 Replies

ActionScript 3.0 :: Store A List Of Parameters Needed For A Function In An Array And Then Use That In A Function Call?

Jun 23, 2009

is it possible to store a list of params needed for a function in an array and then use that in a funciton call?

[Code]...

or something like that?? Prob have to iterate the array but how do i get the params into the function call? Is this even possible?

View 6 Replies

ActionScript 2.0 :: Using The For Loop Variable In Function?

Mar 19, 2011

How would I use the for loop variable within a function contained in the loop?

ActionScript Code:
for (var i = 0; i<arrowNumber; i++) {
myVar=i;
tempHolder.onRelease = function() {

[Code]....

View 7 Replies

ActionScript 3.0 :: Get The Value Of The Variable Constantly Outside The Loop Function

Aug 11, 2010

What i want to do this time is to make a function that calculates the speed of a moving object and then assign this value to a variable, for global use (or just make an .as class and place the function there for general use. I made the loop function that calculates the speed of the object ("ball" is it's instance name), but i cannot find a way to assign the calculation's value as the result of the function "speed" that calls the loop. Or, a way to get the value of the "v" variable constantly outside the loop function. Here's my code:

[Code]...

View 3 Replies

ActionScript 3.0 :: Having Flex To Do Function Everytime It Appears

May 6, 2009

I've noticed if I use initialize="myfunction()". Once "myfunction" has ran it will never be ran again if i use initialize. I need to reset a form basically. Or anything else I can use instead of initialize that will run the function every time.

View 1 Replies

ActionScript 3.0 :: Delete An Un-needed Function?

Oct 16, 2009

I have:

ActionScript Code:
package
{

[code]....

View 5 Replies

Actionscript 3 :: Declare Variables Globally Or Within A Function Only When They Are Needed?

Jul 14, 2010

I am working with URLLoader and URLRequest in this case.

I have two buttons. One listens for the mouse click event and then runs the following function (less code not applicable to this question):

function loadURL (e:MouseEvent):void {
....
var myRequest:URLRequest=new URLRequest("*URL*");
myRequest.method=URLRequestMethod.POST;

[Code]....

The other button, when clicked, calls another function, say resetAll, that then resets the "session" by clearing out all the current variables and canceling anything currently in progress. Within that function I want to call myLoader.close(myRequest); but myLoader is not accessible from within resetAll.

In this case, should I declare var myRequest:URLRequest=new URLRequest("*URL*"); and var myLoader:URLLoader = new URLLoader(); outside of the function even if I do not need them yet?

View 3 Replies

ActionScript 2.0 :: ClipEvent - Reset Or Refresh (unload, Reload) This Function So It Works Correctly Everytime Load A New JPG?

Sep 1, 2006

I have a blank container mc into which I am loading JPGs after you click on a button. There are 10 buttons in the movie, each associated with a different JPG.This container_mc is part of a function called on the main Timeline.The Flash movie is 1 frame on the main Timeline. This code works correctly on the first JPG when I click on a button for the first time), but then when you click on a different button I believe it just uses the dimensions and coordinates of the first JPG. How can I reset or refresh (unload, reload) this function so it works correctly every time I load a new JPG?

//after full size image loads into detailthumb_mc,
//resize image so that neither width nor height is > 150, tben recenter
onClipEvent(load) {
var maxWidth = 150;

[code]....

View 2 Replies

ActionScript 2.0 :: Place A For Loop In A Recursive Function With The Function Call Within The Loop

Nov 4, 2005

If you place a for loop in a recursive function with the function call within the loop... will the loop finnish or does it stop working untill the last recursion?

View 2 Replies

ActionScript 1/2 :: Pass A Variable (an Mp3 URL) Generated From A SQL Query With PHP

May 24, 2010

I'm trying to pass a variable (an mp3 URL) generated from a SQL query with PHP to a small flash mp3 player embedded in the page. I am using FlashVars and its not receiving the .swf is not receiving the variable.
 
Here is the embed code:

[Code]...

View 6 Replies

Php :: Calling A Page With MySQL Query From Javascript Function Then Returning Results To Another Javascript Function

Jul 8, 2010

I am refactoring some code. I have a PHP page that contains a MySQL query and stores the result in a PHP variable $my_result. This result is then echoed to a Flash SWF during embedding with SWFObject. I now want to call this PHP page that makes the query from a javascript function like so - one change I have made to the PHP is that instead of storing the result in a variable $my_result I am echoing the result. Javascript function to call the PHP page and make the database query

[Code]....

View 2 Replies

ActionScript 3.0 :: Passing Variable To FLVPlayback Via Query String

Jan 23, 2009

Here's the html that I'm trying to pass the flv name to the FLV component

View 1 Replies

ActionScript 3.0 :: Loading An Image As Variable From Query String

Oct 26, 2010

I'd like to dynamically load a image into my script. Ie/ myMovie.swf?image=myimage.jpg If no image gets passed - the script should use the default.jpg instead and load normally. This is what I've tried so far....

var CoverName = stage.loaderInfo.parameters["CoverName"];
if (CoverName == null) {
CoverName = "images/default.png";
}

View 0 Replies

ActionScript 2.0 :: Text Query In Flash 4 - Make The Whole Title Into One Variable?

Jan 22, 2003

I'm been having a bit of problem with Flash 4 and text variables. This is what I want to do: I have a blank title that I want people to complete: The (something) of the (something) (something) where people select words from lists to complete the title. I also want it to be centred on a mock book cover. The problem is that I can't work out how to make the whole title into one variable, which I can them place on the cover. Going by the tutorials I've seen, it should be something like:

[Code]...

View 5 Replies

ActionScript 2.0 :: OOP Query - Function Running For All The Movieclips On Stage?

Jul 16, 2004

I have a query regarding OOP and Movieclips and custom classes (something I haven't been able to get the hang of). I will try and demonstrate my question with an example (I can't think of how else to explain it).

1. I have created a custom class with a variables and a function

function myNote(myNumber){
var myNumber;
}

2. I have then added a prototype of the movieClip class

myNote.prototype = new MovieClip();

3. Created another function

myNote.prototype.onMouseUp = function(){
trace("The number of the note you have clicked is: "+ this.myNumber);
}

4. Finally I have registered the custom class with a movieclip in the library

Object.registerClass("note", myNote);

5. Then I create a few instances of the movieClip on stage

attachMovie("note", 'n0', 100, {myNumber: '1'});
attachMovie("note", 'n1', 101, {myNumber: '2'});
attachMovie("note", 'n2', 102, {myNumber: '3'});

THE PROBLEM: Now that I have three instances of the movieClip on the stage, so when I click on any of them, the function (onMouseUp...) is summonded and the number (myNumber) of the movie clip is traced in the output window.But instead of showing the number of the movieClip i clicked on, I get the numbers of ALL the movieclips on stage.Why is the function running for all the movieclips on stage? Where am I going wrong? You see ultimately I would like that whichever movieClip i click on, it should change a varibale flag (which will be defined in the class) to activated, but if I face the above problem, then all movieclips will have their flag values changed to activate irrespective of which i click on.

View 4 Replies

Professional :: Query String Variable Based On Coldfusion Template Body Element Id

Jan 25, 2010

I'm using a Coldfusion Dreamweaver template with cfinclude tags.  The header contains a flash movie where I'd like to pass 2 variables via a query string to load the correct image and menu button based on the variables in the ActionScript.
 
Example:  <param name="movie" value="flash/header_v8.swf?pic=1&button=1" />
 
pic variable can be 1 - 3 and button variable can be 1 - 7  depending on the each pages body element id.  So the logic would be something like this for my flash movie:
 
if body id =home, then pic=1 and button=1
if body id =about, then pic=current variable and button=2
if body id =page3, then pic=1 variable and button=3

[Code].....
 
What's the best way to pass these variables depending on the current page body element id?

View 1 Replies

Query - Run A Sqlite Query In Flex To Count The Total Number Of Records?

Apr 16, 2010

I'm trying to run a sqlite query in flex to count the total number of records I believe its working fine but I just can't figure out how to display the results - all I get back is [object Object].

private function overviewOne():void{
var stmt:SQLStatement = new SQLStatement();
stmt.sqlConnection = sqlConn;
stmt.text = "SELECT COUNT(user_id) FROM tbl_user WHERE status_status ='Away'";

[code]....

So how do I make a reference to the COUNT(user_id)?

(flash.data::SQLResult)#0
complete = true
data = (Array)#1

[code]....

View 1 Replies

Actionscript 3 :: Flash Cs5: Set A Variable Using A Function, Then Read That Variable From A Different Function

Jan 29, 2012

I have a public variable and I am trying to set it, then read it from a different function:

public var str:String;
public function DailyVerse()
{
function create() {

[Code]....

My trace results says null. Why does it not give me "hello"?

View 1 Replies

Actionscript 3 :: Declaring Variable In Loop Or Before Loop?

Nov 9, 2010

Should I declare the _mcContainer var before the loop or no? (performance increase?)

for(var i:uint = _startIndex; i <= _endIndex; ++i){
var _mcContainer:MovieClip = _mcParent["i_" + _position];
}

[Code]....

View 1 Replies

ActionScript 2.0 :: Pass The X Variable From One Loop To Within Another Loop?

Mar 2, 2007

I have some code that seems to have a problem. I can't seem to pass the x variable from one loop to within another loop.

Code:
var myLv = new LoadVars();
var myNv = new LoadVars();[code]....

View 2 Replies

ActionScript 2.0 :: Key Press In Increments?

Dec 29, 2003

WHY AM I NOT OUT SNOWBOARDING?! THERE ARE 20 NEW INCHES OF POWDER ON THE MOUNTAIN! ARGH! WORK SUCKS! But to a more forum-appropriate question: I have this prototype function:

[Code]...

which works great except that it scrolls the whole thing all at once. Is it possible to put some kind of increment in there so that on a key press it only moves a certain amout of pixels?

View 8 Replies

Call Script At Certain Number Increments?

Apr 13, 2009

Not sure what to call this. I want a function to fire at a certain increment of a given var number, without having to say if (var >= 1000 && <= 2000 || var > = 2000 && <=5500){ etc etc etc. for example I want it to fire when it gets past 1000, then fire again when it gets past 2400 so on, and so fourth. To make matters more clear, im trying to make player experience that launches the level up screen at the given numbers ^^ I dont even know where to begin with how to do this, is it an array function?

View 6 Replies

ActionScript 2.0 :: Alternate Button Pressing Increments A Bar

Jan 6, 2006

I have recently started a new project, again and hit a stump. Im trying to make a mini game where you have to press two alternating buttons (x and z) to increment the bar. Now i started it, but it failed as pressing any button really fast incremented the bar. i used a _root.onEnterFrame = function() { code, but im having troubles. So what i want to do is have the user press the x button, and then have to press the y button and the bar increases and they have to do this rapidly.

View 4 Replies

ActionScript 2.0 :: Moving A Movieclip In Constant Increments

Jan 4, 2007

I was wondering if there is a way to adapt this code I am using on a button.[code]This code works fine on the button and moves the movieclip each time the button is pressed by the viewer. My problem is, I would like the viewer to be able to just hold the button down and the movieclip would constantly apply the _y -=4.Is it possible to adapt this script to make it constantly move while the viewer holds down the button? As it stands now, it only moves once when the viewer clicks the button. So in order to move the movieclip 8 pixels, the viewer would have to click the button twice.

View 9 Replies

ActionScript 2.0 :: Moving A Movieclip Set Increments With Buttons

Jan 29, 2008

I'm using Adobe Flash CS3 / ActionScript 2 to develop a site, the relevant part of which can be seen at [URL] The black boxes underneath the 2x4 grid of icons are placeholder graphics for left and right arrows which move the icons above to the left and right. The left and right buttons work, after a fashion, but I'm having difficulty controlling the motion. As each button is pressed, I want to reveal one more layer of icons, and have the scrolling stop when the end of the list is reached. At the moment, one can use the buttons to scroll the icons off the screen.

Secondly, if the left / right buttons are clicked in very quick succession, the icons above do not display correctly - they're no longer centred in the mask above. Is it possible to have the buttons 'ignore' any clicks whilst the icons above are moving, thus ensuring that the icons always display correctly? Finally, is it possible to have the left/right button disappear as appropriate when the left/right hand end of the menu is reached? Here's the code I've been using to control the motion:

[Code]....

View 2 Replies

ActionScript 2.0 :: Using Var From For Loop In Function Outside Of Loop?

Nov 2, 2009

I have a variable in a loop that i want to access in a function outside of the loop. However the variable gets deleted when the loop is closed so no longer exists when i call in the function.here is the code; i'm trying to access the variable picHeight from within the scroll function

Code:
pauseTime = 3000;
xmlImages = new XML();

[code].....

View 3 Replies

ActionScript 3.0 :: Passing HTTP Query String To Flash Query String

Aug 26, 2010

I am successfully Passing HTTP Query String to Flash Query String.

Resuming:

inside html

Code:
' <EMBED src="Film1.swf'+document.location.search+'"
'+
inside as3

[Code].....

Then Film1.swf can't grab no more the userName parameter.

View 4 Replies

ActionScript 3.0 :: Passing HTTP Query String To Flash Query String?

Aug 26, 2010

I am successfully Passing HTTP Query String to Flash Query String.Resuming:inside html

HTML Code:
' <EMBED src="Film1.swf'+document.location.search+'"
'+

[code].....

View 1 Replies







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