Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




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!



FlashKit > Flash Help > Flash ActionScript
Posted on: 01-02-2007, 01:12 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Loading Random Image Error: Undefined?
I have a script on the first frame of my movie that is supposed to load a random image and also load the same correlating random text file with information for that image. The code grabs a variable from another text file that says the max number of images for the image folder so that I don't have to update the flash eveytime I add a new image/photo to the "backgrounds" folder.

Every now and again I get an error when the code tries to load an image/photo that is undefined (//pathtofolder/backgrounds/undefined.jpg). Why would it sometimes try and load an image titled "undefined.jpg"? Here is my code:

// create a clip to hold the image

this.createEmptyMovieClip("imageHolder", 2);

// selecting random images

myArray = new Array();

// loads text document containing number of images

loadVarsText = new LoadVars();

loadVarsText.load("info/number.txt");

//assign a function which fires when the data is loaded:

loadVarsText.onLoad = function(success) {

if (success) {

trace("done loading");

// only after the data finishes loading, you-ll be able to use it

for (i = 1; i <= this.var1; i++) {

myArray.push('photo' + i);

}

randNumber = Math.round(Math.random() * myArray.length);

// load the image.

imageHolder.loadMovie("backgrounds/" + myArray[randNumber] + ".jpg");

} else {

trace("not loaded");

}

};

_______________________

I have two folders "backgrounds" and "info". The folder "backgrounds" has two photos in it (photo1.jpg and photo2.jpg). The info folder has the file "number.txt" in it with this text in the file:

&var1=2&

- Why am I receiving an undefined error? Please help... I am so close!

Thanks,

-- K

Loading External Text Eternal Undefined
The eternal question... I know that there is a lot out there about importing text from .txt files but, it seems that nothing fixes my problem. I am most certainly missing something here... Every thing is working when testing movie. But, preview in browser (local and server) does not work... I get undefined as the text...

I have tried the onData and the onLoad methods and still get this undefined going out in preview...



What is the list of things to check so I can fix that out?


here is the function that loads properly in test movie mode where path is the path for the text...

I call the function with
loadtext(textPath, _root.mcTextBox.texte);

and textPath is
var textPath:String = "/textes/Accueil.txt";


Code:
loadtext = function(path:String, targettextbox:MovieClip):Void{
var lvData:LoadVars = new LoadVars();
lvData.onData = function(sData:String):Void{
targettextbox.text = sData;
};
lvData.load(path);
}

And here is another one that does the same thing!!!


Code:
loadtext = function(path:String, targettextbox:MovieClip):Void{
function isLoaded(succes:Boolean) {
if(succes) {
targettextbox.text = this.text;
}
}
var lvData:LoadVars = new LoadVars();
lvData.onLoad = isLoaded;
lvData.load(path);
}

Undefined Variable Loading External Text
Still climbing the mountain learning AS; no doubt there is a simple answer to this question (I have tried unsuccessfully to find it in extant threads as well as between my ears).

Trying to augment the Kirupa tutorial "ActionScript Text Animation" (http://www.kirupa.com/developer/acti..._animation.htm)
to take an external text file. When I switch out the line:
text = "There is only one..."
with:
myLoadVar = new LoadVars ();
myLoadVar.load("davetextdoc.txt")
myLoadVar.onLoad = function (success){
if (success == true) {
output.variable = "text"
output.text=myLoadVar.text;
}
}
I get the word "undefined" repeatedly loading itself. The text file is properly formatted(text=dave's text here...) I've tried untold permutations to self-solve. Help is appreciated.

Undefined Variable Loading External Text
Still climbing the mountain learning AS; no doubt there is a simple answer to this question (I have tried unsuccessfully to find it in extant threads as well as between my ears).

Trying to augment the Kirupa tutorial "ActionScript Text Animation" (http://www.kirupa.com/developer/acti..._animation.htm)
to take an external text file. When I switch out the line:
text = "There is only one..."
with:
myLoadVar = new LoadVars ();
myLoadVar.load("davetextdoc.txt")
myLoadVar.onLoad = function (success){
if (success == true) {
output.variable = "text"
output.text=myLoadVar.text;
}
}
I get the word "undefined" repeatedly loading itself. The text file is properly formatted(text=dave's text here...) I've tried untold permutations to self-solve. Help is appreciated.

Loading External TXT File With Button (undefined Issue)
Hello,

I have this problem when loading external text files with HTML using a button (not onClipEvent):

When the button is pressed online, 'undefined' shows up in the txt field. Pressing the button again remedies the situation and the txt loads fine.

Here is the code:

on (press) {
loadVariables("aboutus.txt", this);
}
on (release) {
_root.about.scroller.htmlText = this.aboutustext;
}

I'm assuming it's something to do with the data not being able to finish loading in time? Pathing issue?

It works fine when the page loads first off using:

onClipEvent (load) {
loadVariables("aboutus.txt", this);
}
onClipEvent (data) {
_root.about.scroller.htmlText = this.aboutustext;
}

Any idea's? Cheers.

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!!

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...

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

Error Loading External SWF's Twice
Hey guys ,
I am using the open source page flip by Macc (http://www.iparigrafika.hu/pageflip/)

I load it into a empty movie clip

Code:
_r=this.createEmptyMovieClip("resumeHolder",this.getNextHighestDepth());
_r.loadMovie("resume.swf");
It works fine
Then I remove it using

Code:
_r.unloadMovie();
_r.removeMovieClip();
Then when I load it the second time it loads the external swf fine but it doesnt work correctly. The same thing happens when I am testing just the pageflip swf inside the Flash8 IDE, when I test it by pressing Ctrl + Enter
and then press ctrl + enter 2ce to reload it without closing the window.

Hope I am making sense

cheers
firdosh

Loading External SWF Error
I have successfully creatd the transitions for my site with the Loading external SWF file tutorial. I have the first section of the site loading as the first SWF after the initial base animation as the tutorial suggested, but when I press any of the buttons on the site which are on the main timeline I receive the following error. (The animation and transition plays out fine but this is what comes up in the Output panel for FlashMX 2004 Pro).

Target not found: Target="undefined" Base="_level0.container"
Target not found: Target="undefined" Base="_level0.container"
undefined
false

If anyone can tell me what this means and what to do to clear it I would be greatly appreciative. I am fairly new to this.
Thank you.

P Bragino

Loading External Swf And Object Error
Hello Forum,
I have two swf files, Flash CS3, action script 3.
One file can be considered to be the parent container, it does have some objects on its stage.
The other file is a file that I would like to load into the master file using the Loader object.

The file that I would like to load, works fine (or so it seems) standalone. This file contains
a timer object, a loader object (which loads images from an xml file), and XMLLoader feature,
and a button that I have created from a class that i have created for a button. I can set the
label for the button from the swf like a property. This swf is all Actionscript, using
addchild to get the various things on the stage.

I am using actionscript to load the objects on the stage in the external file - as opposed to having
them on the timeline before hand.

When I try to load this external swf file in to a parent swf file I get an error like this:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at weekly_tasks_fla::MainTimeline/frame1()

This error happens whenever (in the external swf file) i add an object
(like a button or a textfield) to the stage of the exteranl swf file.

I am able to load other swf files ok (as long as I did not create them!).

Confused Again,

eholz1

Error #1009 At Loading An External Swf
I am using FlashDevelop 3 for my project, and I am trying to load an swf (created in Flash CS3 and with timeline code). What does it mean?

Code:
[Fault] exception, information=TypeError: Error #1009: Cannot access a property or method of a null object reference.
Execution halted in 'spontaneousBox.swf' ffffffffat 0xExecution halted in 'spontaneousBox.swf' ffffffff (-1)
PS: i can load images fine, and other swfs built with FlashDevelop.

EDIT: it seems that i only get the error the first time I load the swf, after trying to load again, it loads ok.

Error Loading External Image.
I've been struggling with flash for a couple of hours, not getting what the hell I'm doing wrong.
I'm trying to load an external JPEG into an existing MovieClip inside my main one.
I came across this, which has the exact same problem.

Code:


//create an object to handle the data available form the MovieClipLoader() object.
var contentListener:Object = new Object();
// create function that fires/executes when the content is complete
contentListener.onLoadProgress = function(target_mc:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void {
trace(target_mc._name + ".onLoadProgress with " + bytesLoaded + " bytes of " + bytesTotal);
trace(">> Invoked every time the loading content is written to the hard disk during the loading process (that is, between MovieClipLoader.onLoadStart and MovieClipLoader.onLoadComplete).");
}
// create function that fires/executes when the content is complete
contentListener.onLoadComplete = function(target_mc:MovieClip, httpStatus:Number):Void {
trace(">> contentListener.onLoadComplete()");
trace(">> =============================");
trace(">> "+target_mc._name+"._width: " + target_mc._width);
trace(">>> {its 0 because the content hasnt (although complete) hasnt initiliazed and Flash can not access any properties.}");
trace(newline);
};
// create function that fires/executes when the content has initialized and is ready for manipulation
contentListener.onLoadInit = function(target_mc:MovieClip):Void {
trace(">> contentListener.onLoadInit()");
trace(">> =============================");
trace(">> "+target_mc._name+"._width: " + target_mc._width);
trace(">>> {its 315 because once the content/clip has initialized, Flash can not access its properties.}");
trace(newline);
// Draw outline around the loaded content
target_mc._x = Stage.width/2-target_mc._width/2;
target_mc._y = Stage.height/2-target_mc._width/2;
var w:Number = target_mc._width;
var h:Number = target_mc._height;
target_mc.lineStyle(4, 0x000000);
target_mc.moveTo(0, 0);
target_mc.lineTo(w, 0);
target_mc.lineTo(w, h);
target_mc.lineTo(0, h);
target_mc.lineTo(0, 0);
target_mc._rotation = 0;
};

// create our MovieClipLoader instance (called: contentLoader)
var contentLoader:MovieClipLoader = new MovieClipLoader();
// add our 'listener' object to our MovieClipLoader instance
contentLoader.addListener(contentListener);
// create an empty movieClip on the stage to hold our content...(this can be any target you want though)
var containerClip:MovieClip = this.createEmptyMovieClip("containerClip", this.getNextHighestDepth());
// finally, make the call to load whatever content we want.. this is just an on-line image (but can be whatever, .swf, .jpg, clips in library..etc)
contentLoader.loadClip("http://www.w3.org/Icons/w3c_main.png", containerClip);


This is the code I find on the Internet, which is very similar to my own. When I was trying to find a solution.
The targetMovieClip on the onLoadInit, doesn't give me a width or height value, making the image invisible, although the listener says that it was loaded properly.

Does anyone have any clues about why this is happening?

Cheers in advance.

PS: I'm using FlashMX2004

Loading From External Text File = "undefined"
Hi all,

It's my first time here and after searching for over 2+ hours I've grown sick and tired of trying to get my text to load from an external file... it succeeding for previews and then when I try and put it online all elements of text that are edited by the file becoming undefined.

You can get the files here (http://rapidshare.com/files/95738481/Flash.zip.html) because this site wouldn't allow me to upload them directly (great!) - please tell me where I've got wrong.

Loading External SWF - Type Coercion Error?
I'm trying to load an external SWF and determine what frame it's on as it plays.

I tried the code in this post (http://board.flashkit.com/board/showthread.php?t=778712) - which in my case looks like this:


Code:
var oldHeaderReq:URLRequest = new URLRequest('RCVHeader.swf');
var loadedSWF:MovieClip;
var swfLoader:Loader = new Loader();

swfLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, onComplete);
swfLoader.load(oldHeaderReq);

function onComplete(e:Event):void
{
loadedSWF = MovieClip(e.target.loader.data);
loadedSWF.addEventListener(Event.ENTER_FRAME, trackFrame);
addChild(loadedSWF);
}

function trackFrame(e:Event):void
{
trace(loadedSWF.currentFrame);
}
But I keep getting the error "ReferenceError: Error #1069: Property data not found on flash.display.Loader and there is no default value.
at rcvHeader2_fla::MainTimeline/onComplete()"

I tried using ".content" instead of ".data":

Code:
loadedSWF = MovieClip(e.target.loader.content);
and I get "TypeError: Error #1034: Type Coercion failed: cannot convert flash.display::AVM1Movie@1bd61509 to flash.display.MovieClip.
at rcvHeader2_fla::MainTimeline/onComplete()"

The SWF plays if I just add e.target.loader.content as a child, but then I can't access what frame it's at.

What am I doing wrong?

Loading External Photo Gallery Error
I have edited the photogallery tutorial with my own graphics and would now like to use it in my own flash movie. However when i link to it externally all it loads up on preview is the first image of the gallery with no buttons and no masks etc. Just the first JPEG.

I tried the bring the frames of the FLA into my own movie rather than linking to them externally, but the movie gave the the error NAN repeatedly.

All the files are in the correct locations as it works fine when i preview the swf of the gallery. Also the gallery works if im to preview just the scene that its in, rather that the whole movie.

Any clues anyone?

Thanks!

Avoiding Error #1009 When Loading External Swf
Hello,

I've often encountered this error when loading one swf into another, especially when loading papervision pv3d examples, and finally figured out why: when the loaded swf refers to stage anywhere in its startup sequence stage does not exist until that swf has been added to the stage...

The solution was to move startup code to a function and test for availability of stage...


Code:
public function Main() {
if (stage == null) {
addEventListener(Event.ADDED_TO_STAGE, startup);
} else {
startup();
}
}

private function startup(event : Event = null) : void {
stage.scaleMode = StageScaleMode.NO_SCALE;
init3D();
createCube();
stage.quality = StageQuality.LOW;
this.addEventListener(Event.ENTER_FRAME, loop);
}
Hope this helps someone.

Carousel 3 : Loading External Swf = "undefined"
Hey guys,

I know that there are alot of posts about loading external swf or links into the carousel. However the problem i am havng is when i click on a carousel icon it returns with an error in the output window saying;

Error opening URL "file:///F|/1.RYAN/Ass3/undefined"

now obviously this looks like a file path problem, but i have tried to fix this and it still returns the same message. I have also looked at how i called the xml file back and it seem to be ok.

I am not an experienced actionscripter but really want to know what im doing wrong.

Here is my code:

Code:

import mx.utils.Delegate;
import mx.transitions.Tween;
import mx.transitions.easing.*;

var numOfItems:Number;
var radiusX:Number = 300;
var radiusY:Number = 75;
var centerX:Number = Stage.width / 2;
var centerY:Number = Stage.height / 2;
var speed:Number = 0.05;
var perspective:Number = 250;
var home:MovieClip = this;
theText._alpha = 0;

var tooltip:MovieClip = this.attachMovie("tooltip","tooltip",10000);
tooltip._alpha = 0;

var xml:XML = new XML();
xml.ignoreWhite = true;

xml.onLoad = function()
{
   var nodes = this.firstChild.childNodes;
   numOfItems = nodes.length;
   for(var i=0;i<numOfItems;i++)
   {
      var t = home.attachMovie("item","item"+i,i+1);
      t.angle = i * ((Math.PI*2)/numOfItems);
      t.onEnterFrame = mover;
      t.toolText = nodes[i].attributes.tooltip;
      t.content = nodes[i].attributes.content;
      t.icon.inner.loadMovie(nodes[i].attributes.image);
      t.ref.inner.loadMovie(nodes[i].attributes.image);
      t.loadSwf = nodes[i].attributes.loadSwf;
      t.icon.onRollOver = over;
      t.icon.onRollOut = out;
      t.icon.onRelease = released;
   }
}



function over()
{
   //BONUS Section
   var sou:Sound = new Sound();
   sou.attachSound("Boop");
   sou.start();
   
   home.tooltip.tipText.text = this._parent.toolText;
   home.tooltip._x = this._parent._x;
   home.tooltip._y = this._parent._y - this._parent._height/2;
   home.tooltip.onEnterFrame = Delegate.create(this,moveTip);
   home.tooltip._alpha = 100;
}

function out()
{
   delete home.tooltip.onEnterFrame;
   home.tooltip._alpha = 0;
}

function released()
{
   //BONUS Section
   var sou:Sound = new Sound();
   sou.attachSound("hum");
   sou.start();
   
   home.tooltip._alpha = 0;
      for(var i=0;i<numOfItems;i++)
   {
      var t:MovieClip = home["item"+i];
      t.xPos = t._x;
      t.yPos = t._y;
      t.theScale = t._xscale;
      delete t.icon.onRollOver;
      delete t.icon.onRollOut;
      delete t.icon.onRelease;
      delete t.onEnterFrame;
      if(t != this._parent)
      {
         var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,t._xscale,0,1,true);
         var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,t._yscale,0,1,true);
         var tw3:Tween = new Tween(t,"_alpha",Strong.easeOut,150,0,1,true);
      }
      else
      {
         var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,t._xscale,150,1,true);
         var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,t._yscale,150,1,true);
         var tw3:Tween = new Tween(t,"_x",Strong.easeOut,t._x,50,1,true);
         var tw4:Tween = new Tween(t,"_y",Strong.easeOut,t._y,600,1,true);
         var tw5:Tween = new Tween(theText,"_alpha",Strong.easeOut,0,150,1,true);
         theText.text = t.content;
         var s:Object = this;
         tw.onMotionStopped = function()
         {
            s.onRelease = unReleased;
            
            _root.createEmptyMovieClip("holder",1);
            _root.holder._x = 300;
            _root.holder._y = 50;
            
            loadMovie(this._parent.loadSwf,"holder");
         }
      }
   }
}

function unReleased()
{
   //BONUS Section
   var sou:Sound = new Sound();
   sou.attachSound("sdown");
   sou.start();
   
   delete this.onRelease;
   delete _root.createEmptyMovieClip("holder",1);
   
   var tw:Tween = new Tween(theText,"_alpha",Strong.easeOut,150,0,0.5,true);
   for(var i=0;i<numOfItems;i++)
   {
      var t:MovieClip = home["item"+i];
      if(t != this._parent)
      {
         var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,0,t.theScale,1,true);
         var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,0,t.theScale,1,true);
         var tw3:Tween = new Tween(t,"_alpha",Strong.easeOut,0,150,1,true);
      }
      else
      {
         var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,150,t.theScale,1,true);
         var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,150,t.theScale,1,true);
         var tw3:Tween = new Tween(t,"_x",Strong.easeOut,t._x,t.xPos,1,true);
         var tw4:Tween = new Tween(t,"_y",Strong.easeOut,t._y,t.yPos,1,true);
         tw.onMotionStopped = function()
         {
            for(var i=0;i<numOfItems;i++)
            {
               var t:MovieClip = home["item"+i];
               t.icon.onRollOver = Delegate.create(t.icon,over);
               t.icon.onRollOut = Delegate.create(t.icon,out);
               t.icon.onRelease = Delegate.create(t.icon,released);
               t.onEnterFrame = mover;
            }
         }
      }
   }
}


