I am having issues with a global array. I have an actionscript file called MyGlobal.as at the same level as my main FLA:
[Code]....
I am able to trace that first element while trace is called within the function... but if I try to trace that first element outside of the function it is "undefined". Do I need to return the array at the end of the function? I tried that but I cant seem to get it working correctly.
I'm familiar with AS2 and just now beginning AS3. I have a main or root SWF that will call other SWFs. In the past I would put them on levels but now I know with AS3 that isn't so. I will only load one swf at a time. Each will replace the other. I'm using addChild and it seems to work.I really want the Stage SWF to check inside the added child SWF for a String. What is the correct syntax for that in AS3. I have done many attempts but nothing. The last trace I ran was:trace(MovieClip(clipLoader.content)); and that gave me [object MainTimeline]. FYI - The string is "BtnName".[code]
If I have a FLA compiled as say "myfile.swf", how do I output in a trace the name "myfile.swf"i.e var rootname:String = thisIsTheThingIWantToFind;I am trying to display to a user the embed code for a widget and need to put in the string the name of the widget.I could hard code the name in (as I am currently doing) but I want to make it dynamic for when I change the filename.
I am learning actionscript, and right now I am trying to trace the first character of a string I've declared. Code: var myString:String = "Informationsvidenskab"; trace(myString.charAt(i:myString=1):String; My flashbuilder debug says: Multiple markers at this line: -String -1084: Syntax error: expecting rightparen before colon. -1084: Syntax error: expecting rightparen before colon. -1 changed line
I have a class in which I have declared an array. The functions in that class are designed to make changes to the array, but it's not working:
[Code]...
Anything I do to customerCheck treats it as if it were a new array. This is especially obvious when using customerCheck.push in addCharToCheck() -- the trace always shows a blank array before push and an array with one object in it after the push... then next time it does the same. I know I'm making some sort of fundamental error regarding the scope of the array within the class but I just cannot find any good information on how to fix it! Moving to AS3 (been coding it for all of about 3 weeks) is a nightmare so far, and it seems to be the 'easy' stuff that causes me problems
Basically I'm trying to output the contents of an XML document into a dynamic text field (as loaded - not just its node values and content - the entire thing - into a variable called _root.log). The text field is set to show the variable value of _root.log.This is the actionscript...
PHP Code: var newProfileXML:XML= new XML("<contacts result='true'><contact name='John Doe'/><contact name='Jane Doe'/></contacts>");
I am looking for a way to check if any sting of the Array is matched to the string that in the TextField. In the code it should be something like that:
Code: var TestString:Array = new Array ("chicken", "cat", "dog"); function LookStringArray(){ if (TestArrayTextfield_txt.text == (anyString.TestString)){
I have a array where I put the products id and the amount of that same product in it.when I trace the cart array, flash walks trough all the keys (from 0 to 23443) and that takes a long time.Is there a other way to do it? like this maybey:[code]How can you trace the key of an array in AS?
below code is array for my combo box's data. Now I would like to trace this array. I could not trace of any data of "zone" Object. How we can trace any value of this type of array ?
var zone:Array=[ {label:"Nepal", data:"1:00"}, {label:"China", data:"2:00"}, {label:"Bhutan", data:"3:00"} ];
I am undergoing some experiments on creating object arrays before I attempt to implement it on my main flash document.
Ive created an object array with 3 variables, and im attempting to change the values, then trace the values back to see if its working. Ive tried many things but I keep getting [object: Object] back in the output window.[code]...
I copied some code over to a similar function, which traces out the array index number using indexof(e.target).For some reason I'm getting the usual undefined property errors, but it is tracing other properties in the array using e.target?[code]
I have this code working which has an XML file. This is the code for XML menu(no drop down) for website , i am working on, but i wonder when i traced the value of both arr2 & arr1 it returns 0, although i pushed the value.[code]
I'm working through some tutorials from my instructor to eventually build a simple e-com website for a state park. Basically, I'm using the two as3 files shown below and trying to get "bob" in my output with an array function and trace. Load store function is intentionally coded out. When I test project, nothing comes up in output, and I have no errors.
Main012.as: package { import flash.display.MovieClip; public class Main012 extends MovieClip { public function Main012() { [Code] .....
The Action script code below takes the strings in the array (pgtit) and creates a dynamic navigation bar I am trying to trace the index number of the array being click I just seem to get -1.
var pgtit:Array=["link1","link2","link3","link4"]; var xPos = 0; var menuHolder:MovieClip = new MovieClip; addChild(menuHolder);
I am having a color array with values like 0x2EFE2E, 0xFFFF00, etc. but when i am trying to trace the values in the array, it prints something else like 95455. I think these are some converted values. But i tried using parseInt(val, 16), uint(val). None of these works. Basically, i just want to take values from this array and assign it to particleColor (a uint) and use like this:
I've got some xml that I want to use to populate the labels on an array of buttons that I'm putting in with attachMovie. the button(s) load (well, the first one does) and I've got a trace statement that shows the exact data I want in the button labels. But the numbers just refuse to appear in the button labels.the labeling is correct; I've been looking at this for three days and checked the path and naming at least a dozen times.
Code: for(i=0; i<total; i++){ patMenuHolder_mc.attachMovie("patentBtn", "patentBtn"+i, i, {_x:xPos, _y:yPos})
But the trace always comes out to be undefined. Also, I have searched, and the basis for that code is (working) code from one of the results I found when I searched
I have two arrays. One contains numbers and the other contains strings. I want to do a sortOn(DECENDING) for the number array and then have the string array sort to match. if my string array is
I put my mc's in an array.I have another array with strings.when the mc is clicked I want to get its position in the mc array and return the string from the same position in the string array.How do I do that?
PHP Code: var numBtnArray:Array = new Array; function addNumButtonsToStage():void{
I have an array that I want to shuffle but at different percentages. Like "Hello" would show up 80% in the Output window. "Bye" would show the other 20% of the time. How do I do this?
Code:
var myArray:Array = new Array("Hello", "Bye"); function randomIt() {
I am trying to create an array (1-35), mix that array and display the results with a trace. I am getting an error with the following code.
public function generateArray(toNumber : int) : Array { var result : Array = []; for (var i : int = toNumber; i != 0; i--) { result.push(i); [Code] .....
The error(s) are: 1180: Call to a possibly undefined method generateArray. 1120: Access of undefined property generateArrays.
I am producing an array of numbers 1-25, shuffling and tracing the output. When I 'Test Movie' I am not getting the expected results. What I get is something like this.