ActionScript 2.0 :: Passing Variables Between Functions?

Oct 16, 2007

I am building a flash photo gallery that is fed by an XML file, now I am fine with all of the XML things in flash, my problem comes when creating the thumbnail images onRelease event. Here is my code:

Code:
_global.counter = 0;
for (_global.counter = 0; _global.counter<itemArray.length; _global.counter++) {
//populate thumbnail array with URLS

[code]....

The problem is that when I release the mouse button I get a variable undefined error in the output window. I have researched and have found that my problem is that I can't pass a variable from the main function to the onRelease function.

View 3 Replies


Similar Posts:


ActionScript 3.0 :: Passing Functions Through Functions From Different Classes?

Dec 27, 2009

Let's I have a class Square that has a several functions. I want to call it from a class Grid, which is a group of Squares.So in the class file for Grid, how would I do this:

Code:
public function doSquareFunction(thisFunction:Function):void{
square1.thisFunction();

[code]......

View 8 Replies

ActionScript 3.0 :: Passing Functions From Different Classes?

Dec 27, 2009

Let's I have a class Square that has a several functions. I want to call it from a class Grid, which is a group of Squares.So in the class file for Grid, how would I do this:

Code:
public function doSquareFunction(thisFunction:Function):void{
square1.thisFunction();

[code].....

View 5 Replies

Flex :: Passing Values Between Functions

Jul 2, 2009

is there any way to locally define a variable in a function and then pass it to the oher function. I mean to say is it possible the pass a local value from one function to other function.

View 3 Replies

ActionScript 3.0 :: Passing Functions Between Classes?

Oct 27, 2009

This probably has a simple solution, but I'm a complete newb to actionscript and I could really use some guidance.I have a file, called Politismos.fla. The document class of this file is: com.plaidfox.PolitismosClassPolitismosClass.as is as follows:

ActionScript Code:
package com.plaidfox {
import flash.display.MovieClip;

[code].......

View 9 Replies

ActionScript 3.0 :: Passing Arrays Into Functions?

Dec 23, 2010

I have been told that it is dangerous to pass arrays into functions because doing so can cause memory leaks.Could someone please explain how and why this happens?

View 1 Replies

ActionScript 2.0 :: Passing Arguments To Functions?

Dec 31, 2002

i have a music jukebox, with ten buttons. in the first keyframe, of the main timeline, a put a function that will be used for every button to load the mp3 to play. The problem, is that when i pass the arguments on each button to call the function, the "filme" and "som" arguments are lost.

here is the function:

function carregaSom(filme, som, url, msg1, msg2, tempoComeco){
_root.createEmptyMovieClip(filme, 1)
som=new Sound(filme);

[Code].....

View 1 Replies

ActionScript 3.0 :: Passing Parameters To Event Functions?

Dec 16, 2008

I like reusing functions repeatedly so I pass the object to the function (blur, drop shadow, etc.) but if an Event or MousEvent function is involved, I have to do things I don't like. In my example, I had to put the TimerEvent.TIMER_COMPLETE function as a sub function of the setTimer function. I would rather keep the functions apart but I don't know how to pass a parameter to the event function to tell it what movieclip(timerObject) to fade in. Is there a better way to do this?

View 2 Replies

Flash :: Passing Values Through Functions In Mxml?

Feb 11, 2012

I currently have a basic application where we have multiple buttons, which have functions activated by "click" event listeners on those buttons. The issue is that each button does more or less the same function; just the data that is loaded for each button is different. How do I make it so I'm able to recycle the same function? In Javascript or AS3 something along these lines would be done...

<s:Button id="btn_1" x="378" y="601" label="Button 1" click="photoSwap(event,"image1.jpg")"/>
<s:Button id="btn_2" x="350" y="601" label="Button 2"

[Code].....

But that's obviously not how it works. I've tried trouble shooting the issue but haven't been able to find anything. It works when I have each button having its own function, but that seems really silly and shouldn't need to be done.

View 1 Replies

ActionScript 3.0 :: Counting Function / Passing Vars Between Functions

Jun 21, 2010

Could anyone suggest how to fix the function at the bottom so that when button forward_btn with label "Go to next Training Point" when clicked recalculates the fields created in function fileLoaded.[code]

View 2 Replies

ActionScript 2.0 :: Passing Variable Names As Arguments For Functions?

Sep 24, 2008

Is it possible to pass variable as arguments for a function? I wish to update a boolean variable via a function, by passing the name of the variable to the function, like so:

Code:
function ENVSegment(curSegment:Boolean, nextSegment:Boolean) {
curSegment = false;
nextSegment = true;
} var attackSegmentIsRunning:Boolean = false;
var releaseSegmentIsRunning:Boolean = false;
[Code] .....

Much shorter, and easier to understand. Also, less repetition of the same blocks of code over and over...

View 1 Replies

ActionScript 3.0 :: Passing Parameters In Functions And Event Listeners?

Jun 21, 2009

I'd like to know what's the different using global functions and functions with param..Why using params? When the as3 developer uses it?

View 3 Replies

ActionScript 3.0 :: Passing Variable Into Different Functions Called By Event Listeners

Jun 30, 2011

I have 2 functions. Each one is being called by a different event listener. Both event listeners work because I am able to trace strings in both of them.. my problem is that i am trying to create a variable that is local to both functions. The first function "working" adds a number to the variable and when the second event listener triggers function "notworking" which retrieves this same variable called "counting" both functions are called automatically by event listeners.. how do I do this? i am stomped!

[Code]....

View 5 Replies

AS3 :: CS3 - Calling Variables From Other Functions

Aug 20, 2009

If I have a function and I want to call a variable from another function (only 1variable), how do I do it? I know in the olden days you could set the variable to local or global, but that does not seem to work anymore. There is only 1 variable I need access to, but all the tutorials I have come across talk about making classes for multiple variables.

e.g. function2();
{
variable_b = variable_a;
}

[Code].....

View 3 Replies

Dynamic Variables In A Functions?

May 8, 2010

Why does this not work???

Code:
function myFunction(val0,val1,val2){
trace(this["val"+0);
trace(this["val"+1);
trace(this["val"+2);
}
myFunction("hello","test","hi")

All i get is undefined. If i just put "trace(val0)" i will get "Hello" -- so i cannot work out how to get the value of the dynamic variable inside hte function?

View 4 Replies

ActionScript 3.0 :: Variables Used In Functions

Mar 16, 2012

I got this variable:[code]is there a possibility that the compiler gets confused because my variable has the same name like the functions's parameter (type = type)? i'm not certain about this topic. Normally I'd write my function's parameter like this (if such a case occurs):[code]just to make sure the names do not exactly match.

View 3 Replies

ActionScript 2.0 :: Variables In Functions?

Nov 16, 2005

I can't figure this out.

Code:
function createTextBoxes() {
for (var n=0; n<caption_obj.textXML.length; n++){[code].....

The XML portion is working fine. What I'd like to be able to do is access the created text fields outside of the function. For example:

captions1.alphaTo(0,1,"linear",1);

This works fine when it's inside of the function, but outside of it, it won't. Basically I need to time the captions to things that are happening in an animation. The animations are also tween driven, so it would be something like obj_mc.tween("_x", 200,2,"linear", 5,fadeOutCaption1); with fadeOutCaption1 being a function that fades out the first caption and brings in the second. If there is a better/more effecient way of doing this let me know.I also can't seem to apply any styles to the text field. Do I need to create an array or object with ["captions"+n] and then pull from that?

View 2 Replies

ActionScript 2.0 :: F 8 - Passing Variables From One SWF To Another?

Feb 8, 2009

I have a swf with an input text box and a button. When the button is clicked, I need it to open another swf in a new window on a different domain and pass the variables to a dynamic text box in the new window. I looked at local connect but I wasn't sure it would work because the two windows wouldn't necessarily be loaded at the same time and they are on different domains.

View 4 Replies

Passing Variables Between .swf Files?

Sep 9, 2009

I am loading images into a movie clip dynamically from an XML file. Based on what image the user clicks, I would like to be able to open a separate window, displaying a different image. Ideally, I'd pass the variable of which image was selected to the new open window.I've done some research online, and am thinking I'm making this harder than it needs to be.

Actionscript from main movie

Code:
chosenImage.onPress = function() {[code]......

I've also seen where I could possibly pass a variable through ASP.NET, but am experiencing the same errors when trying to pass the variable. I suppose I could embed the popup.swf file in a new .aspx page, that would probably be acceptable.

View 1 Replies

ActionScript 3.0 :: Passing Variables On URL?

Jan 6, 2010

I'm using IE 8 and trying to open an HTML file. All files are either local or ran on a server. Problem is I use the URLVariables object, and they still won't get passed. for example:

Code:
var req:URLRequest = new URLRequest("Y:/htmlFile.html");
var urlVars:URLVariables = new URLVariables();

[code].....

View 14 Replies

ActionScript 2.0 :: Passing Variables Between Mc?

Jul 21, 2010

I just want to show the contents of the input data in Movie Clip Movie Clip A into B which is still in one layer.

View 2 Replies

Passing Variables Between MovieClips?

Sep 6, 2010

I'm trying to develop a site map, which draws a tick over the sections of my app that have been completed. I've figured out how to draw the tick and how to pass variables from root to the MovieClip that the function is in.

To make the tick appear only after an mc has been watched, I tried setting a variable equal to 1 ino the last frame of the MovieClip, and telling the function to run if that variable was 1.

I'm not getting compiler errors, but I'm also not getting the tick. And I'm definitely completing the Movie

Here's what I've got so far: In root

Code:
var xcoord = 125;
var ycoord = 300;
var WaterComplete = 0;
In WaterMovie

[Code].....

View 3 Replies

ActionScript 3.0 :: Passing Variables Between Two Swf's?

Nov 25, 2008

I am trying to pass value and string from AS3 main.swf to AS3 child.swf loaded in it. But, Nothing is working and i can't get the value from one to another. As Beginner in AS3, i was working for a long time and
still i face these problems and no output yet.

[Code]...

View 1 Replies

ActionScript 3.0 :: Passing Variables To PHP

Nov 17, 2010

I am having some trouble in passing variables from AS3 to PHP. I am using flash and php both in the same file [try.php]. I've stuck with this for two days.. Here's what I have done. header.fla [Actionscript in the timeline]

[Code]...

View 5 Replies

PHP :: XML - Passing Variables From Flash

Sep 4, 2010

Creating a flash project where users can visit the site, and turn off/on objects in a house (ie. lights, tv, computer, etc.) The next user who will visit the house in the website, will see what lights or house appliances were left on. Flash variables are passed to PHP, and those variables are saved in an XML file. (For testing to see what is being saved to the XML file, on each click --vars.xml opens.) In the vars.xml file, I see that the house objects that were last turned on--are saved in the XML file- But in the SWF file, only one of the objects that are listed in the XML are turned ON. Only the last object that was clicked on would show ON--not all the objects in the XML file.)

package {
import flash.display.MovieClip;
import flash.events.MouseEvent;
import flash.events.Event;
import flash.text.*;
import flash.net.*;
public class House extends MovieClip {
[Code] .....

View 1 Replies

ActionScript 3.0 :: Passing Variables To PHP?

Nov 19, 2010

I am having some trouble in passing variables from AS3 to PHP. I am using flash and php both in the same file [try.php].

I've stuck with this for four days.. Here's what I have done.

header.fla [Actionscript in the timeline]

Code:
stop();
import flash.events.Event;
import flash.display.Sprite;

[Code].....

View 5 Replies

ActionScript 2.0 :: Passing Variables From SWF To SWF

Sep 4, 2005

I am using FLASHVARS to pass a variable (Status) from ASP to Flash.This piece of Flash (named Header), calls another SWF (named InOutPencil) using this command:[code]My problem occurs when I try to use the Variable 'Status' in the InOutPencil SWF (below).[code]I need a way of passing the value of the variable 'Status' from Header to InOutPencil.

View 3 Replies

ActionScript 2.0 :: Passing Php Variables?

Feb 24, 2006

I need to pass the following php information into flash...

<?php
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
$link = "<img src ="$mosConfig_live_site/images/comprofiler/tn";
$link_gallery = "<img src ="$mosConfig_live_site/images/comprofiler/";

[Code]....

This php script displays the top 20 users from a database based on their hit count. The script passes their avatar (image), username and link, as well as total hits.

I wanted to create a flash file with one movieclip that would parse the php file and display the results in an i++ fashion, so that I could make changes to only one mc instead of 20, when needed.

I have tried making a dynamic text field an mc, and assigning the loadvars object to that mc... but can't get any information to display... and I know the php file works like a charm.

View 10 Replies

ActionScript 2.0 :: Passing Variables Into A MC?

Nov 21, 2007

in my main movie, i have done a survey, see my previous thread which collects data from a series of radioButton groups. i can display this data using dynamic text boxes no problem, however i also wish to display this data in a separate swf which has been loaded into the main movie via a movieclip using

Code:
_root.cm_handler.loadMovie("movie2.swf");

View 1 Replies

ActionScript 3.0 :: Passing Variables From PHP?

Aug 31, 2008

i got this working in AS2 and PHP, but i can't use the VAR option on the dynamic text ... so how would i do this in AS3 ?

here's the simple code

using AS2 and PHP 5.2.6

ActionScript Code:
//
// create an object to store the variables
varReceiver = new LoadVars();
// load the variables from the text file

[code]....

and the PHP Code in info.php

PHP Code:

<?php$fName = "nuno";$lname = "mira";$age = 24;// echo or print the variablesecho ("&fName=$fName&lName=$lName&age=$age&");?>

View 6 Replies







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