function moveTip()
{
   home.tooltip._x = this._parent._x;
   home.tooltip._y = this._parent._y - this._parent._height/2;
}

xml.load("icons.xml");

function mover()
{
   this._x = Math.cos(this.angle) * radiusX + centerX;
   this._y = Math.sin(this.angle) * radiusY + centerY;
   var s = (this._y - perspective) /(centerY+radiusY-perspective);
   this._xscale = this._yscale = s*100;
   this.angle += this._parent.speed;
   this.swapDepths(Math.round(this._xscale) + 100);
}

this.onMouseMove = function()
{
   speed = (this._xmouse-centerX)/4500;
}






Here is the XML


Code:

<icons>

<icon image="BlueH.png" tooltip="Video" content="Video" loadSwf="flvPlayer.swf"/>

<icon image="YellowH.png" tooltip="Gallery" content="Gallery" loadSwf="gallery.swf"/>

<icon image="RedH.png" tooltip="Resume" content="Resume" loadSwf="resume.swf" />

<icon image="GreenH.png" tooltip="Contact"content="Contact" loadSwf="contact.swf" />

</icons>


I know this topic has been discussed alot, but i really cant work it out.

Any help would be greatly appreciated.

Thanks
Hamo

Loading External CSS-file. Want Error Messages If Failing-HELP
I'm loading an external css-file for a dynamic textfield that is taking it's content from an external txt-file. I want some error messages to appear if it doesn't succed to load css or external txt-file. The problem is that if erase the css or txt file I just get nothing. It's completely blank. What am I doing wrong? news.newsText1.embedFonts = true; was needed for the css to work-I'm also using shared fonts with a shared library file. My code is below...help would appreciated....thank you.

