Undefined Text Field Error
Hiya guys,
I've just changed over from using Flash 6 to Flash 7 and am having some teething problems. I have a lot of information being read from text files and brought into flash. This all worked fine when it was published as flash 6 but now I've changed it to flash 7 all I get in my text fields is the word UNDEFINED?
Here's the code I'm using...
on (release){
_root.field1.html = true;
_root.field1.htmlText = "Please Wait Loading...";
myLoadVar = new LoadVars();
myLoadVar.load("news.txt");
myLoadVar.onLoad = function(success) {
if (success == true) {
_root.field1.htmlText = myLoadVar.myText;
}
}
}
Any bright ideas?
KirupaForum > Flash > Flash 8 (and earlier) > Flash MX 2004
Posted on: 08-11-2004, 10:49 PM
View Complete Forum Thread with Replies
Sponsored Links:
Undefined Text Field Error
Hiya guys,
I've just changed over from using Flash 6 to Flash 7 and am having some teething problems. I have a lot of information being read from text files and brought into flash. This all worked fine when it was published as flash 6 but now I've changed it to flash 7 all I get in my text fields is the word UNDEFINED?
Here's the code I'm using...
on (release){
_root.field1.html = true;
_root.field1.htmlText = "Please Wait Loading...";
myLoadVar = new LoadVars();
myLoadVar.load("news.txt");
myLoadVar.onLoad = function(success) {
if (success == true) {
_root.field1.htmlText = myLoadVar.myText;
}
}
}
Any bright ideas?
View Replies !
View Related
Intermittant "Undefined" Error In Dynamic Text Field
I have recently inherited a fairly complex Flash project. Lots of individual Flash files and dynamic text/HTML files all working together to form interactive Flash project.
This project is built using a “container” flash file that loads other, different flash files that contain dynamic text fields. These dynamic text fields pull text from external text/HTML files.
The user looking at the flash file sees the text displayed after it is pulled into the dynamic text fields. The user can either click a “back” button and see the previously displayed dynamic text or click a “forward” button and see the next dynamic text content. The user "walks" through the project like turning pages of a book.
Occasionally, when a flash file loads into the flash “container”, and that file tries to pull text for the dynamic text field (from the HTML file), a problem occurs. Instead of the text that is supposed to appear in the display, the word “undefined” appears. The user can navigate back to the previous content then go forward again, and the problem disappears.
This problem is very intermittent. There does not seem to be a specific place where it occurs.
I have been asked to determine why an “undefined” error occurs. The problem does not appear to be from the flash with the dynamic text fields, nor does it appear to be from the text/HTML file.
Somehow the variable is getting “lost” intermittently.
I have seen this error message when there is a definitive problem but it is consistant. This intermittent thing has me baffled.
Has anyone seen this behavior before, and if so have you ever traced the problem (could this possibly be a problem unrelated to the actionscript)?
View Replies !
View Related
Loading HTML And CSS Into Dynamic Text Field Caused "undefined" Error
Hi,
Novice in actionscript and have a problem loading an html file combined with a css stylesheet into a dynamic text field.
I have 2 pages... 1st page always loads correctly but second page all you see the text fields is "undefined".
When I view local machine all is well until I load onto server and for the first page of my site all is well but for the second page I receive "undefined" in the dynamic text field...
This only happens the first time. When I click through the different pages('undefined', 'undefined', 'undefined'..) and return to the previous ones the text suddenly is displayed correctly! I don't know what I am doing wrong. Could somebody help me solve my case please??!
I have read elsewhere that I need to wait for the LoadVars onload command to finnish but I am at a loss to fix this...
Code:
var myVars:LoadVars = new LoadVars();
var styles = new TextField.StyleSheet();
var txt_url = "booking.htm";
var css_url = "html_styles.css";
// Load text to display and define onLoad handler
myVars.load(txt_url);
myVars.onData = function(content) {
storyText = content;
};
// Load CSS file and define onLoad handler:
styles.load(css_url);
styles.onLoad = function(ok) {
if (ok) {
// If the style sheet loaded without error,
// then assign it to the text object,
// and assign the HTML text to the text field.
scroller.styleSheet = styles;
scroller.text = storyText;
}
};
Please help!!
View Replies !
View Related
Loading HTML And CSS Into Dynamic Text Field Caused "undefined" Error
Hi,
Novice in actionscript and have a problem loading an html file combined with a css stylesheet into a dynamic text field.
I have 2 pages... 1st page always loads correctly but second page all you see the text fields is "undefined".
When I view local machine all is well until I load onto server and for the first page of my site all is well but for the second page I receive "undefined" in the dynamic text field...
This only happens the first time. When I click through the different pages('undefined', 'undefined', 'undefined'..) and return to the previous ones the text suddenly is displayed correctly! I don't know what I am doing wrong. Could somebody help me solve my case please??!
I have read elsewhere that I need to wait for the LoadVars onload command to finnish but I am at a loss to fix this...
Code:
var myVars:LoadVars = new LoadVars();
var styles = new TextField.StyleSheet();
var txt_url = "booking.htm";
var css_url = "html_styles.css";
// Load text to display and define onLoad handler
myVars.load(txt_url);
myVars.onData = function(content) {
storyText = content;
};
// Load CSS file and define onLoad handler:
styles.load(css_url);
styles.onLoad = function(ok) {
if (ok) {
// If the style sheet loaded without error,
// then assign it to the text object,
// and assign the HTML text to the text field.
scroller.styleSheet = styles;
scroller.text = storyText;
}
};
Thanks...
View Replies !
View Related
Undefined Dynamic Text Field...
I am using a dynamic text field in a swf file. (SOMETIMES) I can get the text to load using the following code...
_root.loadVarsText = new LoadVars();
_root.loadVarsText.load("mass.txt");
I then have the script defining the variable (see below) a frame after...I have found that it sometime is better to have this code spread apart from the code above or should it be closer? Is anyone else familiar with this????
brandbox.text = (_root.loadVarsText.brand1);
However when set up like this I sometimes get a "Undefined" in the dynamic text box when testing it. I am not sure why???
I was told that I could use a #include function to "embed"??? the file is this possible. If so is the below code correct? I tested it locally on my box but am not getting the text to show up. Does it have to be on the web to function correctly? Is it possible that I would need additional code in the swf somewhere?
_root.loadVarsText = new LoadVars();
#include "mass.txt"
HELP??????????
thanks,
J
OLD NEWBIE...you are a Jedi...what are your thoughts?
View Replies !
View Related
Text Field Undefined On First Load
I am importing vars from a txt file and they come up undefined at first then when you advance the photo everything works fine
they display the gps coords for each photo,
I have been working on the for a while and cant get tit to work.
here is the file is any one can take a look at it
http://lstatic.com/junk/images.fla
View Replies !
View Related
Undefined: HTML Text: Can Any Find The Error?
Undefined: HTML Text: Can any find the error?
Ok I have a scrollable text box. This text is generated from a txt file. It works in the Macromedia Flash but not online. I have uploaded all the relevant files.
All Im getting on-line is undefined. Please help.
Here is the code
To get the text and activate the scrolling text box:
PHP Code:
//Purpose : To show an understanding of graphical design and
// user interaction.
//Assignment info : Assingment One, Task One, MU201
//Presentation name : Games Console
//Script number : game1_2 beta
//Author : Peter Fisher
stop();// Stop that game at this point
/*
Scrollable texbox
1. Displays a external HTML file
2. Scrolls up and down by scrollListener
*/
//Load the text box imagetest.txt
loadVariablesNum("imagetest.txt", 0);
//When frame loads display the txt file as a HTML file
_root.onEnterFrame = function() {
display_txt.htmlText = HTMLpage;
};
//the movement varible will only decress or increase by 1
movement = 1;
// create a funtion to scroll the text
function ScrollText(Direction) {
//If the scrollListener key is UP then -1 (direction = up)
if (Direction == "Up") {
display_txt.scroll -= movement;
//If the scrollListener key is not UP then +1 (direction = down)
} else {
display_txt.scroll += movement;
}
}
/*A new object is made. This object does/has the following:
1. A listening function
1.1. reactes when the up or down arrow key is down.
2. Dictates the scrollListener
*/
scrollListener = new Object();
scrollListener.onKeyDown = function() {
if (Key.isDown(Key.DOWN)) {
ScrollText("Down");
} else if (Key.isDown(Key.UP)) {
ScrollText("Up");
}
};
Key.addListener(scrollListener);
The text (imagetest.txt) file:
PHP Code:
HTMLpage=
<html>
<head>
</head>
<body>
<p align="center"><font size="12px" face="Courier New"><b>KEY CONTROLS</b></font></p>
<p align="center"><font size="12px" face="Courier New">--------------------</font></p>
<font face="Courier New"><font size = "12px">
<p>The game is onl</span>y controlled by the keyboard and NOT the mouse.</p>
<p><b>Allocated Keys </b></p>
<p>--------------------</p>
<p>Left = Left arrow key</p>
<p>Right = Right arrow key</p>
<p>Up = Up arrow key</p>
<p>Down = Down arrow key</p>
<p>A = Ctrl key </p>
<p>B = Space Bar</p>
<p><b>In Game Controls</b></p>
<p>--------------------</p>
<p>Move Left = Left arrow key</p>
<p>Move Right = Right arrow key</p>
<p>Move Up = Up arrow key</p>
<p>Move Down = Down arrow key</p>
<p>Fire = A </p>
<p><b>There are two gmaes</b></p>
<p>--------------------</p>
<p><b>Rules</b></p>
<p>--------------------</p>
<p><b><u>Game one<b></u></p>
<p>You must hit the ball using the cursor as fast as you can!</p>
<p><b><u>Game two</u></b></p>
<p>You must get a score of 150 in 10 seconds</p>
<p><b><u>Rule 1</u></b></p>
<p>each time you hit the ball, the score increases. This increase is worked out by how fast the ball is going. </p>
<p><b><u>Good luck<b></u></b></p>
</font></font></body>
</html>
The URL:
http://pfwd.org.uk/flash_game.htm
Please help sort this underfinded error Thanks
PFWD
View Replies !
View Related
Error #1010: A Term Is Undefined And Has No Properties - Useless Error Message
I hate runtime errors!
ActionScript Code:
TypeError: Error #1010: A term is undefined and has no properties.
at Image/setImage()
at Instructions/preNavigateCallback()
at Instructions/nextSlide()
The issue is that I deleted a movieclip from the stage, but the code referencing that clip was not changed.
Why can't the error say something more useful, for example, including the line number, or the actual "term"?
ActionScript Code:
TypeError: Error #1010: A term is undefined and has no properties.
at "container.guide.visible"
at Image/setImage() : line 214
at Instructions/preNavigateCallback() : line 186
at Instructions/nextSlide() : line 103
Does anyone know why it is so damn vague!? I realise that maybe line numbers probably get lost once compiled, but these kinds of errors always cost me so much debugging time, and are very frustrating - is it impossible to provide the "term" though?.
And does anyone have any good advice on how to avoid them, or track them down with the limited amount of info supplied?
Many thanks,
Dave
View Replies !
View Related
#2025 Error When Loading A Text Field
Hi everyone!
If you saw my last posts, I was having trouble unloading an externally loaded swf. Everything is peachy now on that score, so I'm all aflutter.
However! I have a new problem which I'm hoping you can help me with. In the same project, my externally loaded swf is a little window that can be dragged around. Within that window is a text box and five buttons. Each button loads the text box with new information via a URLLoader. Here is the code for the URLLoader:
var myURLLoader:URLLoader = new URLLoader();
myURLLoader.load(new URLRequest("bio.html"));
myURLLoader.addEventListener(Event.COMPLETE, dataLoaded);
function dataLoaded(e:Event): void {
myTfield.htmlText= myURLLoader.data;
myTfield.scrollV = 1;
}
Okay. Now, let's look at two buttons:
main_btn.addEventListener(MouseEvent.CLICK, albumText);
function albumText(e:MouseEvent): void {
myURLLoader.load(new URLRequest("bio.html"));
}
anth_btn.addEventListener(MouseEvent.CLICK, lyricsText);
function lyricsText(e:MouseEvent): void {
myURLLoader.load(new URLRequest("anth.html"));
}
Everything looks fine, right? And the mechanism works at runtime, BUT, there is an annoying glitch that for the life of me I cannot fathom. Sometimes, and usually after I drag the clip around a bit, I get this error:
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.
at flash.text::TextField/set htmlText()
at bio_fla::MainTimeline/dataLoaded()
at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunctio n
()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/flash.net:URLLoader::onComplete()
Can anyone help me figure out why I'm getting this crazy error? What supplied DisplayObject is the Flash Player saying is not a child of the caller??
Thanks. I've attached the files for your parusal.
View Replies !
View Related
"undefined" In Input Text Field
I have some text field on the stage and they are showing "undefined" in my .exe projector file. Once I enter some text in the fields and save it as a shared object the info is fine, but it is that first view by a user (before they have saved some info in those text fields) that I'm unhappy with.
How can I check if they are "undifined" and then in turn fill those fields with some other text like "type here and click save" for example?
View Replies !
View Related
Why Is This Text Field Tracing "undefined" ?
Please help me kirupians!
when i run:
Code:
var headerTxt:TextField = this.createTextField(header_txt,0,200,150,550,20);
trace(headerTxt);
it traces:
Code:
_level0.undefined
why would it do this? When I refer to headerTxt in code, i can set its format, properties and populate it with text, no problem. Yet it traces as undefined, and this is (im assuming) giving me a problem with removing the textfield from another function...
EDIT: ok, i solved my issues by just scoping the vars for the txt fields outside of the functions.... but still, why is it tracing undefined???
View Replies !
View Related
Dynamic Text Field Produces Error When Named
I have a movie clip (to be used as a button) on which I would like to place a dynamic text field that will be the button label. However, when I do this, Flash gives me a "1046: Type was not found or was not a compile-time constant: TextField." error message. This only happens if the text field has an instance name. Of course, without an instance name, you can't access the item to change the label text.
Knowledgebase suggested clicking the Export SWC option in publish settings. That doesn't help. My expectation is that I just need to import a class. If you need more details on the code structure, let me know. CS3, AS3.
Thanks in advance...
-Rex
View Replies !
View Related
Dynamic Text "undefined" Error
Hello,
I have used the Flash MX tutorial for the scrolling dynamic text and i always end up having "undefined" showing up instead of my txt file.
Here is the code i use
Code:
loadText = new LoadVars();
loadText.load("kirupa.txt");
//creating the loadVarsText function
loadText.onLoad = function() {
scroller.text = this.kirupatext;
};
Thanks alot
View Replies !
View Related
If Undefined Dont Show Text That Says Undefined
Curious to know, 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?
I am about to search the heck out of this but if anyone can hit me with some insight it would be much appreciated.
Thanks in advance,
MT
View Replies !
View Related
Undefined Error
Can someone please tell me how to make this work?
tring.prototype.verificaCPF = function(){
cpf = this.toString();
soma1=0;
soma2=0;
for(i=0;i<9;i++){
numero1 = parseInt(cpf.charAt(i))*(i+1);
soma1=soma1 + numero1;
}
for(i=1;i<10;i++){
numero2 = parseInt(cpf.charAt(i))*i;
soma2=soma2 + numero2;
}
v1=soma1%11;
v2=soma2%11;
if(v1==10)v1=0;
if(v2==10)v2=0;
if(v1==parseInt(cpf.charAt(9)) && v2==parseInt(cpf.charAt(10))){
return "CPF Vlido";
}else{
return "CPF Invlido";
}
}
//Test
cpf = "85723185187";
trace(cpf.verificaCPF());
View Replies !
View Related
Undefined Error
Hi,
I'm processing basic customer data into a form. Certain fields are mandatory and I test for nulls. The null checker initially worked - but no longer. Now if I leave the field blank it gets populated by an "undefined" and the null checker doesn't catch it. This is my code:
function formcheck1 () {
if ((((email == null)) || (email.length<1)) || (email == "ERROR! Address not valid")) {
this.eemail._visible = true;
action = "";
}
if (!validate(email)) {
this.EnterTitle._visible = true;
this.eemail._visible = true;
action = "";
}
if (fname == null) {
this.EnterTitle._visible = true;
this.efname._visible = true;
action = "";
}
if (lname == null) {
this.EnterTitle._visible = true;
this.elname._visible = true;
action = "";
}
if (address1 == null) {
this.EnterTitle._visible = true;
this.eaddress1._visible = true;
action = "";
}
if (city == null) {
this.EnterTitle._visible = true;
this.ecity._visible = true;
action = "";
}
if (state == null) {
this.EnterTitle._visible = true;
this.estate._visible = true;
action = "";
}
if (zipcode == null) {
this.EnterTitle._visible = true;
this.ezipcode._visible = true;
action = "";
}
if (country == null) {
this.EnterTitle._visible = true;
this.ecountry._visible = true;
action = "";
}
if (telno == null) {
this.EnterTitle._visible = true;
this.etelno._visible = true;
action = "";
}
if ((validate(email)) && (email != "ERROR!") && (fname != "") && (lname != "") && (address != "") && (city != "") && (state != "") && (zipcode != "") && (country != "") && (telno != "")) {
action = "send";
I hope someone can help.
Cheers,
Hedley
is not workingThis isn't working. The null checker i because the variables a For some reason it's moving on with the data being filled as undefined. Does
View Replies !
View Related
[F8] Undefined Error - Please Help
Hi guys! I'm tearing my hair out with this one!
Basically, I'm creating a small "Click the Country" game.
I have 10 frames with questions on, and have created an array, which will chose the 10 questions in a random order without repeated frames.
I've taken actionscript from this topic;
http://www.actionscripts.org/forums/...6526#post46526
When the user gets the country correct, they will be taken to a "correct" screen, and the user has to click "continue". The continue button has this script;
Code:
on (release) {
_root.gotoAndPlay (randArray[frame]);
//testing purposes:
trace (randArray[frame]);
frame++;
}
When clicked, it comes up as undefined. I think it may be something to do with the randArray. Here's the script from the main timeline
Code:
_root.frame=0;
// populates an array called countArray with the possible frame numbers from 11 - 20
num = 21
countArray= new Array;
for (i=11; i<num; i++) {
countArray.splice(num, 0, i);
}
//test to check array is correct
trace(countArray.toString());
//randomly shuffles array and returns as custom defined new array
Array.prototype.shuffle = function (secondArray){
interimArray = new Array();
arrayCount = ((this).length);
deleteCount = ((secondArray).length);
secondArray.splice(0, deleteCount);
//copies values from original array into interim array so that original data is not lost
for (a=0; a<arrayCount; a++) {
value = this[a];
interimArray.splice(a, 0, value);
}
//chooses random array data * copies into first position in new array,
// deletes that data from interim array so it can't be chosen again
for (a=0; a<10; a++) {
num = (random(interimArray.length));
value = interimArray[num];
secondArray.splice(1, 0, value);
interimArray.splice(num, 1);
}
}
// here we tell Flash to perform the array shuffle on
//your "countArray" and to call the new Array to be populated
//with the 10 random numbers "randArray"
countArray.shuffle(randArray=new Array());
trace (randArray.toString());
Can anybody help me please?!
View Replies !
View Related
Getting An Undefined Error
Hi,
I am getting an undefined area when I test the scene. Any suggestions? Thanks.
Ext_text = new LoadVars();
Ext_text.onLoad = addText;
Ext_text.load("spa_01.txt");
function addText() {
content.htmlText = this.spa_01;
}
View Replies !
View Related
XML Undefined Error
I have the following code on an MC, the MC is called '_fader'...
Code:
on (construct, keyPress "") {
_xmlfile = "images.xml";
_loop = true;
}
INSIDE the MC '_fader' I have the following:
Code:
#initclip
ImageFader = function () {
this.__init__();
};
ImageFader.prototype = new MovieClip();
ImageFader.prototype.__init__ = function () {
this._xscale = 100;
this._yscale = 100;
this.bounding_box.unloadMovie();
this._fader_.unloadMovie();
this._dataProvider = new Array();
this._count = 0;
this._depth = 1;
this._isLoaded = -1;
if (this._S_) {
clearInterval(this._S_);
}
if (this._xmlfile != "") {
this.loadXML(this._xmlfile);
}
};
ImageFader.prototype.loadXML = function (x) {
var v9 = new XML();
v9.ignoreWhite = true;
v9.path = this;
v9.load(x);
v9.onLoad = function () {
for (v2 = 0; v2 < this.firstChild.childNodes.length; v2++) {
var v4 = this.firstChild.childNodes[v2].attributes.TRANSITION;
var v3 = this.firstChild.attributes.PAUSE;
var v5 = this.firstChild.childNodes[v2].firstChild.nodeValue;
this.path._dataProvider.push({img: v5, transition: v4, pause: v3});
}
this.path.startFading();
false;
};
};
ImageFader.prototype.startFading = function () {
if (this._dataProvider.length > 0) {
this.makeFader(true);
}
};
ImageFader.prototype.makeFader = function (first) {
this._isLoaded = -1;
this._depth++;
this._tmp = this.attachMovie("ImageLoader", "ImageLoader" + this._depth, this._depth);
this._old1 = this["ImageLoader" + (this._depth - 1)];
this._old2 = this["ImageLoader" + (this._depth - 2)];
this._tmp.loadHandler("isLoaded", this._count);
this._tmp.autoStart = false;
this._tmp.transition = this._dataProvider[this._count].transition;
this._tmp.loadImage(this._dataProvider[this._count].img);
this._t1 = getTimer();
this.onEnterFrame = function () {
this._t2 = getTimer();
if (this._t2 - this._t1 > this._dataProvider[this._count].pause || first == true) {
if (this._isLoaded == this._count || (this._isLoaded == 1 && this._count == 0)) {
delete this.onEnterFrame;
this._tmp.start();
this._old1.fadeOut();
this._old2.removeMovieClip();
if (this._count + 1 < this._dataProvider.length) {
this._count++;
this.makeFader();
return;
} else {
if (this._loop == true) {
this._count = 0;
this.makeFader();
}
}
}
}
};
};
ImageFader.prototype.isLoaded = function (num) {
this._isLoaded = num;
};
Object.registerClass("ImageFader", ImageFader);
#endinitclip
When I run it I keep getting an 'undefined' error, does anyone have any ideas as I'm struggling...
View Replies !
View Related
Undefined Var Error
I have been taking scripting I am familiar with from AS2 and making adjustments to AS3, just very simple files. Of course, I run into problems and through research, I have managed to solve most them, but I have a problem that has me absolutely stumped.
I created a file with a simple timer that when it reaches a certain time moves to a different frame:
stop();
var startTime:Number= 0;
stage.addEventListener(MouseEvent.CLICK, reset);
function reset(myevent:MouseEvent):void {
startTime = getTimer();
}
stage.addEventListener(Event.ENTER_FRAME, showTime);
function showTime(myevent:Event):void {
var currentTime = getTimer();
var elapsedTime = (currentTime - startTime) / 1000;
myDisplay_txt.text = elapsedTime;
if (elapsedTime >= 5){
gotoAndStop(2);
}
}
All is well and good, but when I try to combine it with a file with has score buttons, I get an error.
stop();
var currentScore = 0;
score.text = "0";
function scorept(myevent:MouseEvent):void {
score.text = currentScore+=1;
}
scoreOne_btn.addEventListener(MouseEvent.MOUSE_DOW N, scorept);
function scoreFivept(myevent:MouseEvent):void {
score.text = currentScore+=5;
}
scoreFive_btn.addEventListener(MouseEvent.MOUSE_DO WN, scoreFivept);
function scoreMinusFivept(myevent:MouseEvent):void {
score.text = currentScore-=5;
}
scoreMinusFive_btn.addEventListener(MouseEvent.MOU SE_DOWN, scoreMinusFivept);
function scoreMinusOnept(myevent:MouseEvent):void {
score.text = currentScore-=1;
}
scoreMinusOne_btn.addEventListener(MouseEvent.MOUS E_DOWN, scoreMinusOnept);
var startTime:Number= 0;
startTime = getTimer();
stage.addEventListener(Event.ENTER_FRAME, showTime);
function showTime(myevent:Event):void{
var currentTime = getTimer();
var elapsedTime = (currentTime - startTime) / 1000;
tme_txt.text = elapsedTime;
if (elaspsedTime >= 5){
gotoAndStop(3);
}
}
stage.addEventListener(Event.ENTER_FRAME, winGame);
function winGame(myevent:Event):void {
if (currentScore >=20) {
gotoAndStop(4);
}
}
Now I get a compiler error:
1120: Access of undefined property elaspsedTime.
WTF? If I turn off the compiler strict mode, it will render, the score part works, but the timer just go on forever. The var for elapsedTime is RIGHT THERE!!
What the heck am I missing????
View Replies !
View Related
Undefined Error
I'm trying to pull in a value from my XML doc and use it to load in a text file...I can trace the value fine but am losing it somehow in my load function...
Code:
for (var j = -1; j<i; j++) {
loadMovie(image_path, contentMC.itemsMC[name].picHolder);
contentMC.itemsMC[name].myLink = link_to;
contentMC.itemsMC[name].myTitle = case_title;
contentMC.itemsMC[name].onRollOver = function() {
casetitle.htmlText = this.myTitle;
};
contentMC.itemsMC[name].onRelease = function() {
trace(this.myLink);
var lvArticleContent:LoadVars = new LoadVars();
lvArticleContent.onData = function(sHTMLData:String) {
_parent.tArticle.htmlText = sHTMLData;
};
var cssStyles:TextField.StyleSheet = new TextField.StyleSheet();
cssStyles.onLoad = function() {
_parent.tArticle.styleSheet = this;
lvArticleContent.load("studies/"+myLink+".html");
};
cssStyles.load("studies/styles.css");
};
}
so I can trace "myLink" but in the cssStyles.onLoad function it gets lost...anyone know what I'm doing wrong...it's probably a path problem...function inside a function or something like that...any help would be greatly appreciated.
Thanks
View Replies !
View Related
Undefined Error
Hello all,
When creating flash movies, I get undefined for all my text fields with external variables whenever a visitor doesn't type in www at the beginning of the url. Such as: domainname.com
But when a user enters the www such as: www.domainname.com, the flash movie works fine and the variables load just fine.
Is this a common error? What might I be doing wrong? And is there any way of fixing this?
Thanks
View Replies !
View Related
XML Undefined Error
I have the following code on an MC, the MC is called '_fader'...
Code:
on (construct, keyPress "") {
_xmlfile = "images.xml";
_loop = true;
}
INSIDE the MC '_fader' I have the following:
Code:
#initclip
ImageFader = function () {
this.__init__();
};
ImageFader.prototype = new MovieClip();
ImageFader.prototype.__init__ = function () {
this._xscale = 100;
this._yscale = 100;
this.bounding_box.unloadMovie();
this._fader_.unloadMovie();
this._dataProvider = new Array();
this._count = 0;
this._depth = 1;
this._isLoaded = -1;
if (this._S_) {
clearInterval(this._S_);
}
if (this._xmlfile != "") {
this.loadXML(this._xmlfile);
}
};
ImageFader.prototype.loadXML = function (x) {
var v9 = new XML();
v9.ignoreWhite = true;
v9.path = this;
v9.load(x);
v9.onLoad = function () {
for (v2 = 0; v2 < this.firstChild.childNodes.length; v2++) {
var v4 = this.firstChild.childNodes[v2].attributes.TRANSITION;
var v3 = this.firstChild.attributes.PAUSE;
var v5 = this.firstChild.childNodes[v2].firstChild.nodeValue;
this.path._dataProvider.push({img: v5, transition: v4, pause: v3});
}
this.path.startFading();
false;
};
};
ImageFader.prototype.startFading = function () {
if (this._dataProvider.length > 0) {
this.makeFader(true);
}
};
ImageFader.prototype.makeFader = function (first) {
this._isLoaded = -1;
this._depth++;
this._tmp = this.attachMovie("ImageLoader", "ImageLoader" + this._depth, this._depth);
this._old1 = this["ImageLoader" + (this._depth - 1)];
this._old2 = this["ImageLoader" + (this._depth - 2)];
this._tmp.loadHandler("isLoaded", this._count);
this._tmp.autoStart = false;
this._tmp.transition = this._dataProvider[this._count].transition;
this._tmp.loadImage(this._dataProvider[this._count].img);
this._t1 = getTimer();
this.onEnterFrame = function () {
this._t2 = getTimer();
if (this._t2 - this._t1 > this._dataProvider[this._count].pause || first == true) {
if (this._isLoaded == this._count || (this._isLoaded == 1 && this._count == 0)) {
delete this.onEnterFrame;
this._tmp.start();
this._old1.fadeOut();
this._old2.removeMovieClip();
if (this._count + 1 < this._dataProvider.length) {
this._count++;
this.makeFader();
return;
} else {
if (this._loop == true) {
this._count = 0;
this.makeFader();
}
}
}
}
};
};
ImageFader.prototype.isLoaded = function (num) {
this._isLoaded = num;
};
Object.registerClass("ImageFader", ImageFader);
#endinitclip
When I run it I keep getting an 'undefined' error, does anyone have any ideas as I'm struggling...
View Replies !
View Related
Getting An Undefined Error
Hi,
I am getting an undefined area when I test the scene. Any suggestions? Thanks.
Ext_text = new LoadVars();
Ext_text.onLoad = addText;
Ext_text.load("spa_01.txt");
function addText() {
content.htmlText = this.spa_01;
}
View Replies !
View Related
Undefined Error
for(j=0;j<str.length;j++){
if (str.charCodeAt(j)<=90&& str.charCodeAt(j)>=65){
temp=Math.abs((str.charCodeAt(j)-65));
iNumOfSym[temp]+=1;
trace(iNumOfSym);
}
In the above part code i have declared iNumOfSym as a string... .. but when i run this code and trace iNumOfSym.. i get undefined as the output.. why?? how should i fix it??
View Replies !
View Related
Help With Undefined Error
Hi guys! I'm tearing my hair out with this one!
Basically, I'm creating a small "Click the Country" game.
I have 10 frames with questions on, and have created an array, which will chose the 10 questions in a random order without repeated frames.
When the user gets the country correct, they will be taken to a "correct" screen, and the user has to click "continue". The continue button has this script;
on (release) {
_root.gotoAndPlay (randArray[frame]);
//testing purposes:
trace (randArray[frame]);
frame++;
}
When clicked, it comes up as undefined. I think it may be something to do with the randArray. I've attached the script from the main timeline
Can anybody see where I'm going wrong here?
Thanks
Attach Code
_root.frame=0;
// populates an array called countArray with the possible frame numbers from 11 - 20
num = 21
countArray= new Array;
for (i=11; i<num; i++) {
countArray.splice(num, 0, i);
}
//test to check array is correct
trace(countArray.toString());
//randomly shuffles array and returns as custom defined new array
Array.prototype.shuffle = function (secondArray){
interimArray = new Array();
arrayCount = ((this).length);
deleteCount = ((secondArray).length);
secondArray.splice(0, deleteCount);
//copies values from original array into interim array so that original data is not lost
for (a=0; a<arrayCount; a++) {
value = this[a];
interimArray.splice(a, 0, value);
}
//chooses random array data * copies into first position in new array,
// deletes that data from interim array so it can't be chosen again
for (a=0; a<10; a++) {
num = (random(interimArray.length));
value = interimArray[num];
secondArray.splice(1, 0, value);
interimArray.splice(num, 1);
}
}
// here we tell Flash to perform the array shuffle on
//your "countArray" and to call the new Array to be populated
//with the 10 random numbers "randArray"
countArray.shuffle(randArray=new Array());
trace (randArray.toString());
View Replies !
View Related
Undefined Error ?
Hi, I am a bit of a newbie when it comes to flash(but learning fast). I have an issue with the code below. This has been constructed from 2 tutorials I have found... 1 to load xml and the other to do a simple slideshow. If I seperate the xml bit and the slide show bits they work fine. If I put them together it does not work. It seems to says that the XML is undefined. It doesnt go into the loop that puts the data in the array(I have debugged that much). Any help would be appreciated... Very frustrating.... I'm sure it's something stupid I'm doing.
var picArray:Array = new Array(); //array to hold the image and all of its attributes
var thisNode:XMLNode = new XMLNode();
var imageXML:XML = new XML();
imageXML.ignoreWhite = true;
imageXML.onLoad = function(success:Boolean) {
for(var i:Number = 0;i<imageXML.firstChild.childNodes.length;i++) {
thisNode = imageXML.firstChild.childNodes[i];
picArray.push([thisNode.attributes.img,thisNode.attributes.Captio n,thisNode.attributes.link]);
}
//When the xml is completely loaded,
//delete the xml (since its now contained in picArray)
//and continue to the slideshow
delete imageXML;
}
imageXML.load("pg7.xml");
this.fadeSpeed = 20;
this.pIndex = 0;
// MovieClip methods ----------------------------------
// d=direction; should 1 or -1 but can be any number
//loads first image automatically
loadMovie(picArray[0][0],_root.photo);
MovieClip.prototype.changePhoto = function(d) {
// make sure pIndex falls within picArray.length
this.pIndex = (this.pIndex+d)%picArray.length;
if (this.pIndex<0) {
this.pIndex +=picArray.length;
}
this.onEnterFrame = fadeOut;
};
MovieClip.prototype.fadeOut = function() {
if (this.photo._alpha>this.fadeSpeed) {
this.photo._alpha -= this.fadeSpeed;
} else {
this.loadPhoto();
}
};
MovieClip.prototype.loadPhoto = function() {
// specify the movieclip to load images into
var p = _root.photo;
//------------------------------------------
p._alpha = 0;
p.loadMovie(picArray[this.pIndex][0]);
this.onEnterFrame = loadMeter;
};
MovieClip.prototype.loadMeter = function() {
var i, l, t;
l = this.photo.getBytesLoaded();
t = this.photo.getBytesTotal();
if (t>0 && t == l) {
this.onEnterFrame = fadeIn;
} else {
//trace(l/t);
}
};
MovieClip.prototype.fadeIn = function() {
if (this.photo._alpha<100-this.fadeSpeed) {
this.photo._alpha += this.fadeSpeed;
} else {
this.photo._alpha = 100;
this.onEnterFrame = null;
}
};
I have attached the fla.
Thanks
Adrian
View Replies !
View Related
Undefined Error
In the code below:
Code:
var loadFiles:LoadVars = new LoadVars();
loadFiles.load("http://127.0.0.1/karenburns/get_files.php?dir=horiz");
total = this["total"];
function loadImageLeft() {
var x = 0;
imagePath = this["image" + x];
trace("Image path left: " + imagePath);
loadMovie("file:///C|/dev%5Fenvironment/photography/horiz/" + imagePath, picHolderLeft);
x++;
}
function loadImageRight() {
var y = 2;
imagePathRight = this["image" + y];
trace("Image path right: " + imagePathRight);
loadMovie("file:///C|/dev%5Fenvironment/photography/horiz/" + imagePathRight, picHolderRight);
y++;
}
loadFiles.onLoad = function(success:Boolean) {
if (success) {
setInterval(loadImageLeft, 2000);
setInterval(loadImageRight, 3000);
} else {
trace("Error loading/parsing LoadVars.");
}
}
I get an error that imagePath and imagePathRight is undefined when testing the flash movie. Can anyone see why I am getting this error? Thanks!
View Replies !
View Related
XML Undefined Error
I have the following code on an MC, the MC is called '_fader'...
Code:
on (construct, keyPress "") {
_xmlfile = "images.xml";
_loop = true;
}
INSIDE the MC '_fader' I have the following:
Code:
#initclip
ImageFader = function () {
this.__init__();
};
ImageFader.prototype = new MovieClip();
ImageFader.prototype.__init__ = function () {
this._xscale = 100;
this._yscale = 100;
this.bounding_box.unloadMovie();
this._fader_.unloadMovie();
this._dataProvider = new Array();
this._count = 0;
this._depth = 1;
this._isLoaded = -1;
if (this._S_) {
clearInterval(this._S_);
}
if (this._xmlfile != "") {
this.loadXML(this._xmlfile);
}
};
ImageFader.prototype.loadXML = function (x) {
var v9 = new XML();
v9.ignoreWhite = true;
v9.path = this;
v9.load(x);
v9.onLoad = function () {
for (v2 = 0; v2 < this.firstChild.childNodes.length; v2++) {
var v4 = this.firstChild.childNodes[v2].attributes.TRANSITION;
var v3 = this.firstChild.attributes.PAUSE;
var v5 = this.firstChild.childNodes[v2].firstChild.nodeValue;
this.path._dataProvider.push({img: v5, transition: v4, pause: v3});
}
this.path.startFading();
false;
};
};
ImageFader.prototype.startFading = function () {
if (this._dataProvider.length > 0) {
this.makeFader(true);
}
};
ImageFader.prototype.makeFader = function (first) {
this._isLoaded = -1;
this._depth++;
this._tmp = this.attachMovie("ImageLoader", "ImageLoader" + this._depth, this._depth);
this._old1 = this["ImageLoader" + (this._depth - 1)];
this._old2 = this["ImageLoader" + (this._depth - 2)];
this._tmp.loadHandler("isLoaded", this._count);
this._tmp.autoStart = false;
this._tmp.transition = this._dataProvider[this._count].transition;
this._tmp.loadImage(this._dataProvider[this._count].img);
this._t1 = getTimer();
this.onEnterFrame = function () {
this._t2 = getTimer();
if (this._t2 - this._t1 > this._dataProvider[this._count].pause || first == true) {
if (this._isLoaded == this._count || (this._isLoaded == 1 && this._count == 0)) {
delete this.onEnterFrame;
this._tmp.start();
this._old1.fadeOut();
this._old2.removeMovieClip();
if (this._count + 1 < this._dataProvider.length) {
this._count++;
this.makeFader();
return;
} else {
if (this._loop == true) {
this._count = 0;
this.makeFader();
}
}
}
}
};
};
ImageFader.prototype.isLoaded = function (num) {
this._isLoaded = num;
};
Object.registerClass("ImageFader", ImageFader);
#endinitclip
When I run it I keep getting an 'undefined' error, does anyone have any ideas as I'm struggling...
View Replies !
View Related
Error 1010....what Is Undefined?
This is really strange. I've got a button symbol on stage with an instance name of aboutUs_btn. My code on my AS layer is:
this.aboutUs_btn.addEventListener(MouseEvent.MOUSE _DOWN, about);
function about(evt:MouseEvent):void {
this.wipe_mc.gotoAndPlay(2);
this.gotoAndStop("history");
head.unload();
}
And then I test the movie and get this error and it makes no sense to me.
TypeError: Error #1010: A term is undefined and has no properties.
at main1_fla::MainTimeline/about()
What's weird is I tried this in another .fla and it didn't bring up the error. That makes no sense. They've both got Publish Settings for AS3/FL9
View Replies !
View Related
[CS3] XML Undefined Showing Error
Hi all,
Im having a huge problem with an xml gallery and I need help. Basically all the images and titles are pulled from an xml sheet. But if there are no titles I want it to display nothing but It keeps showing "undefined" in the text box. My code to pull the text in is below.
thanks
Code:
_root.title1.text = this.firstChild.childNodes[1].childNodes[0].firstChild.nodeValue;
Any help will bring serious kudos
View Replies !
View Related
Error #1010: Something Is Undefined, But I Won't Tell You Which.
TypeError: Error #1010: A term is undefined and has no properties.
at EKG1_fla::MainTimeline/EKG1_fla::frame2()
OK, I've narrowed possibilities by sliding code keyframes, and now only have a couple hundred lines of code to guess at by comment out trial and error.
Anyone know a way for Flash to be more specific.
(like the app programmers couldn't foresee any value is passing the offending term)
View Replies !
View Related
Slideshow Error 'undefined'
Can anyone tell me what I am doing wrong with this code... When I run it it keeps saying 'undefined'...
Code:
import com.mosesSupposes.fuse.*;
ZigoEngine.register(Fuse, PennerEasing);
for (i=1;i<11;i++) {
var tmpClip:MovieClip = eval ("Pic" + i)
tmpClip.loadMovie("images/"+i+".jpg")
}
// Start the slideshow on a setInterval
var slideShowTimer:Number = setInterval(nextImage, 5000);
var counter:Number = 0;
// The workhorse function, gets called by setInterval, and should run every 5 seconds.
function nextImage():Void {
var img:MovieClip = images[counter % 3];
img.swapDepths(counter);
trace(img.getDepth());
img._alpha = 0;
img._visible = true;
img.alphaTo(100, 2, "easeOutSine", null, {func:cleanUpPrevious, args:[(counter-1) % 3]});
counter++;
}
// A function to be used in the tween callback to make the image that was just covered up invisible.
function cleanUpPrevious(image:Number):Void {
images[image]._visible = false;
}
// Show first image immediately.
nextImage();
View Replies !
View Related
Array Value Undefined Error
hi!
I require values stored in an array...but, when 'i' in a for loop is at, say 20, I need the 10th value of the array...similarly, when 'i' increments to 30, I require the 20th value...and so on...
i tried 'trace(array[i-10])' but thats shows up as 'undefined' in output...
wud appreciate all suggestions!
View Replies !
View Related
Error Opening Url Undefined
empty_mc.loadMovie(Main.swf) - i am trying to load an external swf into a empty_mc on the stage. When I test it i am getting this in the output:
"file:///C|/Documents%20and%20Settings/Owner/Desktop/My%20Site/FLA/undefined"
Error opening URL
View Replies !
View Related
[Flash8] Undefined Error
Hi, I get a "undefined" for the var "_root["star" + i].adjustPosX" on the last line, how could that be?
Thanks in advance,
Joost Pastoor
Code:
/* S T A R S */
_root.starArr = new Array();
for(i=0; i < _root.gb.cStars; i++)
{
starSize = Math.random()*40+10;
_root.attachMovie("Star", "star" + i, 1000+1);
_root["star" + i]._alpha = Math.random()*40+20;
_root["star" + i]._xscale = _root.gb.starSize;
_root["star" + i]._yscale = _root.gb.starSize;
_root["star" + i].xPos = Math.random()*_root.gb.square;
_root["star" + i].yPos = Math.random()*_root.gb.square;
_root["star" + i].adjustPosX = 0;
_root["star" + i].adjustPosY = 0;
_root["star" + i].defAlpha = _root["star" + i]._alpha;
_root.starArr[i] = _root["star" + i];
_root["star" + i].onEnterFrame = function() {
trace("enterframe" + _root["star" + i].adjustPosX);
View Replies !
View Related
HELP ME - Lee's MP3 Tutorial - Undefined Error :(
Ok, so basically, here's how it all went down. I followed the tutorial all the way through tutorial 2 with no problems... Then I got to tutorial three, and followed everything that Lee said, typed, etc... But then when I got to the end to test my movie, I got this:
My path, C:/Users/MeaningfulCause/Documents/Mashun/Homepage/Jukebox
with a /undefined on the end.
My mp3Player.as (for me it's Jukebox.as) document, is EXACTLY the same as Lee's. At one point I even got so deperate as to copy and paste the XML file over to mine, but even that didn't work! I can't figure out what I'm doing wrong here; I haven't even uploaded it onto my server yet.
Here is my song.as file:
and my XML file (songs.xml):
Please help me guys. I'm just trying to make a good website. This feature is like, 100% neccesary.
Thanks.[/img]
View Replies !
View Related
Getting Undefined Error With Mp3 Player
Hello,
I did the Flash mp3 tutorials on this site and it works perfectly on my computer. However, when I upload the files to my server it stops working and gives me a "undefined-undefined" error where the artists name should be and doesn't play the mp3. The directories are exactly the same and I've tripled checked everything. Is there some code that I'm suppose to add or am I missing something? Any help is appreciated.
Here is a link to the site (it's still under construction)
http://www.3sonsproductions.com/v2/index.html
Code:
// Load the songs XML
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = function()
{
var nodes:Array = this.firstChild.childNodes;
for (var i=0; i<nodes.length;i++)
{
sa.push(new Song(nodes[i].attributes.url, nodes[i].attributes.artist, nodes[i].attributes.track));
}
playSong();
}
xml.load("songs.xml");
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<songs>
<songs url="mp3/Intro.mp3" artist="Dim Sweets" track="Intro"/>
<songs url="mp3/Muggin_Me.mp3" artist="Dim Sweets & Dead Arm" track="Muggin Me"/>
<songs url="mp3/Paramount.mp3" artist="Dead Arm, KB, & Cleo" track="Paramount"/>
<songs url="mp3/Jet_Black.mp3" artist="Dead Arm" track="Jet Black"/>
</songs>
View Replies !
View Related
Error #1010: Something Is Undefined, But I Won't Tell You Which.
TypeError: Error #1010: A term is undefined and has no properties.
at EKG1_fla::MainTimeline/EKG1_fla::frame2()
OK, I've narrowed possibilities by sliding code keyframes, and now only have a couple hundred lines of code to guess at by comment out trial and error.
Anyone know a way for Flash to be more specific.
(like the app programmers couldn't foresee any value is passing the offending term)
View Replies !
View Related
[F8] Testing If An Input Field Is Empty Or Undefined
I've created a caluclator. I would like to summon some error messages if a user doesn't complete all the fields so I need to test that the fields are actually populated with information. I have 5 rows of 4 fields. Each row can run the calculation on its own, as long as the each of the 4 fields are filled. So I wanted to create a variable like rowCheck1, rowCheck2, etc. so that if a given row's 4 input fields are populated, I can test to see if rowCheck1 = 4 and the calculation can run. Here is the code.
code:
this.onEnterFrame = function(){
//card1 is the variable I created off of card1_txt.text
if(card1 != undefined){
rowCheck1 ++;
}
if(balance1 != undefined){
rowCheck1 ++;
}
if(rate1 != undefined){
rowCheck1 ++;
}
if(minPay1 != undefined){
rowCheck1 ++;
}
trace(rowCheck1);
}
I'm having a problem with the syntax to see if the variable equals anything. Many thanks in advance!
View Replies !
View Related
Load Ext. Scrolltext. Error: 'undefined'
Hi, when i load a .txt file into a scrollwindow it works locally. but when i test it on a webhost it doesnt. the error is 'undefined'. could it have something to do with the new flash mx 2004? .before that i didnt have the prob. anyone?
o yeah this is the site http://www.buksna.tk
the center piece
View Replies !
View Related
UNDEFINED Error In External Loading
I am trying to load variables from an external file. I have tried .txt and .php and have gone through every tutorial about it I can.
In my movie I have a dynamic chat box instance called excomment1. I have an external php file with just text in it....http://themcclellanfamily.net/read.php (also tried making it read.txt)
contents are as follows
&excomments1=Test
(I have also tried &excomments=Test and excomments=Test)
Now I want the file to load in the text file. I am using this code...
myData = new LoadVars();
myData.onLoad = function(){
placeTheDataIntoTheRightPlace();
};
myData.load("http://themcclellanfamily.net/read.php");
placeTheDataIntoTheRightPlace = function(){
excomments1.text = myData.excomments1;
};
(when I changed the &excomments1 to &excomments I also changed the myData.excomments1; to match...also tried myData.load("read.php"); and myData.load("/read.php")
Every single time I either get nothing or undefined. I worked on this for 4 hours and can't get it to work. Check out http://www.themcclellanfamily.net/ca...&comments=test for the test. It is SUPPOSED to display near the end when the box shows up.
Any ideas? Thank you so much!
View Replies !
View Related
Access Of An Undefined Property Error
I keep getting 66 errors of "1120: Access of undefined property" for like different properties/variables i am using in a class.
I am not sure why i am getting them. I am importing my class correctly cause if i comment out everything and just put a trace statement in the constructor it traces out fine.
I have attached the flash file and the classes in a zip file.
can someone explain my problem and help me fix it? I have searched all over and can't figure out why im getting this error.
View Replies !
View Related
Undefined Property (error:1120)
I'm trying to move to 3.0 oop. It's not going so hot. I'm trying to create a simple button and I'm at the up/down state stage. My strategy is very simple, but I can't even make the listener work. I've tried several different approaches. I don't understand why this won't work, but I expect it will be pretty obvious to some of you. Your help will be greatly appreciated.
Here is the code with comments. I'll also attach the .as and .fla.
Code:
package{
import flash.display.Sprite;
import flash.events.MouseEvent;
public class upButton extends Sprite{
//upTarget is the container holding the button images. upTarget "listens"
public function upButton():void{
var upTarget:Sprite = new Sprite();
upTarget.graphics.lineStyle(2,0x95ADE5);
upTarget.graphics.beginFill(0xb9dafb);
upTarget.graphics.drawRoundRect(0.6,0.5,14,15,2,2);
upTarget.addEventListener(MouseEvent.MOUSE_DOWN,uPressed);
upTarget.buttonMode = true;
upTarget.useHandCursor = true;
addChild(upTarget);
//upFillDown hides behind the upFillup image.
var upFillDown:Sprite = new Sprite();
upFillDown.graphics.lineStyle(2,0x95ADE5);
upFillDown.graphics.beginFill(0xb9dafb);
upFillDown.graphics.drawRoundRect(0.6,0.5,14,15,2,2);
upTarget.addChild(upFillDown);
//At a higher level, upFillUp should show before a mouseDown
var upFillUp:Sprite = new Sprite();
upFillUp.graphics.lineStyle(2,0x95ADE5);
upFillUp.graphics.beginFill(0x95ADE5);
upFillUp.graphics.drawRoundRect(0.6,0.5,14,15,2,2);
upFillUp.alpha = 100;
upTarget.addChild(upFillUp);
//this guy identifies the button action (up or down)
var upSymbol:Sprite = new Sprite();
upSymbol.graphics.lineStyle(3, 0x4D6185);
upSymbol.graphics.moveTo(1.1,4.2);
upSymbol.graphics.lineTo(4.3,1.1);
upSymbol.graphics.lineTo(7.5,4.2);
upSymbol.x = 4.2;
upSymbol.y = 6.5;
addChild(upSymbol);
}
//For some reason, this handler will not recognize any of the sprites above
public function uPressed(event:MouseEvent){
upTarget.upFillUp.alpha = 0;//this code should hide the upFillUp sprite to show the sprite benieth
}
}
}
View Replies !
View Related
Undefined Property Error With Buttons
Hello,
I've made a movie clip that's the exact size of the stage I'm using in Flash. I want to make it clickable, and when it clicks, I want a 'jumping' boolean variable to turn true.
Right now I have the movie clip 'btn' set up on the stage. I have two classes, a main class, and a class for the character who will jump when the background is pressed. I have an event listener in the character class and a function that should make it jump, but I am getting this error:
1120: Access of undefined property btn.
ActionScript Code:
public function Character() {
btn.addEventListener(MouseEvent.MOUSE_UP,checkJumping);
}
public function checkJumping(event:MouseEvent):void {
jumping = true;
}
There are the portions of the code I'm having problems with. The movie clip has the instance name 'btn', so that can't be the problem.
Thanks.
View Replies !
View Related
Undefined Error Preloader Help Needed
My AS 1.0 preloader code was set to work just fine using Flash 6 in AS 1.0 and now I'm using the same code with a few slight updates I've added for AS 2.0 in Flash 8 and still having problems with an "undefined" error. I'm obviously missing something with variables.., yes?
Thanks to anyone who can shed some light on this problem!
Attach Code
Frame 1
var totalmovie:Number = this.getBytesTotal();
var totalloaded:Number = this.getBytesLoaded();
if (totalloaded / totalmovie > .75) {
gotoAndPlay("loaded");
}
Frame 2
var percentloaded:Number = Math.round(totalloaded / totalmovie * 100);
var feedback:String = " " + percentloaded + "%";
gotoAndPlay("loop");
View Replies !
View Related
Access Of Undefined Property Error?
I'm sure this is just a rookie mistake, but I'm getting the following error:
1119: Access of possibly undefined property scaleX through a reference with static type Function.
from the following code:
public function zoomCounty():void
{
{
var countyTweenZoomX:Tween = new Tween(selectedCounty, "scaleX", Regular.easeInOut, selectedCounty.scaleX , (selectedCounty.scaleX +countyEndSize), framesForZoomIn, false);
var countyTweenZoomY:Tween = new Tween(selectedCounty, "scaleY", Regular.easeInOut, selectedCounty.scaleY , (selectedCounty.scaleY +countyEndSize), framesForZoomIn, false);
var countyTweenPositionX:Tween = new Tween(selectedCounty, "x", Regular.easeInOut, selectedCounty.x , countyEndPositionX, framesForZoomIn, false);
var countyTweenPositionY:Tween = new Tween(selectedCounty, "y", Regular.easeInOut, selectedCounty.y , countyEndPositionY, framesForZoomIn, false);
}
View Replies !
View Related
Error #1010: A Term Is Undefined
I keep getting this error in this function:
ActionScript Code:
private function search(e:Event):void { if (searchtxt.text) { searchResults_ar.splice(0); var searchCriteria:String = searchtxt.text.toLowerCase(); for (var i:int = 0; i< searchStrings_ar.length; i++) { var index = searchStrings_ar[i].toLowerCase().indexOf(searchCriteria); if (index > -1) { searchResults_ar.push(i + 1); } } if (searchResults_ar.length != 0) { // Clear the list component slideList.removeAll(); for (var k:int = 0; k < searchResults_ar.length; k++) { var j = searchResults_ar[k]; var slideTitle = xmlList[j].Title; var slideID = xmlList[j].@id; slideList.addItem({label:j + ". " + slideTitle, data:slideID}); } } else { trace("nothing found"); } } }
and I cannot figure it out! Everything compiles fine, the function even works the way it is suppose to, but every time I hit my search button, I get this error:
ActionScript Code:
TypeError: Error #1010: A term is undefined and has no properties. at Vforum/::search()
Do you guys see anything that might be causing this?
View Replies !
View Related
Error - Undefined Term Has No Properties
I'm trying to program a couple of sliders; this error is coming up and I can't fix it because I don't know what it means ... Can you help me get rid of this error?
This is the slider code I'm using -
//sliders
var dragging:Boolean = false;
var rectangle:Rectangle = new Rectangle (0,0,100,0);
var rotate_mc;
var zoom_mc;
rotate_mc.rotateKnob_mc.addEventListener(MouseEven t.MOUSE_DOWN, dragIt);
zoom_mc.zoomKnob_mc.addEventListener(MouseEvent.MO USE_DOWN,dragIt);
stage.addEventListener(MouseEvent.MOUSE_UP, dropIt);
function dragIt(event:MouseEvent):void{
event.target.startDrag (true);
}
function dropIt(event:MouseEvent):void{
if(dragging){
rotate_mc.rotateKnob_mc.stopDrag();
zoom_mc.zoomKnob_mc.stopDrag();
dragging = false;
}
rotate_mc.rotateKnob_mc.startDrag(false,rectangle) ;
zoom_mc.zoomKnob_mc.startDrag(false,rectangle);
dragging = true;
This is the output error I get (no compiler errors); ind302_Katie_project_v5 is the file's name -
TypeError: Error #1010: A term is undefined and has no properties.
at ind302_Katie_project_v5_fla::MainTimeline/ind302_Katie_project_v5_fla::frame1()
Thanks,
Katie.
View Replies !
View Related
|