Random Load Error (Why Does This Happen?)
Why is this happening!? On the interactive section of my page here:http://www.sheahawton.com/I have a bunch of externally loaded swf files that are supposed to load into the black square in the middle. As you can see... some of the swfs partially load... just the text for most, and then some dont. If you click another section then click back, it loads fine and you can see what it's supposed to look like. This doesn't make much sense to me, considering the swf files are done on a single frame, with the text just a layer below the image... so why does a portion of the swf load but the other doesn't and why do some and not others? I have the swfs loading using loadMovie. (example below) Code: container.loadMovie("movieclipname.swf");container2.loadMovie("movieclipname2.swf");container3.loadMovie("movieclipname3.swf");container4.loadMovie("movieclipname4.swf"); This works perfectly with every other site I've done, and I've used that same setup many times on this site. Yet for whatever reason... it doesn't work regularly.I'm pretty much done with this site, and I'm waiting to fix this to post all of the work and there and send it out to get a designer job. This one issue is holding me up. Please help!
KirupaForum > Flash > Flash 8 (and earlier)
Posted on: 04-15-2008, 01:45 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Why Does This "Cannot Create Property Text On String" Error Happen?
I have three text boxes(textBox1, textBox2, textBox3) on stage that I want a single message to be passed onto each text box but can't seem to get it to work. The code below keeps getting this error message: "Cannot create property text on String." How do I make "textBox" not a string.
var textBoxes:Array = new Array();
var winnerText:String = "You Won";
var randomNum:Number = Math.ceil(Math.random() * 3);
var i:int;
var n:int;
for (i = 1; i <= 3; i++)
{
textBoxes.push("textBox" + i);
n = i-1;
textBoxes[n].text = winnerText;
}
PLEASE HELP - URGENT Load Random Swfs From Individual Random Sets
I have two target mcs I would like to load different random swfs into
I have eight folders (a-h), each with 12 swfs (001-012)
I need to load a random swf (001-012) from a random folder (a-h) into the "card1" mc
I have figured out how to specify which one I want:
loadMovie("a/a001.swf","card1")
stop();
however, I need it randomized....
then, I need to load another random swf into my "card2" mc (001-012) from another random folder (a-h, ...except for the folder from which the first swf was loaded)
can somebody please help??????
Load Random Swfs From Two Differnet Random Sources
I am in the process of creating a VS Card game in Flash. It is basically a game where you can choose either one card or another, each randomly pulled from one of the eight different sets. The first card (or swf) can be pulled from any of the 8 sets (out of a total of 12 cards in each set))..and will load into a targetMC, and the second must be pulled randomly from any of the 8 sets except from the folder where the first card was chosen and load onto the second targetMC.
after the winning card is chosen, it will display winning animation (and send data off to a dynamic bargraph program), and then the main movie will reload two random cards from differnt sets.
can anybody help me on how to set this up??
Load A Flash Movie To A Random Frame Each Load
I have created a flash file that fades from one picture to the next. However, I would like to find an actionscipt that will allow the flash movie to load to different each time the page is visited/refreshed. That way visitors don't have to see the same image each time the visit the my page, but can still sit and watch all of them if they want. Also I would want to be able to specify which frames are available for load. That way the page will always load at the begining of each image animation... not right in the middle of it switching to the next image.
Any help is greatly appreciated!
Load A Flash Movie To Specified Random Frames Each Load
Group:
I am trying to find a Actionscript where I can specify random frames and have the movie randomly load to the specified frames each time the page is viewed. The below scrip was given last time I posted this question, but it doesn't seem to load at the specified frames. Sometimes it does, sometimes it load right in the middle of an animation. You can see in the code below I would like the movie to load at frames 1, 116, 231, 346. Any suggestions?
_____________________________________________________
Array.prototype.shuffle = function() {
for (var ivar = this.length-1; ivar>=0; ivar--) {
var p = random(ivar+1);
var t = this[ivar];
this[ivar] = this[p];
this[p] = t;
}
};
ASSetPropFlags(Array.prototype, ["shuffle"], 1, 1);
var Array_ar:Array = new Array(1, 116, 231, 346);
Array_ar.shuffle();
index = 0;
function load_random() {
gotoAndPlay(Array_ar[index++]);
if (index == Array_ar.length) {
(index=0);
}
}
load_random();
Random Quotes ERROR HELP
Hey ya'all,
I've got a dynamic text field, a txt-file (variables in txt file are readable in flash) and a flash movie.
On the first frame (where dynamic text field is, too) I would enter the following AC:
loadVariablesNum ("myfile.txt", 0)
newquote = random(47);
_root.dyntxtvarname = eval("q" +newquote);
I also have a button lying on the stage.
The problem: the quotes won't show up until I press the buttong to which I assigned
on(release){
newquote = random(47);
_root.dyntxtvarname = eval("q" +newquote);
}
although I have placed the "newquote = ..." in the first frame of the movie, too!
How is it done right?!?!
Hope you can help me!
Thanx
Lenny.
[Edited by Zacky2001 on 10-14-2001 at 06:07 PM]
Random Script Error.
Can anyone please help with the following.
Im looking for a script that randomly loads SWF movies into itself.
I have found one at Flashkit and dowloaded a movie called "random movie generator" by Albert C (can be found here: http://www.flashkit.com/movies/Scrip...6100/index.php )
This is exactly what im looking for, except that i get errors reported when i export it in FLASH MX.
I appreciate that this is someone elses work, but if someone could take a look at it for me and let me know how to fix it, that would be greatly appreciated. Or if there is a better way of doing this, please let me know. Im new to Flash scripting and this doesnt make sense to me.
The errors reported are:
Scene=Scene 1, Layer=SCRIPT, Frame=2: Line 16: Left side of assignment operator must be variable or property.
eval("randommovie"+counter1) = random(numberrange); //sets a new variable and generates a random number
Scene=Scene 1, Layer=SCRIPT, Frame=2: Line 20: Left side of assignment operator must be variable or property.
eval("randommovie"+counter1) = random(numberrange);
Scene=Scene 1, Layer=SCRIPT, Frame=2: Line 31: Left side of assignment operator must be variable or property.
eval("randommovie"+counter1) = random numberrange); //changes value until no duplicates
Hope that makes sense to someone. Thanks for looking.
BM
Random Movement Error
The acceleation cannot be set to more than 10. If it is the fish will get "stuck" eventually. Thanks for your help in advance ^^
Random Error 1026?
I am new to as3, and my first project has hit a wall. I keep getting error 1026 for what seems like no reason... my constructor is not static... I have searched everywhere and cannot find a solution for why this is happening...
it gives me the error for line 1...
Code:
package{
//imports
import flash.display.MovieClip;
import flash.events.Event;
public class docMain extends MovieClip{
public var myload:loadingScreen;
//Constructor
public function docMain():void
{
//add loading screen here and add to stage
myload = new loadingScreen();
stage.addChild(myload);
//add preload progress bar updater to be run every frame.
addEventListener(Event.ENTER_FRAME, updateProgress);
}
//This function checks how much is loaded and updates the
// progress bar accordingly. I use Enter_frame because I
// have heard progress events and complete events have
// issues on some browsers sometimes...
public function updateProgress(e:Event)
{
//variables for loaded info
var loaded:Number = stage.loaderInfo.bytesLoaded;
var total:Number = stage.loaderInfo.bytesTotal;
var percent:Number = loaded/total;
if(loaded<total)
{
//change loading screen to reflect progress here
var frame:int = percent*200;
myload.setFrame(frame);
}
else
{
//remove progress bar updater from functions to run every frame.
removeEventListener(Event.ENTER_FRAME, updateProgress);
//add game object and remove loading screen from stage here
stage.removeChild(myload);
var game:gameManager = new gameManager();
}
}
}//end docMain Class
}//end package
Random Error #1009
Hi,
I'm new in AS3, and in my first project I'd like to display playing cards on the canvas dynamically. I've managed to do that but a completely random "Error #1009: Cannot access a property or method of a null object reference" just pops up and drives me mad !
Here's a snippet of the code incriminated :
ActionScript Code:
var cardMC:MovieClip;
switch (value) {
case "H2" :
cardMC = new H2();
break;
case "H3" :
cardMC = new H3();
break;
case "H4" :
cardMC = new H4();
break;
case "H5" :
cardMC = new H5();
break;
....
default:
}
cardMC.x = 15+(5*index)+(index*50);
cardMC.y = 15;
cardMC.addEventListener(MouseEvent.CLICK, clicCarteGest);
nameCartes[index] = cardMC.name;
addChild(cardMC);
index is an int value, set before this code. nameCartes is an array containing the names of the cards instances so i can remove them after with a removeChildByName.
H2, H3... are movie clips in the library.
The switch is much longer, in fact it tests for the 52 possible cards values...
What's really weird is that this portion of code works well most of the time but, if I put it in a lengthy "for" loop (like 100 iterations), the #1009 error pops up at a random moments (it could be at the first iteration as well as the 50th).
If anyone can point me to a potential error in this code...
Thanks !
[AS] Error With Random 1-10 List
Half the time this script works, half the time I get a "a script is causing your computer blah blag" doesnt work code.... I just want to make a string with all the questions that have been used already to make sure no questions are asked again. It's a simple script, and when it works, it works well enough for what I'm going to do with it. Here is the code in question :
Code:
on(press){
while(_root.totalQuestions<10){
randomQuestion = "question"+Math.floor(Math.random()*10+1);
if(_root.numbersUsed.indexOf(randomQuestion) == -1){
_root.numbersUsed+=(randomQuestion);
_root.totalQuestions++;
}
}
trace(numbersUsed);
}
The way its supposed to work is give me a string similiar to this under variable numbersUsed:
question6question4question3question7question1question8question9question10question5question2
for testing purposes right now of course
The future implementation is in the form of a small quiz applet driven by a database of questions. The problem here is that I'm developing this little app to be as simple as possible, so each question will be loaded individualy at random as each previous question is answered for a given number of questions (say, a quiz of 50 questions). Where the problem comes in is that my professor wants it to be very easily updateable and expandable. He is completely computer illiterate, and the only thing I can assume he knows how to do is edit a .txt file (this is at his request). So each question will be stored in the form of an individual text file. A series of random questions from that database of individual text files will be loaded after one another, and then the rest, like scoring and all that great stuff, will be handled by flash and most likely PHP. Anyone have any ideas why this little thing is crashing a certain percentage of the time? or have any other ideas that might dwarf mine with simplicity?
Wierd Random Display Error In IE
Hello,
Real freaky problem here. I have this interactive map that plays a intro video after it loads then displays a map graphic. For some reason in IE 7 every couple of times after the video plays the graphic loaded is just gray. Here is a link:
http://www.washingtonpost.com/wp-srv/specials/wp/teenshopping/map.htm
I cannot figure out why this is happening as far as I can tell it's not failing to load the image or it would be white not gray. And why is this happening randomly should I space something out has any one seen this before?
Jesse
Error With Random Learning Quiz Interactions.
I have a problem. I have used the learning interactions with MX before. However when I turn on the randomize option, the choices do not fill in the label box on the multiply choice screens. I have 18 questions. I am willing to send the fla file to anyone that is willing to take a look at it. I have redone the file twice and still the same result. I have checked and rechecked the labels to make sure they are correct.
I looks like the variables are getting confuzed. You can email me at the below address and I will send the file.
ebrennan@rgis.com
Eric Brennan
Random Guessing Game - Actionscript Error
Hi, im new to these forums. I'm making a guessing game - when you press one of three buttons, this script executes:
code:
on (release)
{
_root.win=0;
_root.win=random(2);
if (_root.win=0);
{ gotoAndStop(3); } //Lose
if (_root.win=1);
{ gotoAndStop(4); } //Win
}
The problem is that the player always wins. Where is the error?
Flash Quiz Template - Random Error
Hi all,
Need help, created several quizzes and I've noticed a bug when I randomize the quiz. I know its using an array and I can see the randomize code and it looks fine. I've also seen other users reporting this on actionscript.org, and macromedias forums, with no answers, thought I'd try here!!
What's happening is (online and running it offline) when you make the quiz random, the placeholder (checkbox) is displayed rather than the distractor label. Happens in various places within the quiz when I've tried it, on different questions too. Sometimes it'll work okay?
I've even tried macromedia's template without making any edits, if I randomize it, the bug happens with their "out of the box" version!
Offline I can generate a debug, but I can't figure it out, here's a sample (thanks btw!):
This is a sample of the variables debug:
Variable _level0.focusManager.bDrawFocus = false
Variable _level0.focusManager.bNeedFocus = false
Variable _level0.focusManager.lastFocus = [movieclip:_level0.Template_ControlButton]
Variable _level0.focusManager.lastSelFocus = [movieclip:_level0.Template_ControlButton]
Variable _level0.focusManager.textAlign = [getter/setter] undefined
Variable _level0.focusManager.fontWeight = [getter/setter] undefined
Variable _level0.focusManager.fontFamily = [getter/setter] undefined
Variable _level0.focusManager.textIndent = [getter/setter] undefined
Variable _level0.focusManager.fontStyle = [getter/setter] undefined
Variable _level0.focusManager.marginLeft = [getter/setter] undefined
Variable _level0.focusManager.marginRight = [getter/setter] undefined
Variable _level0.focusManager.fontSize = [getter/setter] undefined
Variable _level0.focusManager.textDecoration = [getter/setter] undefined
Variable _level0.focusManager.embedFonts = [getter/setter] undefined
Button: Target="_level0.focusManager.tabCapture"
Variable _level0.focusManager.tabCapture.tabIndex = [getter/setter] 0
Movie Clip: Target="_level0.focusManager.instance4"
Movie Clip: Target="_level0.reserved"
This is the objects:
Edit Text: Target="_level0.Template_Question" Variable= Visible=true Text = True or False: Personal protective equipment is used to limit exposure to hazard
ous chemicals when engineering controls and good work practices cannot keep it l
ow enough. "
Movie Clip: Frame=1 Target="_level0.Template_ControlButton"
Movie Clip: Frame=1 Target="_level0.Template_ControlButton.boundingBox _mc"
Shape:
Movie Clip: Frame=1 Target="_level0.Template_ControlButton.fus"
Movie Clip: Frame=1 Target="_level0.Template_ControlButton.fds"
Movie Clip: Frame=1 Target="_level0.Template_ControlButton.frs"
Movie Clip: Frame=1 Target="_level0.Template_ControlButton.dfs"
Movie Clip: Frame=1 Target="_level0.Template_ControlButton.hitArea_mc"
Edit Text: Target="_level0.Template_ControlButton.labelPath" Variable= Visible=true Text = Check Answer"
Movie Clip: Frame=1 Target="_level0.instance272"
Movie Clip: Frame=1 Target="_level0.instance272.instance273"
Movie Clip: Frame=1 Target="_level0.instance272.instance273.instance27 4"
Shape:
Text:
Text:
Text:
Text:
Text:
Text:
Text:
Movie Clip: Frame=1 Target="_level0.instance272.instance275" Label="Symbol_36"
Edit Text: Target="_level0.Template_Feedback" Variable= Visible=true Text = Click on a Radio Button."
Text:
Movie Clip: Frame=1 Target="_level0.help"
Movie Clip: Frame=1 Target="_level0.focusManager"
Button: Target="_level0.focusManager.tabCapture"
Shape:
Movie Clip: Frame=1 Target="_level0.focusManager.instance4"
Movie Clip: Frame=0 Target="_level0.reserved"
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
Random External Text File Error?
I have a script that loads a random image/jpg file as well as the correlating text file with info in it. The script looks at another text file to get the "max random" number and then randomizes the number of the photo/info file. The random image loading works great, but I can't get the text file to load. What is wrong with this 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 = random (myArray.length);
// load the image.
loadVariables("info/" + myArray[randNumber] + ".txt", 0);
imageHolder.loadMovie("backgrounds/" + myArray[randNumber] + ".jpg");
} else {
trace("not loaded");
}
};
____________________________
I have a folder named "info" that has two text files in it (photo1.txt and photo2.txt). I have a dynamic text field on the stage of the movie with a value of "info" in the var: box. The contents of the text files look like this:
&info=Author: first name/n
Title: Rust Sample/n
Time: 4:45pm/n
Date: 01/04/04/n
- Why would this not be working?
Thanks,
-- K
Random External Text File Error
I have a script that loads a random image/jpg file as well as the correlating text file with info in it. The script looks at another text file to get the "max random" number and then randomizes the number of the photo/info file. The random image loading works great, but I can't get the text file to load. What is wrong with this 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 = random (myArray.length);
// load the image.
loadVariables("info/" + myArray[randNumber] + ".txt", 0);
imageHolder.loadMovie("backgrounds/" + myArray[randNumber] + ".jpg");
} else {
trace("not loaded");
}
};
____________________________
I have a folder named "info" that has two text files in it (photo1.txt and photo2.txt). I have a dynamic text field on the stage of the movie with a value of "info" in the var: box. The contents of the text files look like this:
&info=Author: first name/n
Title: Rust Sample/n
Time: 4:45pm/n
Date: 01/04/04/n
- Why would this not be working?
Thanks,
-- K
Random Frame Selection Syntax Error
var frameArray:Array = new Array(23, 1, 34, 18, 27, 31, 42);
function randFrame():Void{
var whereFrame:Number = Math.floor(Math.random()*frameArray.length
)
_root.gotoAndStop(frameArray[whereFrame]);
frameArray.splice(whereFrame, 1);
(There is a syntax error in this script. What is the error?)
Random Error In Learning Quiz Interactions
Using the Flash MX Quiz template. Quiz works fine until I try to use the randomize feature. Then after several questions the interaction doesn't display the question just the "checkbox" or "radio" placeholder.
Tried it using the default macromedia questions and then randomized several and replicated the problem. Anyone found a fix for this. Its component based and should be bug free as its part of the Macromedia application??
Thanks
Mark
Random Error: Code Executes Too Early
Ok, I have this simple loader on frame 1 with the following code:
PHP Code:
onClipEvent(enterFrame)
{
total_bytes = _root.getBytesTotal();
loaded_bytes = _root.getBytesLoaded();
remaining_bytes = total_bytes-loaded_bytes;
percent_done = Math.round((loaded_bytes/total_bytes)*100);
this.bar._xscale = percent_done;
if (percent_done == 100)
{
_root.gotoAndStop(5);
this.onEnterFrame = undefined;
}
else
{
_root.gotoAndPlay(1);
}
}
and on frame 5 is where i have some linkage objects exported for actionscript and in the timeline i have the following include:
PHP Code:
#include "as_main.as"
but sometimes the code from "as_main.as" gets executed at around "80% loaded" and the debug window pops up complaining about missing objects. And yes they are missing because frame 5 hasn't been loaded completely yet.
Does anybody know why this is happening about 4 out of 5 times?
//Summer
Actionscript Math.random Error. (Car Game)
Hi I've been following this tutorial http://www.maxpc.co.uk/tutorials/default.asp?pagetypeid=2&articleid=31156&subsectionid=706&subsubsectionid=524
and ended up with this: http://web10.000025.net/~crystalt/Latest.fla
I think the problem lies in:
"tire._Y = Math.randomBetween (100,300);"
Ive been told to replace it with this
"tire._Y = Math.random ()*200+100;"
I get no syntax errors with the second one but the oil and tire obstructions don't seem to move accross the screen.
I'd be very grateful if anyone could help me with this.
Below is the actionscript and also above is Link to the .fla
listener = new Object();
listener.onKeyDown = function()
{
delete Car.onEnterFrame;
var yval = 0;
var xval = 0;
switch (Key.getCode())
{
case Key.DOWN: yval = 8;
Car.rotate(15,30); break;
case Key.UP: yval = -8;
Car.rotate(-15,30); break;
case Key.LEFT: xval = -8;
break;
case Key.RIGHT: xval = 8;
}
Car.onEnterFrame = function ()
{
this._y += yval;
this._x += xval;
}
};
listener.onKeyUp = function()
{
Car.rotate(0,30);
delete Car.onEnterFrame;
};
Key.addListener(listener);
interval = setInterval(Obstacles,1500);
_root.i = 200;
Car._depth = 400000
function obstacles()
{
duplicateMovieClip("obstacles.tires","tires"+_root.i,40000 -i);
var tire = eval("obstacles.tires"+_root.i);
tire._Y = Math.randomBetween (100,300); <-------here's first problem
tire._rotationBetween(0,360);
tire.Move(-1000,tire._Y,250);
duplicateMovieClip("obstacles.oil","oil"+_root.i,i);
var oilslick = eval("obstacles.oil"+_root.i);
oilslick._Y = Math.randomBetween(100,300); <------here's second problem
oilslick._rotation = Math.randomBetween(0,360); <------here's third problem
oilslick.Move(-1000,oilslick._y, 250);
tire.onEnterFrame = oilslick.onEnterFrame = function()
{
if (this.hitTest(Car))
delete this.onEnterFrame;
this.removeFlicker(10);
_root.collisions ++;
}
}
tire.onComplete = oilslick. onComplete = function()
{
this.removeMovieClip();
}
_root.i++;
Load Random Mc.. Wait.. Then Load Following Mc
Last edited by [X]Silver : 2005-03-30 at 00:50.
Is this possible?
I'm doing a flash site, that loads a random movie at startup;
ActionScript Code:
filename = ["test_0.swf", "test_1.swf",
"test_2.swf", "test_3.swf", "test_4.swf"];
path = "mc/";
i = filename.length;
k = Math.floor(Math.random()*i);
loadMovie(path+filename[k], movieTarget);
Is it then possible to assign a linked movie to each of the randomly loaded movies, and have it load after a 4 second wait?
Page loads -> random movie -> 4 sec wait -> Random movie unloads and is replaced by the movie in same category (linked)
Does this make sense?
Hope someone can help me...
thanks
Error With Load Txt
I try this code to load a txt file
loadVariablesNum("eventos.txt", 0);
but when i run the swf, it show me this menssage,
_level1.text
how?
XML Load Error
Hi all
Is there a way to tell if a xml file hasn’t loaded or there has been a server error loading the file. I know about the onLoad function is there a sort of !onLoad..
I was thinking I could use a timeout but this isn't reliable as of users different connection speeds and time required to load the file..
Any thoughts ?
shef
CSS Doesnt Appear To Load But No Error Msg
Hi,
Im trying to adapt a tutorial for using css layouts for text in flash. The tutorial is:
http://www.actionscript.org/tutorial...sh/index.shtml
if i complete the tutorial with a new fla and follow instructions excatly it works fine, but i cant seem to apply it to my own project. My project consists of a main swf that loads other swfs on top, containing various graphics and text. www.dancingturtle.co.uk, is the site.
My swfs contatining the textboxes consist of multiple timelines, naturally, so i think i should paste the css actionscript on the first frame of the timeline that the dynamic text box is on like so:
//Create a new style sheet object
var myCSS = new TextField.StyleSheet();
//Specify the location of the CSS file that you created earlier
var cssURL = "example.css";
//Hard code some HTML text to display (for example purposes)
exampleText = "<p class='headline'>Tutorial Takes Forever To Write</p>";
exampleText += "<p><span class='byline'>Bath, UK</span>";
exampleText += "--Flash developer NWebb seemed to take ";
exampleText += "forever to finish his CSS-Flash tutorial, ";
exampleText += "but it is finished now and you can find it ";
exampleText += "<a href='http://www.nwebb.co.uk'>here</a> ";
exampleText += "along with a few others.</p>";
//Load CSS file
myCSS.load(cssURL);
//define onLoad handler
myCSS.onLoad = function(success) {
if (success) {
/* If the style sheet loaded without error,
assign it to the text object, and assign the HTML text to the
text field*/
myText.styleSheet = myCSS;
myText.text = exampleText; //this should be ".htmlText",
// but Flash seems to recognise that the textbox needs to display html anyway
}
};
I have named the dynamic text box myText and set render to html. And i have the css file in the same directory.
But when i test the movie nothing happens, no error in the output box and no text is loaded. I cant understand why this is.
Can anyone suggest anything i might be doing wrong. Maybe there are some pre-conditions for using the css im forgetting?
Load Movie Error
Hi Guys,
I'm trying to use actionscript to load an MP3 file for a simple sound bar button. Using Flash 8 on MAC OS X
Using the actionscript:
on (release) {
loadMovie ("/Users/matt/Documents/FLASH/Music/LogDrumThing.mp3", this);
}
But it's not working and I keep getting this:-
Error opening URL "file:///Users/matt/Documents/FLASH/Music/LogDrumThing.mp3"
Any ideas
Much thanks
MG
Scrollpane MC Load Error
Hi all,
So I've got various scrollpanes on different frames of my main clip. On the parameters tab of the scollpane's properties I can set the contentPath to the movieclip name I want loaded in the scrollpane (I have my movieclips loaded into the Library).
All well and good. Except for half the time I get a URL error at runtime:
Error opening URL "file:///C|/Documents%20and%20Settings/----/Desktop/Projects/-----/edit04a"
I don't understand why I should be getting this error message? The MC is loaded into the Library, it shouldn't be looking for file in windows file tree?
Once the MC loads ok once it always loads fine. It's just that I have to create and recreate the MC and scrollpane a half dozen times before it finally "sticks" and flash decides to load it at run time.
I can find no pattern as to what causes the error and what causes success. Sometimes I create the MC first, sometimes I create the scollpane first. Sometimes I leave the MC in the root Library folder, sometimes I sort it to where it belongs. Sometimes I just convert to a MC symbol, sometimes I also select to export for Actionscript.
Overall, this is very, very annoying. I spend more time creating and recreating MCs and scollpanes than I do making forward progression on my application. Any help would be greatly appriciated.
--Ouka
Error: Can Not Load AS2-classes
I got a strange error with Flash8 / AS2 on Macintosh and need your help:
I had an Flash-application which I had to refactor. Doing that I created a new fla-file and copied some symbols from the library of the original fla to the library of the new one. I also edited some of these symbols inside the new fla. Besides that, most of the as2-classes were replaced in the new project by new ones. Especially the as2-classes that are linked to the fla-symbols are new ones!
All this worked pretty well first. Then I deleted the old project and it started to behave weird:
On Windows-machines (with Flash8) everything still worked fine. But on Macintosh (Flash8 / FlashCS3) the new fla didn't find its linked classes anymore! (error-message: "The class or interface 'xxx' could not be loaded").
I checked the path-variables and I figured out that the new fla only runs if a path-variable links to the old project!
Then I created a entirely new fla with new symbols (in the new project). I linked the symbols to the as2-classes (from new project). It didn't work! (same error)
Then I linked the old project and began to delete file after file in there. Finally the fla (in the new project) ran with only some empty directories of the old project linked (with no content!!). I could even rename these directories and it worked, but when I deleted them, the error occurred again.
Has anyone any idea what problem I got here?
NOTE: I developed the fla on a Macintosh with FlashCS3 but saved it as Flash8.
CS4 Component Load Error
Everytime I try to open up the component panel I get 4-5 error loading
messages and then it boots up fine. anyone else?
Error Failed To Load FLV
when working with actionscript 3.0 i try to drag and drop a Flv file that i created with the adobe flash media encoder, to the stage, and setting the source as rtmp://localhost/vod/YourFLVName i get the error failed to load FLV: rtmp://localhost/vod/yourflvname when i try it with the sample file in the the vod folder ex "rtmp://localhost/vod/sample" it works. this leads me to beleave that the flv file i am creating is not encoded correctly. or i could be way off since i am very new to this.
any thoghts on this would be great
thanx in advance
bman
Load Sound Error
Hi for all. I have a seriour problem with my new application. I am using AS3 and AIR. It's a web radio. When the music end, I load the next music of playlist. The error is. Sometimes he load the file and sometimes he crashes and does not load the next music without any error. How can I resolve that?
MovieClipLoader On Load Error
Dear reader,
I have only Flash Player 6. I am try to loading the jpeg image on movie clip. if there is no jpeg file in the folder.
I want catch up the error msg
Tip: In flash player 7 with Actionscript 2.0 have in "MovieClipLoader.onLoadError". method. I need any other equavalent method in Actionscript 1.0...
please help me.
Thanks
Flash groups
Load Variables Error
I'm getting an error in my flash file so, please help me.
I've photographer.fla file. In this file i got an below error.
**Error** Scene=Scene 1, layer=act, frame=2:Line 2: Type mismatch.
_root.loadVariables("text.html", 0, "POST");
Total ActionScript Errors: 1 Reported Errors: 1
now text.html is a html file(i've my bio-data mean it's a html file but i can change it thru click on right mouse button and open it in notepad). Basically i'm getting above error when i'm try to make a .swf file or html file.
So, how i can solved this error? and yes, i'm using flash 8.0
thank you
Load Sound Error
Hi for all. I have a seriour problem with my new application. I am using AS3 and AIR. It's a web radio. When the music end, I load the next music of playlist. The error is. Sometimes he load the file and sometimes he crashes and does not load the next music without any error. How can I resolve that? The problem is related with the Cross Domain?
XML Load Image Error
I've a gallery that contains images (in the same directory as the .fla and the imagesBW.xml called in the loadXML.
Getting error that can't find 0.jpg
Have looked for hours and I'm not sure where I've screwed up. Perhaps in calling the images for the thumbnails and the fullsize somewhere.
The AS is here:
CODE#include "DrawBox.as"
#include "lmc_tween_as1.as"
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
thumbnails = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
thumbnails[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("imagesBW.xml");
currentHolder = 0;
theDepth = 1000;
gap = 10;
_global.imageLoaded = false;
_global.imageFaded = false;
_global.selectedImage = 0;
this.createEmptyMovieClip("thumb_mc", theDepth++ + 10000);
this.createEmptyMovieClip("img0_mc", theDepth++ + 10000);
this.createEmptyMovieClip("img1_mc", theDepth++ + 10000);
this.attachMovie("FScrollPaneSymbol", "thumb_sp", 1000, {_x:35, _y:this.border_mc._y});
this.thumb_sp.setSize(100 * 2 + gap * 2 + 16 - 5, 308);
this.thumb_sp.boundingBox_mc._alpha = 0;
this.thumb_sp.setStyleProperty("arrow", 0xffffff);
this.thumb_sp.setStyleProperty("scrollTrack", 0x000000);
this.thumb_sp.setStyleProperty("face", 0x000000);
/////////////////////////////////////
previous_btn.onRelease = function() {
prevImage();
};
next_btn.onRelease = function() {
nextImage();
};
/////////////////////////////////////
p = 0;
this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (picture._alpha<100) {
picture._alpha += 10;
}
}
};
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}
}
function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
picture_num();
}
}
function thumbnailLoad() {
this.thumb_mc.createEmptyMovieClip("thumb" + i + "_mc", theDepth++);
this.thumb_mc.createEmptyMovieClip("thumb" + i + "_tmp_mc", theDepth++);
this.thumb_mc["thumb" + i + "_mc"]._x = ((i % 2) * (100 + gap));
this.thumb_mc["thumb" + i + "_mc"]._y = Math.floor(i / 2) * (100 + gap);
this.thumb_mc["thumb" + i + "_mc"].loadMovie(_global.sectionPath + thumbnails[i]);
this.thumb_mc["thumb" + i + "_tmp_mc"].no = i;
this.thumb_mc["thumb" + i + "_tmp_mc"].onEnterFrame = function()
{
var _mc = this._parent["thumb" + this.no + "_mc"];
var l = _mc.getBytesLoaded();
var t = _mc.getBytesTotal();
if ((l >= t) && (t > 20) && (_mc._width > 1))
{
_mc.num = this.no;
_mc._alpha = 50;
_mc.onPress = function()
{
if ((_global.selectedImage != this.num) && (_global.imageLoaded) && (_global.imageFaded))
{
loadImage(this.num);
}
}
_mc.onRollOver = function()
{
this.alphaTo(100, 0.5, "easeOutQuad");
}
_mc.onRollOut = function()
{
this.alphaTo(50, 0.25, "easeOutQuad");
this.line_mc.removeMovieClip();
}
this._parent._parent.thumb_sp.setScrollContent(this._parent);
this._parent._parent.thumb_sp.refreshPane();
delete this.onEnterFrame;
this.removeMovieClip();
}
}
}
function loadImage(num)
{
_global.imageLoaded = false;
_global.imageFaded = false;
this.createEmptyMovieClip("img0_tmp_mc", theDepth++);
this.createEmptyMovieClip("img1_tmp_mc", theDepth++);
this["img" + currentHolder + "_mc"].removeMovieClip();
this.createEmptyMovieClip(["img" + currentHolder + "_mc"], theDepth++ + 10000);
this["img" + currentHolder + "_mc"]._x = 245;
this["img" + currentHolder + "_mc"]._y = 10;
this["img" + currentHolder + "_mc"].loadMovie(_global.sectionPath + image[num]);
this["img" + currentHolder + "_tmp_mc"].onEnterFrame = function()
{
var _mc = this._parent["img" + currentHolder + "_mc"];
var l = _mc.getBytesLoaded();
var t = _mc.getBytesTotal();
if ((l >= t) && (t > 20) && (_mc._width > 1))
{
var _w = _mc._width;
var _h = _mc._height;
var _b_mc = this._parent.border_mc;
var maxW = _b_mc._width;
var maxH = _b_mc._height;
var scaleX = scaleY = scaleFactor = 100;
if (_w > maxW)
{
scaleX = maxW / _w * 100;
}
if (_h > maxH)
{
scaleY = maxH / _h * 100;
}
scaleFactor = Math.min(scaleX, scaleY);
_mc._alpha = 1;
_mc._xscale = _mc._yscale = scaleFactor;
_mc._x = _b_mc._x + Math.floor((maxW - _mc._width) / 2);
_mc._y = _b_mc._y + Math.floor((maxH - _mc._height) / 2);
_global.imageLoaded = true;
_global.selectedImage = num;
delete this.onEnterFrame;
this.removeMovieClip();
}
}
this["img" + ((currentHolder + 1) % 2) + "_tmp_mc"].onEnterFrame = function()
{
if (_global.imageLoaded)
{
var _mc1 = this._parent["img" + currentHolder + "_mc"];
var _mc2 = this._parent["img" + ((currentHolder + 1) % 2) + "_mc"];
if (_mc1._alpha < 100)
{
_mc1._alpha += 5;
_mc2._alpha -= 10;
}
else
{
_mc1._alpha = 100;
_mc2._alpha = 0;
currentHolder = (currentHolder + 1) % 2;
_global.imageFaded = true;
delete this.onEnterFrame;
this.removeMovieClip();
}
}
}
}
loadImage(_global.selectedImage);
Flvplayback Load Error
Last edited by circa__1983 : 2008-07-08 at 16:04.
Hi sorry am still quite new to all of this.
I am using an instance of the FLVplayback component with the instance name of movPlayer, the movie it is set to play is quite large and I only want to load it once it is needed (I have also set the movie to download entirely before it can be played). To do this I have created a function called loadTrigger:
Here is my code:
Code:
function loadTrigger():void {
movPlayer.autoPlay = false;
movPlayer.source = "media/movie1.mov.flv";
movPlayer.load(movPlayer.source);
movPreview.movPreLoader.visible = true;
movPreview.movPreLoader.alpha = 1;
movPreview.movPreLoader.loaderAnim.play();
//MOVIE PLAYBACK
movPreview.movPlayBtn.addEventListener(MouseEvent.CLICK, playMovie);
movPlayer.addEventListener(VideoEvent.PLAYING_STATE_ENTERED, hideMovPreview);
movPlayer.addEventListener(VideoEvent.COMPLETE, showMovPreview);
//MOVIE LOAD
movPlayer.addEventListener(ProgressEvent.PROGRESS, progressHandler);
movPlayer.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
trace("movie1 Load Trigger OK!");
}
This generates the following error:
VideoError: 1000: Unable to make connection to server or to find FLV on server
This is the section of code I am having trouble with:
movPlayer.source = "media/movie1.mov.flv";
movPlayer.load(movPlayer.source);
I know the movie file is definitely there, if I set the FLVplayback component to autoload, then everything works fine. But as I said I only want to load the movie when and if it is required due to it's size.
Any help with this code would be great, thank you for your time.
Detect Load Error
I have a script that loads movies/ jpegs that i created and i have one major bug...
how do you know if a file is not found at the requested URL? is there a way to test for that error message you get in the output panel inside flash?
thanks!
Load Variables - 403 Forbiddden Error?
Hi,
I have a movie that includes the loadvariable statement to load variables from an ASP page.
When I view the movie online I get a popup box with the 403 Forbidden error??
Does any one know what I need to do to fix this?? & why is it happening??
Cheers
Dave
Any Suggestions? Data Load Error
Hi,
Ok i have data coming in from an asp page, using load vars. works fine, but what if upon insert, that data was corrupted in the database and so fails to load again, currently it hangs on the loading data screen. Any Suggestions. As to solutions.
Many Thanks.
FlashMX
Load Movie Error Detection?
Load Movie in MX allows you to load .jpg files dynamically.
In test mode the output window will show you an error if the
file cannot be found.
Is there any way determine if there is a file error when not in
test mode? Is there something equivalent to the LoadVar if (success)?
thanks,
YJ
Painful Error. Pls Help Me Out~(Load Variables)
Dear all,
thanks for try to solve my question.
I have a task to make a flash movies that showing different numbers of balls by getting the results(list of numbers) from external file(txt file)
I am success to get everything right on my computer. However, whenever I put into the server. I found that the animation wont work if first time running. it's need the browser to run 1 time first...then the second time will display everything.
The first ball(there have 20 balls) wont show up at first time running the movie. But I replay the flash it's show will be shown. Seems like the time delay of reading script.View my movie u get more understand what i mean. When you see something not loaded. Please refresh again the flash. IT will appear. that's what my problems about.
animation is here
the actionscript are as follow:
frame 1:
value = 1;
trace(value);
frame 2:
loadnum.num=value;
//loadnum.num is a values inside loadnum movie clip where I try to put the numbers inside
loadnum.num=value;
value = loadnum.num;
resultnumber = eval("_root.b"+value+".num" +value)-1;
trace(resultnumber);
//by using eval function I can combines the target path and using the value(variables) to get different ball numbers from other movie clips
if(resultnumber != -1){
eval("_parent.bottomball.unit"+resultnumber)
getball=eval("_parent.bottomball.unit"+resultnumbe r);
trace(getball);
this.play();
}
else{
gotoAndPlay(1);
}
frame 61:
getball.gotoAndPlay("start");
//play the animation if i can get the number of the movie clip i wanna display.
thanks for helping me~
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
Load Text File Error
I have a script that loads a random image/jpg file as well as the correlating text file with info in it. The script looks at another text file to get the "max random" number and then randomizes the number of the photo/info file. The random image loading works great, but I can't get the text file to load. What is wrong with this 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 = random (myArray.length);
// load the image.
loadVariables("info/" + myArray[randNumber] + ".txt", 0);
imageHolder.loadMovie("backgrounds/" + myArray[randNumber] + ".jpg");
} else {
trace("not loaded");
}
};
____________________________
I have a folder named "info" that has two text files in it (photo1.txt and photo2.txt). I have a dynamic text field on the stage of the movie with a value of "info" in the var: box. The contents of the text files look like this:
&info=Author: first name/n
Title: Rust Sample/n
Time: 4:45pm/n
Date: 01/04/04/n
- Why would this not be working?
Thanks,
-- K
Valid URL -> Xml.load(URL) -> Error Opening URL
Hi all,
I am facing a pretty strange problem. Trying to get Flash 8 connected to a database I am adressing a php script which generates a xml string depending on the sql which is attached to the query.php.
If I open the URL in a browser everything works fine. To show an example:
Code:
sql = "SELECT fo_posts.ID, fo_posts.post_status FROM fo_posts"
xml result looks:
Code:
<?xml version="1.0" encoding="iso-8859-1"?>
<response>
<result><record>
<field name="ID">1</field>
<field name="post_status">publish</field>
</record>
<record>
<field name="ID">2</field>
<field name="post_status">static</field>
</record>
<record>
<field name="ID">3</field>
<field name="post_status">publish</field>
</record>
<record>
<field name="ID">4</field>
<field name="post_status">attachment</field>
</record>
<record>
<field name="ID">5</field>
<field name="post_status">publish</field>
</record>
</result></response>
But everything I get in Flash is:
Error opening URL "http://127.0.0.1/db-flash/
scripts/queryDB.php?sql=SELECT%20fo%5Fposts%2EID%2C%20fo%5 Fposts%2Epost%5Fstatus%20FROM%20fo%5Fposts"
I already searched the forum, tried to upload the stuff and change publish settings to "Access Network only" ... but I didn't work too
The strangest thing is that another project which was built on Flash MX 2004 works fine ... even if it's adressing the same localhost (just another database)
does anybody know how to solve this problem?
many thanks in advance
Break A For Loop On Load Error?
I'm having some trouble with the following code- the idea is that it keeps loading jpegs until it runs out of them, ie. a load error occurs. The loading sequence works fine if I manually set a limit on the loop (say 28 for 28 jpegs) but this is part of a website for a photographers' agency website, and each photographer will have a different number of pictures, so I want it to be as dynamic as possible.
So I'm trying to break the loop with a function that is triggered by a load error. The trigger itself works- I put a trace in to test it- the problem seems to be that I can't break the loop from within the function. If I try to set a variable in the function, it returns undefined if I refer to it from outside the function in the for loop...
Any help greatly appreciated!
here is the offending code:
Code:
function loadImages(artist, book, final) {
for (var j=1; j<final; j++) {
thumbNail.duplicateMovieClip("thumbNail_"+j, j);
tMCL.loadClip("../images/"+artist+"/thumbs/"+artist+"_"+book+"_"+j+".jpg", ["thumbNail_"+j].thumbHolder);//duplicates movie clip and loads thumbnail into it
tListener.onLoadError = function() {
trace("bollockit");
} // end function
} // end for
} //end function
Linkage Error - Can't Load A Class
Hi,
I would like you to give advice.
I made a movieclip symbol(journal) which calls the Journal class in a Flash Project File.
I wrote like this on the Linkage Properties window:
--------------------------------------------------------------------
Identifier: journal
AS 2.0 class: _journal.Journal
and checked two options(Export for AS and Export in first frame)
--------------------------------------------------------------------
I think the class route is correct. But when I test the project, it occurs an error ("Symbol = journal, layer = binding, frame = 1:Line 1: The class or interface '_journal.Journal' could not be loaded.")
I appreciate if you explain why it happens to me and what the 'binding' of a layer means.
Error #2044: Load Never Completed.
I've put together a preloader for a website I built but everytime I try to publish it, it works... but then if I simulate the download this error comes up:
Error #2044: Unhandled IOErrorEvent:. text=Error #2036: Load Never Completed.
I have a swf for the site... and then a swf for the preloader which will URL request the site swf... Here is the code I have on the preloader swf file:
var myRequest:URLRequest = new URLRequest("craft1.swf");
var myLoader:Loader = new Loader();
myLoader.load(myRequest);
myLoader.contentLoaderInfo.addEventListener(Event.OPEN,showPreloader);
myLoader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,showProgress);
myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,showContent);
var myPreloader:Preloader = new Preloader();
function showPreloader(event:Event):void {
addChild(myPreloader);
myPreloader.x = stage.stageWidth/2;
myPreloader.y = stage.stageHeight/2;
}
function showProgress(event:ProgressEvent):void {
var percentLoaded:Number = event.bytesLoaded/event.bytesTotal;
myPreloader.loading_txt.text = "Loading - " + Math.round(percentLoaded * 100) + "%";
myPreloader.bar_mc.width = 198 * percentLoaded;
}
function showContent(event:Event):void {
removeChild(myPreloader);
addChild(myLoader);
}
any help would be GREAT!
Thanks
Load Movie Error Detection?
Need to be able to detect if there was an error loading the movie.
In test mode the output window display an error if file not found.
How do you get this information when not in test mode?
Does if (success) work for load movie as it does for loadvar?
Thanks,
YJ
|