Niklas


//----------------<LOAD CSS>------------------------\
var cssStyles:TextField.StyleSheet = new TextField.StyleSheet();
cssStyles.load("styles.css");
var myLV:LoadVars = new LoadVars();

cssStyles.onLoad = function(success) {
if (success) {
news.newsText1.styleSheet = cssStyles;
myLV.load("home/home.txt");//-<LOAD VARS>
} else {
news.newsText1.text = "There has been an error loading this section.";
}
myLV.onLoad = function(success) {
if (success) {
news.newsText1.htmlText = myLV.news;
} else {
news.newsText1.text = "There has been an error loading this section.";
// ----------------<END LOAD VARS>
}

}
};
news.newsText1.embedFonts = true;

//----------------<END LOAD CSS>--------------------\

Loading External Data To An Array Syntax Error
I'm trying to load data from an external text file into an array. I created an array and am able to load the data into an array if I explicitly say something like


ActionScript Code:
array[0] = event.target.data.uid1_name;

I can then do a trace statement on array[0] and it will output the correct name from the file. My problem is I'm trying to iterate through the variable names in the text file in the file by using an index variable. This is the code I'm using after doing all the URLloader, URLRequest, and so forth stuff:


ActionScript Code:
for(var i = 0; i<20;i++){
     fArray[i] = event.target.data.uid[i]_name;
}

