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
FlashKit > Flash Help > Flash General Help
Posted on: 03-01-2006, 09:45 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
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
Error Opening URL File:// Undefined? Can't See What I Missed.
I am using a dynamic nav menu edited using xml, when the corresponding button is pressed I want it to display some text in the text box and load a .swf into the loader m.c. It sort of works, however which ever button i click on it displays the content text and .swf for the last button listed in the xml file, when I try to set a var equal to the instance name of the button clicked on it shows the text as undefined and does not load the m.c? If i leave out the var 'currentIndex' I get a message in the output Error opening URL file undefined. I've checked everything and there are no typos. Really need some help here.
Thanks
code;
var yPosition:Number = 0;
var myXML:XML = new XML();
myXML.ignoreWhite = true;
var links:Array = new Array();
var names:Array = new Array();
theText._alpha = 0;
empty._visible = false;
myXML.onLoad = function(){
var linkname:Array = this.firstChild.childNodes;
for(i=0;i<linkname.length;i++){
names.push(linkname[i].attributes.NAME);
contents = linkname[i].attributes.CONTENT;
movies = linkname[i].attributes.MOVIE;
_root.attachMovie("button","btn"+i,_root.getNextHi ghestDepth());
_root["btn"+i]._y = yPosition;
yPosition = yPosition + 25
_root["btn"+(i)].blackTxt.Txt.text = (names[i]);
_root["btn"+(i)].whiteTxt.Txt.text = (names[i]);
_root["btn"+(i)].onRollOver = btnOver;
_root["btn"+(i)].onRollOut = btnOut;
_root["btn"+(i)].onRelease = btnRelease;
}
}
myXML.load("projects.xml");
function btnOver(){
this.gotoAndPlay(2);
}
function btnOut(){
this.gotoAndPlay(11);
}
function btnRelease(){
var currentBtn:String = this._name;
var currentIndex:String = currentBtn.substring(3,5);
theText._alpha = 100;
theText.text = contents;
empty._visible = true;
empty.loadMovie(movies[currentIndex]);
}
Getting A "error Opening Url Undefined" Error
i really don't know what's going on with this one, I'm relatively new to flash and I'm having a hard time getting mp3's to load. i am following a mp3 player tutorial from gotoandlearn. Basicly I'm trying to load a movie with music from a xml file. When i test the movie instead of having the music play i get this error message"Error opening URL 'file:///VOLTRON/Users/VOLTRON/Desktop/the%20eye%20of%20norris/undefined"
the fla,as file and xml document are all in the same folder and i've checked the xml for typos so i'm at a loss. i've been working on this for hours somebody please help
----------------------------------------------------------here's my xml------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<songs>
<song url="Track1.mp3"></song>
<song url="Track2.mp3"></song>
<song url="Track3.mp3"></song>
<song url="Track4.mp3"></song>
<song url="Track5.mp3"></song>
<song url="Track6.mp3"></song>
<song url="Track7.mp3"></song>
<song url="Track8.mp3"></song>
<song url="Track9.mp3"></song>
<song url="Track10.mp3"></song>
<song url="Track11.mp3"></song>
<song url="Track12.mp3"></song>
<song url="Track13.mp3"></song>
<song url="Track14.mp3"></song>
<song url="Track15.mp3"></song>
<song url="Track16.mp3"></song>
</songs>
------------------------------------------------------------------here's my as file-------------------------------------------------------
var s:Sound = new Sound();
s.onSoundComplete = playSong;
s.setVolume(75);
var sa:Array = new Array();
var cps:Number = -1;
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = function()
{
var nodes:Array = this.firstChild.childNodes;
for(var i=o;i < nodes.length;i++)
{
sa.push(nodes[i].attributes.url);
}
playSong();
}
xml.load("beats.xml");
function playSong():Void
{
if (cps == sa.length -1)
{
cps = 0;
s.loadSound(sa[cps], true);
}
else
{
s.loadSound(sa[++cps], true);
}
}
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
Strange Error: Error Opening Url File (that Is No Longer Loading Into Movie)
I had a few external swf's loading into my main movie, and after several revisions I went through my directory and deleted the swf's that were no longer being used.
Now I am getting an error that one of them cannot open, (it is one of the deleted that I am no longer using)
I know where the code should be, because of the timing of when the error appears in the output window, but I cannot find
code anywhere telling this movie to load.
Any ideas about what I could have done and how to find it?
Here is the actual message:
Error opening URL "file:///P|/Web%20Projects/CBS/Natri/NATRI%202003/hosted.swf"
Error Handler LoadMovie (Error Opening URL "http:)
I'm loading several foto's which are stored in a database in a movieclip.
The foto's are in different sizes so I use a repositioning function when the foto is loaded
ActionScript Code:
onClipEvent (data) {
_parent.reposPic();
}
However if the foto linked in the database (which I don't have control of) is not found. (Error opening URL "http://www.mysite.nl/test.JPG")
onClipEvent(data) does not do anything.
Is there a way to handle the error message so I can load a 'file not found' image instead?
Cheers,
Leon
Simple Error Opening URL Error Message?
Hey All,
I'm sure this is a really easy question but why does this happen when testing the movie?
I have set the permission to read and write but for some reason there is an error opening the file why does this happen and what do I need to do to fix it?
thanks for you help
stefan
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...
[MX04] "Error Opening URL" During Preview On Flash (not Just Opening Swf).
When I preview a movie by pressing command+return (Mac) on a few particular .fla files, it gives me a "Error Opening URL" message.
Error opening URL "file:///Macintosh%20HD/Users/Fujiwara%5FTakumi/Web%5FProjectsr%5FM/Current%5FProject%5FFilesVash%5Fwebsite/version5/%5Ftemplates%20and%20stuff/flash%5Fbtns/flashbanner.swf"
The files are in the same folder, I didn't move them at all. It happened the very first time I created a preview/SWF file by hitting command+return and it kept doing that whenever I wanted to preview my file. So I had to go in and just open the SWF file itself each time I hit "command+return". Why does it do that? Is it because the path is way too long? Does Flash have issues with really long paths or is this a glitch? I'm trying to figure out why this happens because it ALSO happens on a separate project (that's 3-4 folders in depth) at certain points of the project.
I try to go back to the very first main page from a swf file that's 2 folders above it even though if I just open the main root file (index.swf or whatever), it opens a swf file that's a folder above it just fine (/anotherfolder/file.swf). That file has no issues going forward another folder (/anotherfolder/anotherfolder2/file.swf) It has no problems going backwards to the very first index page from that point on (../../index.swf). With that said, after going back 2-3 folders to open the index page. The index page can no longer go FORWARD again, for some odd reason, but the pathways are correct and they work perfectly fine if I started viewing the swf project from the very beginning and go forward from there.
Perhaps I should just copy and paste everything from the defective file and onto a new file, would that help? I'm trying to narrow what this problem may be to see if these two separate projects have any issues that are related in any way shape or form. This has been buggin' the hell out of me for the past 3 weeks!
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!
[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>
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)
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
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!
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.
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
}
}
}
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.
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");
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?
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);
}
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?
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.
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?
Slideshow With FUse / Error 'undefined'
Hi,
Am just starting to get into both Flash and Fuse and wanted to create a small slideshow... But when I run it in the output window I get 'undefinied' if anyone has any ideas would be much appreciated!
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();
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
Java Popup Error: File Undefined
When Im trying to call a popup window in flash mx pro, a error appears saying "cannot find file:c//"my computer"/undefined. instead of test.html
But everything (movie.swf, movie.html, and test.html) are togheter in the same folder
this is the code in the button:
on (release) {getURL(javascriptopenNewWindow("test.html",'gtani me', 'height=200,width=250,toolbar=no,scrollbars=no')
);
}
And this is the code I placed between the head tag inside the movie.html:
<script language="JavaScript">
function openNewWindow(URLtoOpen, windowName, windowFeatures) { newWindow=window.open(URLtoOpen, windowName, windowFeatures); }
</script>
[CS3] Access Of Undefined Property WareBtn Error?
Hi there,
New to Flash and trying to figure out why I'm getting this error.
I have a movie clip called buttons on the stage and inside that I have two buttons that animate over time in and out. I'm guessing this error is because I have the actions in my main timeline and not in the buttons movie clip?! However when I put the actions in the movie clip I get this error:
Code:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at 2_test3_fla::buttons_4/2_test3_fla::frame2()
Here's my actionscript:
Code:
wareBtn.addEventListener(MouseEvent.CLICK, getMyUrlWare);
function getMyUrlWare(event: MouseEvent):void
{
var request:URLRequest = new URLRequest("http://www.blah.com/warehousing.html");
navigateToURL(request, "_self");
}
airBtn.addEventListener(MouseEvent.CLICK, getMyUrlAir);
function getMyUrlAir(event: MouseEvent):void
{
var request:URLRequest = new URLRequest("http://www.blah.com/air.html");
navigateToURL(request, "_self");
}
Oh and I have made sure all the buttons keyframes have the correct name e.g "wareBtn"
Any help would be much appreciated...
Thanks.
J
1120: Access Of Undefined Property Error
Hwo do you send a string from a class file to an already existing textfield on the main timeline/stage?
I keep getting:
1120: Access of undefined property main_txt.
Error 1120: Access Of Undefined Property
Hi-
I'm new to Flash and am trying to do a simple assignment. I need a button to control a movie clip. My button is called "btn" and movie clip is called "corn." This is my script so far....
btn.addEventListener(MouseEvent.ROLL_OVER, onOver);
function onOver(evt:MouseEvent):void {
corn.scaleX = 2;
}
and this is my error message: 1120: Access of undefined property corn.
|