ActionScript 2.0 :: Code For XML File Is Tracing 'undefined'
Mar 8, 2007I want to create variables using the length of an XML childnode as the iterator. I would like to create vars named[code]...
View 2 RepliesI want to create variables using the length of an XML childnode as the iterator. I would like to create vars named[code]...
View 2 RepliesI 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]......
I know letters have a number code to them, or ascii code, how can I use this to trace a letter with a number, for example lets say the ascii code for the letter 'a' is 97, in AS3 is there a way todo something like:
trace(asciiToString(97));
to trace out 'a'.
Is there anyway to reference the name of the current open fla and return it as a string?
View 9 RepliesCan I somehow log all AS3 finctions swf calls during runtime with debug version of Flash player?
View 1 RepliesI am trying to find out how to make one .as file code interact with another .as file's code.like, if I had one .as file that specified options of movies and then when the user clicks on a movie (loaded through xml) it uses code from another .as file to load the correct movie.
View 5 RepliesI am trying to build a click through gallery with small buttons that you click on and it switches the larger image out as you click through. I copied over a gallery I had successfully built with 10 images. The new gallery has 20 images. Basically the movie just runs continuously without being able to click on the thumbnails.
I am getting the following compiler errors Scene1 Layer 'actions', Frame 1, Line 42 1120:Access of undefined property btn11_btn Source - btn11_btn.addEventListener(MouseEvent.CLICK, showimage11); I get this for image 11 through 20
[Code]....
Is there a way to make code on the timeline and code in a separate AS file communicate with each other?I have two buttons, a yes button and a no button.I have a confirm box which is a movie clip. In the movie clip I have the two buttons on it and code so that every time one of the buttons is clicked it runs a function.I have the rest of my code for the movie (so the code to make the confirm box appear) on a separate AS file.Is there a way I can define the functions on the movie clip and run the functions with the separate AS file?
View 7 Replieswith this code I get the following errors:
"Access of undefined property stage.
Access of undefined property pressHandler
Access of undefined property myTimer
Access of undefined property timerHandler"
I didn't get these errors when I had the code in an actions frame.Just now that I have them in a seperate document class they come up.
I've been trying for hours to make sense of this problem. When I run my code through the Flash IDE, everthing is fine. However, when I run it through the command line compiler or Flex itself t doesn't work. This is after setting up all the required Flex bits to create a Flash stage and display content. it keeps giving me an "Access of undefined property" error though I've clearly defined those properties in question a line or two before.
[Code]...
What the heck is going on?? I'm stumped. Embed seems to work fine, but I'd prefer to change it this way. I think there's something about XML dynamism if you use embed instead.
I am trying to write a class file using a .as file instead of writing code into the script tab of a .fla file.When I write stage.addChild(img); I get an error that stage is null. When I take out stage, and just write addChild(img); the code runs fine, but nothing appears on stage. Do I need to do something to set a stage active?
Is this because I don't have a Main class? My class is named after the file and I don't have a file named Main.Here is the code. As it is, it runs and I get the two trace outputs, but no graphic on my screen.
package { import flash.display.DisplayObject; import flash.display.Sprite; import flash.display.Loader; import flash.events.*; import flash.net.*; public class HelloWorldImage extends Sprite { private var background:DisplayObject, foreground:DisplayObject; private var url:String = "hw_jpg.jpg"; private var loader:Loader = new Loader( ); public function
[code].....
this will be the preloader code what i put initial frame of my flash file.
[Code]...
Can the clickTAG code in a flash banner be changed if you only have the .swf file and not the .fla file?
View 1 RepliesI have trouble passing a variable from HTML to Flash.I use swf-object2.2.how to code the variable in the html-file and how to receive it in the as-file?Its a simple shopId = 110
View 3 RepliesSo I have this code which loads an xml file
[Code].....
I want to have several buttons however load a different xml file, not just use one file. Would this mean I would have to recreate the above code for every button, or is there anyway I could reuse it?
Why do my preloaders never work? I'm looking to develop a system which reads mp3 files from xml and loads them all with loadSound during preloading phase, the idea is to add all the totalBytes into one var so I can display one percentage for preloading all the files. However, no matter what I try Sound instances getBytesTotal() methods always return undefined when swf is run from host, even though I can hear sounds playing when they load. Of course in test movie everything works fine. In this method of my PreloadManager class I wait for sounds to load:
Code:
public static function waitForSounds() {
PreloadManager.timeline.debug.text += "
waitForSounds()" ;
[Code]....
I've been working with flash on and off for about 4 years now so I'm used to the interface but I've never worked with actionscript that much.I'm working on a flash photo gallery that uses XML to load each images title text, and the filepath to each thumbnail image and full size image.It all seems to be working fine, however when I test the movie I get the following error message in the output:Error opening URL 'file:///Z|/20930AliWebb/FlashGallery/fla/undefined'The images are stored in a folder named gallery_images and the thumbnails in a folder called gallery_thumbs, both within the fla folder. The fla folder also contains the xmlphoto.xml file and my flash file.Here's my actionscript:
Code:
spacing = 60;
//create a new xml object
[code]......
I have one designign query in need the code of Swf file so first i need to convert it to fla then i need a script code of it.but didnt fine it on internet.
View 1 RepliesI have this little code, just loading text from a file, but as the title says, the variable s seams to remain unchanged :S
Code:
var s:String;
var loadText:LoadVars = new LoadVars();
[code]......
undefined error link is not working from xml file
[Code]...
I am using a dynamic nav menu edited using xml, when the corresponding button is pressed I want it to display some text in the text box and load a .swf into the loader m.c. It sort of works, however which ever button I click on it displays the content text and .swf for the last button listed in the xml file, when I try to set a var equal to the instance name of the button clicked on it shows the text as undefined and does not load the m.c? If I leave out the var 'currentIndex' I get a message in the output Error opening URL file undefined. I've checked everything and there are no typos.
Code:
var yPosition:Number = 0;
var myXML:XML = new XML();
myXML.ignoreWhite = true;
var links:Array = new Array();
var names:Array = new Array();
[Code] .....
I have this little code, just loading text from a file, but as the title says, the variable s seams to remain unchanged :S
[Code]...
In the following code take 4 errors on 2 bold lines[code]...
View 10 RepliesI want to get my flv file looping within the swf. I've used the FLVPlayback Component. I've given the flv file the instance name of "vid". Actionscript is as follows:
import fl.video.*;
vid.addEventListener(VideoEvent.COMPLETE, rewind);
function rewind(eventObject:VideoEvent):void {
vid.autoRewind = true;
vid.play();
}
The error message I get at runtime is: 1119: Access of possibly undefined property COMPLETEthrough a reference with static type class.
I am trying to write a piece of code to retreive data from a SOL file : this is my code :[CODE]//get External interfaceimport flash.external.*;
[Code]...
How can that be ? what can I do ? What am I doing wrong ?(bear with me, as I said, I'm kind AS newbie).
im having problems getting some as3 generated (not drawn on stage) movie clips moving across the screen.
Code:
package {
import flash.geom.ColorTransform;
import flash.display.MovieClip;
import fl.motion.Color;
import flash.display.*;
[code]....
i am using flash, .Net, and MySQL and have elements (text fields) posting in flash.Question is, if the table in the data base is not holding the var char how can I set the text field in flash to not show undefined and just be blank?
View 6 Repliesi'm trying to create a function where when i pass a variable to it it displays both the var and the value...like:
sex = "yes please";
checker = function(var){
trace([var] +"=" + var);
[code].....
I am interested in making an animation that would be the equivalent to watching somebody write with a pen. The line tip would start moving and the path that that tip traces would stay on the screen.
View 1 RepliesI have a document class and a subclass. In the subclass I have a trace. I've done this dozens of times before.I've checked everything and I'm stumped. I can't for the life of me figure out why it's not running a trace.
I checked AS3 settings like usual. The FLA finds the document class but I can't get the subclass to show up.[code]...