This produces a syntax error. I've tried several other syntax variations but haven't been able to figure it out.

Any thoughts on the syntax to iterate the number after uid (uid1_name, uid2_name, uid3_name, etc)?

Loading External Data To An Array Syntax Error
I'm trying to load data from an external text file into an array. I created an array and am able to load the data into an array if I explicitly say something like


ActionScript Code:
array[0] = event.target.data.uid1_name;

I can then do a trace statement on array[0] and it will output the correct name from the file. My problem is I'm trying to iterate through the variable names in the text file in the file by using an index variable. This is the code I'm using after doing all the URLloader, URLRequest, and so forth stuff:


ActionScript Code:
for(var i = 0; i<20;i++){
fArray = event.target.data.uid_name;
}

This produces a syntax error. I've tried several other syntax variations but haven't been able to figure it out.

I've also tried the following:

fArray = event.target.data["uid"+i+"_name"];
fArray = event.target.data.["uid"+i+"_name"];
fArray = event.target.data."uid"+i+"_name";

All three of those also give me errors. For the first one the trace statement outputs "undefinded" instead of "Doug". For the second I get "syntax error. Expecting identifier before left bracket". And for the third I get "syntax error, expecting identifer before uid.":

Any thoughts on the syntax to iterate the number after uid (uid1_name, uid2_name, uid3_name, etc)?

