Flex :: GetStudentName Function Simply Returns Undefined Every Time?
Jul 14, 2011
So, in my main mxml, i have a variable defined as such:
[Bindable] public var studentsListDict:Dictionary = new Dictionary;
I also have the following imported:
[code]...
Unfortunately, the getStudentName function simply returns undefined every time.It wasn't working b/c you can't have numbers as keys in a dictionary. Simply casting them to a string during the declaration and look up seems to work just fine.
View 2 Replies
Similar Posts:
Oct 2, 2006
I have this code
[Code]...
Well i have some labels at my timeline and i pass them as an array. The problem is at the onRelease event. It returns undefined. I cant figure out how to solve it.
View 3 Replies
Feb 10, 2012
I am trying to get the value of a global variable from JS. The variable is defined in the HEAD section of my HTML document.
if(ExternalInterface.available){
return ExternalInterface.call("window.myVar.toString()");
}
As I debug my application this call keeps returning "undefined" but if I make the same call in firebug's console it returns a string as expected.
View 3 Replies
Aug 12, 2010
My AS3 class has some quirks. It's sort of a guestbook, so someone can add a 'question'under a certain category. When I publish the results in a dynamic textfield or when I trace the results I get the existing XML values and some undefined ones.This is my AS3 script:
Code:
//Class name is AddQuestionMenu
public function AddQuestionMenu()
[code].....
View 6 Replies
Nov 18, 2005
On the timeline, I set up an array with 'section' names. When the mouse is clicked, a listener traces the section name to output.
Code:
var pageName:Array = new Array();
pageName [0] = "newsHolder";
pageName [1] = "aboutHolder";
pageName [2] = "reelHolder";
pageName [3] = "printHolder";
[Code] .....
That works fine. But I also have a button on the stage:
Code:
on (release) {
trace ("testing "+pageName [0]);
}
But this returns "testing undefined".
View 5 Replies
Oct 2, 2008
I'm building a play/pause button for my movie, and here's how I have it setup: The main button object is playPause_btnThe first layer of the button has a movie clip with the pause graphic, named pause_mcThe second layer of the button has a movie clip with the play graphic, called play_mcOn the button's click event, I want to set one of the graphics to 0 alpha and the other to 100 depending on the state, so only one graphic will show through The problem is, for some reason ActionScript returns UNDEFINED when I try to reference playPause_btn.play_mc -- and when I do a dump of the movie's objects, I see entries for _level0.playPause_btn.instance12 and _level0.playPause_btn.instance13 instead of the play_mc and pause_mc objects. Why aren't the objects' instance names accessible??
View 1 Replies
Feb 10, 2009
I have an 3 arrarys with names, if I trace them outside a MouseEvent it works fine, but as soon as I trace it inside a MouseEvent it returns as undefined.Here is my code:
ActionScript Code:
...
gallery["imageHolder_" + i].vote_btn.addEventListener(MouseEvent.CLICK, showVote);
[code]......
View 1 Replies
Nov 10, 2004
In the following XML doc my attempt at retrieving the title attribute returns undefined, what have I missed?
[xml]
<?xml version="1.0" encoding="iso-8859-1"?>
<storyLines>[code].........
View 2 Replies
Jun 22, 2009
I'm new here and it's been a while since I've used AS I'm trying to create a MC inside another MC
[Code]....
The code mostly comes from a tutorial I found where the demo works fine. Just my code seems to not stand up to the test
View 4 Replies
Jan 10, 2012
I have an AS3 program that calls a function multiple times. The function must return multiple variables, so I created a class for the function to declare an object containing all of these variables. For example, here's my class:
package
{
public class PER
{
[Code].....
Let's say the calling program calls the function, which returns the variables into data_set1 (where data_set1 depends on input variables arg1, arg2, arg3) using:
var data_set1:PER = function_name(arg1, arg2, arg3);
The calling program does some stuff, then calls the function again, but returns the variables into a new variable name, data_set2:
var data_set2:PER = function_name(arg4, arg5, arg6);
My intention is that data_set1 and data_set2 are different (e.g. not linked together).
My question is, given that arrays are passed by reference, will data_set1 be modified to agree with data_set2 upon the 2nd function call? Why or why not?
View 1 Replies
Nov 27, 2007
why doesn't this work?! first trace gives the correct coordinate, second one returns "undefined",
function create()
{
createEmptyMovieClip("holder", this.getNextHighestDepth());
holder.createEmptyMovieClip("mc_1", this.getNextHighestDepth());[code]....
View 1 Replies
Nov 11, 2010
What is the ActionScript 3 function that returns the type of a variable ?
I remember that there is one but I can't remember it nor can I find any reference of it.
View 1 Replies
Apr 25, 2011
I've got an object inside an object. The child object basically loads a variable from SQL into one of it's own public variables. The SQL works 100%, because it traces out correctly.Now I've wrote a function from the child.as
Code:
public get_var() : String
{
return var_yes_friggin_work;[code].....;
Of course the files arn't called Parent.as and Child.as I've just had to rename them because our work is monitored though checking the internet and I can't delete this form.The FilePathOriginal doesn't output anything unless the string is manually set from the child, does anyone know where I'm going wrong here? (I can't upload all my code because of the monoriting process)
View 10 Replies
May 22, 2011
I have a string,for eg: "Welcome to flash forums!".I need a function that returns the number of words(sperated by spaces).The String is not user inputted,so if I need to include any thing between words to accomplish this, it is possible...
View 3 Replies
Sep 18, 2011
I have a movieclip I drawn, called Map. It has a child with the name Wall. I'm trying to make a function that returns a 2d tile array of if there is something in that tile or not, for pathfinding. The problem is, levelGrid is entirely false. I'm not sure what I am doing wrong. I have filled the whole movieclip (Wall) with bright red, and yes it still returns false. The x and y of both Map and Wall is 0, so I don't think there should be issues with hitTestPoint accepting global x / y.
[Code]...
View 1 Replies
Nov 10, 2011
I'm talking about the div(X,Y) function in C which returns the number of times X is reduced by Y. if you're confused, I'm talking about this:
div(30,5) returns 6 (30 is reduced 6 times by 5)
div(34,7) returns 4 (you can reduce 30 by 7 four times, leaving 6 behind)
Is there such a function?
View 3 Replies
Oct 29, 2009
I have created a Composite Pattern type structure, with TreeNodes and TreeLeaf Objects.I works fine, except when I seach in the treestructure for TreeNodes and TreeLeafs in a resurve function with a loop, the function returns null - even on a successfull match.
public function traceTree(inComponent : TreeComponent = null) : TreeComponent{
var parentComponent : TreeComponent = inComponent;
if(inComponent == null){
[code]........
View 4 Replies
Jul 25, 2010
ActionScript Code:
public function draw():Card{
return deck.pop(); //deck = array of Card
}
Does not work. Firstly it runs an error which says
"cannot convert [] to Card"...
Shouldn't it pop() return just ONE element?
Then I correct like this
ActionScript Code:
public function draw():Card{
return deck.pop() as Card;
//deck = array of Card
}
And now I get no errors but the function returns null.... why? If I try this:
ActionScript Code:
public function draw():void{
trace(deck.pop());
//deck = array of Card
}
It prints [Object Card] which is how it should be ....
View 9 Replies
Feb 6, 2009
After loading and parsing external xml, has any one ever been able to make a function that returns your XMLList? I'm asking because I'm trying to change to scope of the data into a global variable for use.
var pngloader:URLLoader=new URLLoader();
var pngxml:XML;
var thumbslist:XMLList;[code].....
View 1 Replies
Nov 4, 2011
I have a load file and a write to file method. We all know what they do. How ever load always returns true and write always returns false....Right there you know somethings wrong. Because The forums have an issue with me posting code...I posted it here: [URL] Based on this code what is the issue here? why is write always returning false and why is load always returning true? (even for files that do not exist). My understanding is that if flash cannot find the file it should write to it will create it and if it cant load said file, then that method should return false.
View 6 Replies
Aug 16, 2011
I have a simple code that seems to be giving strange results.
var startPoint:Point = new Point(x, y); // a point
var r:Number = path[i].row + (-Math.floor((length * 2 + 2) / 2)); // just some math
trace(r); // the math checks out and gives a 3
var tey = startPoint.y + r; //this gives a really strange return....
[Code].....
View 2 Replies
Jun 28, 2011
Today I've received a small ActionScript 3 application that I need to have a look at and make some changes to.I've noticed that the entire application is riddled with the return keyword, eg:
// Constructor
public function MyClass()
{
// some logic[code].....
Is there a possible reason for this, or is the developer who worked on this using some weird, self-taught practice?
View 1 Replies
Nov 11, 2010
What is the ActionScript 3 function that returns the type of a variable ?
I remember that there is one but I can't remember it nor can I find any reference of it.
View 6 Replies
Jan 19, 2009
How could I create a function that returns an array of attribute values.like
ActionScript Code:
//this is my main class
var _XMLPicQuery= new XmlQuery("gallery.xml");[code]......
View 8 Replies
May 8, 2011
I'm trying to get a quick replay command, "pressing space returns the scene to the previous frame".
[Code]...
The current function returns me to a previous frame (40), however the event does not stop, rather it keeps on adding new events ontop of each other once it returns to main frame. The main frame being where the actionscript is executed.
View 1 Replies
Feb 10, 2009
AS2 on a button symbol:
on (release) {
_root.randomVar = pie
trace (_root.randomVar)[code]..........
If I put Var = X in the time line it comes out undefined, no variables seem to be working, tried it in 2x flash projects
View 8 Replies
Mar 19, 2006
I was just wondering whether it was possible to perform a function after a period of time.like +2 to hp every 6 seconds.
View 2 Replies
Nov 7, 2004
My goal is to change the time for setInterval each time the function is called. Planning to replace myInterval = 5000; with a randomized number. My problem is getting setInterval to recognize the myInterval variable from the function.
[Code]...
View 2 Replies
Jul 15, 2004
I'm having with a menu navigation system. I'm using Flash MX. I have created a menu system for the site I'm building ([URL]) where one of the buttons "Choose photographer" drops down a list of names. All the other buttons just jump to another page. The drop down is currently using tweens also the logo moves to the left as the dropdown appears and returns when the dropdown returns. All working fine apart from its a bit jerky.
It's I just wanted to get away from tweening and use action scripts instead, as I'm a newbie to all things Flash I trawled the net for tutorials and examples so that I could cobble together the exact same effect. I have managed to get the drop down work and return using the action script and it does seem smoother and works slightly better. But can I get the logo to move to the left and back in time with the drop down...no.
View 1 Replies
Nov 29, 2011
PROBLEM SOLVED NO LONGER NEEDED
View 3 Replies