Level_0 Error Loading External Dynamic Text
I need some help.

I have built a complete website in flash, and everything is great except, when I go to one section of the site immediately, it fails to load the text but gives me a "text.level_0" message where the text should be, but after clicking on some other pages, (which all load correctly) then it loads the text. All other sections load immediately, but this section only loads aftre a couple others have been loaded. Each text section is on a seperate layer. Please give me any pointers you have, I am ready to be finished with this site!

Container Error, Loading External SWF Still Exist... Please Read
hey guys... ive been cranking for over 10+ hours, and thought i figured the whole thing out but i just ran across a nasty error.

I have 4 flash files. I want to externally load 3 other files to completely change the layout.

Now, the main file has a container located on top of the layout that I have created for the 1st layout.

When I click a button to go to the next external swf (layout), it loads up the next swf file, which takes up the whole layout; basically changes the entire layout, even covering the previous buttons. Exactly what I want it to do.

Now the thing that happens is, once the new layout is up and running perfectly, the buttons from the previous file, are still clickable. You can't see them at all, but the buttons are still clickable when you move the mouse over where they last where on the previous layout.

Examples of code (actionscript) in the Main File on the button


Quote:




on (release) {
if (_root.currMovie == undefined) {
_root.currMovie = "test01";
container.loadMovie("test01.swf");
} else if (_root.currMovie != "test01") {
if (container._currentframe>= container.midframe) {
_root.currMovie = "test01";
container.play();
}
}
}




you can also use this code as well and it still does the same thing...


Quote:




on(release){
container.loadMovie("test01.swf");
}




I don't know if I'm doing something wrong, or just not adding the correct code. Please help

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 Válido";
}else{
return "CPF Inválido";
}
}

//Test
cpf = "85723185187";
trace(cpf.verificaCPF());

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

[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?!

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;
}

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...

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????

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

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

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...

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;
}

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??

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());

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

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!

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...

Loading External Text-file, Works, But Still Get An Error Message, Why?
so, i made a layer called text, with a dynamic textfield and called the instance "newsText". and then wrote the following ascript on a new layer;
--------------------------------------------------
myText = new LoadVars();
myText.onLoad = function();

MyText {
newsText.text = this.myVariable;
}

myText.load("newstext.txt");
--------------------------------------------------
i manage to load the text, but i got the following mesage, and i don´t understand why it complains about "Ext_text" and "test.txt" since I changed it to "myText" and "newstext.txt"

**Error** Symbol=newstext bar 1, layer=newsbar, frame=1:Line 1: Statement must appear within on/onClipEvent handler
Ext_text = new LoadVars();

**Error** Symbol=newstext bar 1, layer=newsbar, frame=1:Line 2: Statement must appear within on/onClipEvent handler
Ext_text.onLoad = addText;

**Error** Symbol=newstext bar 1, layer=newsbar, frame=1:Line 3: Statement must appear within on/onClipEvent handler
Ext_text.load("test.txt");

**Error** Symbol=newstext bar 1, layer=newsbar, frame=1:Line 4: Statement must appear within on/onClipEvent handler
function addText() {

Error Opening URL (undefined)
I have an error on the output

Error opening URL "file:///D|/WebsiteProjects/Solid%2DGamers/undefined"

I don't know why this is happening

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

[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

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)

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();

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!

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

[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);

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]

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>

Copyright © 2005-08 www.BigResource.com, All rights reserved