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




Grrr...Array Problems



I cant get these variables in myArray to save correctly and then recall. Can you guys see anything wrong with it? I have tried hardcoding in a variable out of the myArray into both functions (ie sharedObject.data.myVar = myVar and visa versa and it will save/recall fine. It is when I try to save/recall all the variables via an array that it will not save correctly. Any ideas?

Here is my code that uses the array's:

Code:
function saveMe() {
for (i=0; i < myArray.length; i++) {
sharedObject.data.myArray[ i ] = myArray[ i ];
}
}
function rememberMe() {
for (i=0; i < myArray.length; i++) {
if (sharedObject.data.myArray[ i ] != undefined) {
myArray[ i ] = sharedObject.data.myArray[ i ];
}
}
}
sorry, it read my code as some HTML script and I didnt catch it
[Edited by skierbit on 08-08-2002 at 08:10 PM]



FlashKit > Flash Help > Flash MX
Posted on: 08-08-2002, 05:09 PM


View Complete Forum Thread with Replies

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

Grrr
guys,

can somebody help me with this stupid things --> _droptarget which let us drag a mc and drop it to another mc, with a snap efx.... so the mc can't move


i hate simple things. they always drag my time.


ahmadzombie (duniableumberakhir.. jeng jeng jeng )

Grrr, Does It Never End?
well, i have been completely redoing my site in flash, so i thought i would add a custom game. Since it was my first game, i kept it simple and went off the tutorial that has multiple parts on building a game, located on this site. I got it to work, but when i try add in the action script that limits the number of shots at one time, the shooting aspects stops working. Anyone know what the problem may be? Thanks.

Grrr
i dont understand movie clip could someone please explain it to me

Preloaders Grrr
hello im doing a MM course we are in flash now and i get my breif tomorrow tutor has already say we need to have a preloader on our side he has told us to find out our self how to make a preloader so can anyon give me the eastest (kinda) . preloader one the looks good iv done a bit of action script if that helps

GRRR Is This A Bug In Flash?
Quote from Flash Help:

Example


The following example returns an array with five elements.

myString = "P, A, T, S, Y";
myString.split(",");



but when I copy the EXACT source code, run it, and do Debug->List Variables, it looks like this:

Level #0:
Variable _level0.$version = "WIN 6,0,21,0"
Variable _level0.myString = "P, A, T, S, Y"

Am I doing something wrong or is this a bug.

Thanks in advance for your help.

I'm using Flash MX (not 2004)

GRRR, LoadVariablesNum();
loadVariablesNum("urlhere","_self","GET");

Why wont that work? It gives me the following error :

**Error** Symbol=Tween 9, layer=Layer 1, frame=1:Line 1: Statement must appear within on handler
loadVariablesNum("urlhere","_blank","GET");

Total ActionScript Errors: 1 Reported Errors: 1


I replaced the actual URL just for the security of my site.

Grrr ... Classes
I have this class named NavMenu and a static public function named createDropDownMenus(). Inside this function is a for loop which calls the length of a public member array. If I call the length outside the scope of the for loop, it works. Inside the for loop, Flash thinks it's all-mighty and powerful, and does not work.

here is my code:


Code:
class NavMenu
{
// *
// * Static Member Variables
// *
public static var menu_items:Array = new Array();

// *
// * Static Member Functions
// *
public static function createDropDownMenus()
{
var menu_path = eval(NavMenu.menu_mc_path);

var num_menu_items:Number = NavMenu.menu_items.length;
var num_children = NavMenu.menu_items[1].child_name.length;
// --- ^ this line works, but i need to call all menu_items ******

for (var i = 0; i < num_menu_items; i++)
{
var num_children = NavMenu.menu_items[i].child_name.length;
// ***--- ^ this line does NOT work ******

if (NavMenu.menu_items[i].child_name.length > 0)
{
var drop_down_name:String = NavMenu.menu_items[i].parent_name;
var num_children:Number = NavMenu.menu_items[i].child_name.length;
var submenu_height:Number = 56 + ((num_children - 1) * 7) + (num_children * 7) + 9;
menu_path.createEmptyMovieClip("dd_" + drop_down_name, menu_path.getNextHighestDepth());
with (menu_path["dd_" + drop_down_name])
{
beginFill(0xE3E1CF, 100);
moveTo(0, 0);
lineTo(88, 0);
lineTo(88, 48);
lineTo(106, 48);
lineTo(106, submenu_height);
lineTo(0, submenu_height);
endFill();
}

menu_path["dd_" + drop_down_name]._x = start_x + (NavMenu.margin_x * 2) + 1;
}
}
}

// *
// * Public Member Variables
// *
public var parent_name:String;
public var child_name:Array;
public var child_url:Array;

// *
// * Private Member Functions
// *
private function NavMenu(parent_name:String, child_name:Array, child_url:Array)
{
this.parent_name = NavMenu.firstLetterToUpper(parent_name);
this.child_name = child_name;
this.child_url = child_url;
}
}



any help would be appreciated. thank you,

Buttons Grrr
You know, in some ways I'm a pretty bright guy, and in many others I'm an absolute idiot. So, I'm not sure if it's my idiotic side that is blocking me from this or not, but I can't find out how to make these dang buttons link to other pages in my website. Two days now, and the only thing I've learned is the definition of a "relative" and "absolute" link. It seems that either everybody but me already knows how to do this or there is a serious vacuum in this realm of the learning continuum.

What I want to do is very simple: All pages are designed and ready for publish; the only thing left is to program the buttons to link to their respective pages. Basically there are two things I want to know:

1) How do I set the buttons for a relative link on release?

2) How should I have my folders organized for this?

Hope some of you fine people can help me out.

Preloading...Grrr....
1. mcComicContainer on stage
2. mcComicContainer contains 8 movieclips called mcComicPanel1 to mcComicPanel8
3. mcComicPanel movieclips have a mcBackground movieclip that loads an external swf
4. mcComicPanel also includes a LOT of attachedMovie clips that are loaded externally via swfs

Question:

Is there a way that I can track the entire loading clips inside mcComicContainer and not display until all movies are loaded and display 1 preloader at the beginning of the application to track the progress?

Thanks for any help.

LoadMovie Grrr ...
I'm loading an external swf movie and try to control it. But it doesn't work because when I print the code the movie isn't fully loaded. So I need something very simple to get the next thing working :

ActionScript Code:
bottom.loadMovie("bottom.swf");
bottom._visible = true;
trace(bottom.zoomout._height);

He keeps tracing undefined. When I put it in an onEnterFrame it works :

ActionScript Code:
bottom.loadMovie("bottom.swf");
bottom._visible = true;
onEnterFrame= function(){
    trace(bottom.zoomout._height);
}

After 2 undefined he gives the correct height. But isn't there a better way to do this? I read something about moviecliploader but how can that help me.

Thanks a lot.

Grrr.......masking Problems
I wonder if someone would be so kind as to help me out with my little problem. I want to mask 2 graphic symbols, easy enough right. So I make one symbol, an icon with 3 circle's of various size and a letter in the middle, and I make a second graphic which is just the rectangle with a gradient to give that highlight thing. So I have the icon graphic on one layer and the rectangle on another layer. the icon is on top of the rectangle, so when I select mask, the only part of the icon that shows up is the middle circle out of the three. The other two and the letter have disappeared. Why does that happen? Did that make any sense?

Grrr......Button Problem
I just recently bought macromedia Flash 5,and i've started making an animtion, i've made a button to view the rest of the animation, but when i go to give it an action in the button timeline, all the actions selections are greyed out!!
i can't select them!! HELP! Is their an option thats marked that doesn't allow actions or sumthing?? i really need help with this one guys.
thanks alot!

Why Wont This Work Grrr
Why won't this work? It is supposed to make a list of textual info, but it won't work! OH GOD WHY! WAAAH!

Quote:






//Variables
anArray = new Array();
var horizPosition = 10;

for (i=0; i<10; i++) {

//Just creates a new value for the element in the array
anArray[i] = i;

//Creates A Text Field Called mytext

_root.createTextField("mytext"+ anArray[i],1,100,horizPosition + 50,300,100);
mytext + i.multiline = true;
mytext + i.wordWrap = true;
mytext + i.border = false;

myformat = new TextFormat();
myformat.color = 0xff0000;
myformat.bullet = false;
myformat.underline = true;

mytext + i.text = "this is the text thats SUPPOSED to appear";
mytext + i.setTextFormat(myformat);

//Increment The Horizontal Position

horizPosition = horizPosition + 20;
}




Thanks for any and all help, I appreciate it!

Text Box... Grrr Derrrr
Right another dumb ass question, how do you add a text box? i can add the ListBox from the Flash UI Components, but how do you add text??

help please.....

GRRR..Simple Load Mov ?
REALLY simple issue which I fail to grasp!

Please tell me how I can load an EXTERNAL SWF into a MOVIE using the Target method. Instead of just loading it and it appears in an unwanted area...I want it to appear in a placeholder MC which has the instance name of "holder"..

Pleas help...thanks!

Toggling, Default Is Always Off.. Grrr
how can i change the default to be on
here is my toggle button script

on (release) {
if (sounds) {
sounds = false;
} else {
sounds = true;
}
}


thanks

Grrr...newbie Trouble
I am in desperate need of help. I created a scrolling movie script but i am getting actionscript bugs everywhere. Can someone please check my .fla? I am using MX 2004 Pro.

FLA- http://www.spectraentertainment.com/test/test.fla

View the SWF- http://www.spectraentertainment.com/test/sweetnew.swf

Any help would be greatly appreciated.

Regards,
Stephen Young

Mathematical Operators... GRRR
i'm designing a children's maths game that basically centres around "if" statements and playing a certain .swf file dependant on the player's answer. my problem is that i need to play a certain .swf if the player's answer is wrong by 10 or more and i can't get the syntax right. confused? here it is

on(release){
if (_root.yourAnswer == _root.answer+10 ||
_root.yourAnswer == _root.answer-10 ||
_root.yourAnswer == _root.answer<-10 ||
_root.yourAnswer == _root.answer<+10) {

(loadMovie("gutterball.swf", "_root.checkMat"));


the 's are where i run into problems. how do i get it to play that .swf if the answer is wrong by 10 or more?

Grrr ClearInterval Not Clearing?
I am trying to clearInterval a given setInterval but it just never stops, keeps goin and goin and goin.....? I am calling it at 100ms is that why? IS there a way around this?

Bitmaps Blurred - Grrr
Is it a known / documented issue or is my particular installation nuts?

It seems as tho MX2004 doesn't like bitmaps. Make a circle bitmap in fireworks, drag it over to flash stage, all looks fine. Export the swf, and the circle has blurred edges!

Wut gives?

Button Fun.. Y Won't U Work Grrr
Trying to get an embeded button in a movie clip to affect the movement of another movie clip by going to a frame label..

i'm prob just having a blonde moment but I can't for the life of me get it to work ..


Code:

_root.controlA_mc.nordic_move1_btn.onRelease = function(){ main_mc.gotoAndPlay('move1'); trace("hit"); };

_root.controlA_mc.nordic_move2_btn.onRelease = function(){ main_mc.gotoAndPlay('move1'); trace("hit"); };



Any help would be most helpful...

Andy

Swf Smaller, But Same Filesize Grrr
Hi!
I have a sequence of jpeg´s and when i make the swf 500x600 its size is 551Kb....

right...so what i did next was make the movie size 170x250...made the MC of the secuence smaller, to fit in those dimensions...and pffff!
its still 551kb!! why? its a much smaller size movie...
i am sure i have done this before and the size has come down! or doesnt it?!

ok, any tips/help...thanks...

mike

GRRR Hittest Odd Shapes
okay ive looked at tutorials on hittest and how to stop a movie clip from moving when it hits a wall and stuff but none of it can tell me how to make a movie clip stop moving when it hits any side of an odd shaped movie clip. for example, i have the moving clip, guy, with this code:

onClipEvent (load) {
walkSpeed = 15;
}
onClipEvent (enterFrame) {
if (root.hit="no" and Key.isDown(Key.UP)) {
_y -= walkSpeed;
}
if (Key.isDown(key.RIGHT)) {
_x += walkSpeed;
}
if (Key.isDown(key.LEFT)) {
_x -= walkSpeed;
}
if (Key.isDown(key.DOWN)) {
_y += walkSpeed;
}
}



and i have another clip, table, which is an L shaped movie clip and i want the guy to not move through any side of the table.. sounds simple enough. but nowhere i have looked can explain how to do this.

Yet Another LoadMovie Problem; Grrr...

alright.
i'm getting fine results when i run this from my computer, but not when its uploaded online.  ...there are no path errors (i.e. filenames), so i assume its a loading issue.

i have a menu in a main flash file, and when options are selected, its calls to load the respective swf, and then unloads what was previously in the holder.

here is an example of the code for the button 'about us',
where _global.current checks to see if the content is already loaded; each option renames this variable respectively.

on (release) {
    if (_global.current != "aboutus") {
        unloadMovie(_root.mainHolder);
        loadMovie("aboutus.swf", _root.mainHolder);
        _global.current = "aboutus";
    }
}

i put a preloader in each swf file to be loaded, where frame 10 has the content to be displayed:

loaded1 = _root.getBytesLoaded();
loadedtext = loaded1/_root.getBytesTotal()*100+"%";
if (loaded1 == _root.getBytesTotal()) {
    gotoAndStop(10);
} else {
    prevFrame();
    play();
}

the probelm is that the preloaded flashes for a moment, but then nothing shows.    if click on another button and then back the first one - this time it'll show.  lol...  i have no idea whats going on.

help!

(thanks a million in advance)

-adam


Grrr Layer Problem
Hi folks,

I didn't have much luck with my last question, I think I'll forget about that one for now.

I am having trouble atm with another annoying problem. I have created a large robot chracter that I wish to duplicate with certain rules. Here's the code I have so far...


ActionScript Code:
robots = 3;
robot._alpha=0;
do {
    xSize = 50+Math.random()*100;
    xSize=Math.round(xSize);
    duplicateMovieClip(robot, "robot"+k, xSize);
    robot._xscale = robot._yscale=xSize;
    eval("robot"+k)._alpha=100
    k++;
} while (k != robots);


I make the first movieClip dissapear cos I only want the duplicates. Then I set the variable xSize which is a rounded integer between 50 and 150. xSize determines both the size of the robot and the layer it is placed on (or at least I want it to).

I want the smaller robots to be behind the larger ones to give an illusion of distance.

At the minute the code doesn't seem to give any connection between the size of the robot and its layer.

Can anyone see what I am doing wrong...?

Tah!

Document Updater Corrupt? Grrr....
HELLO PEOPLE

Has any one had trouble with the documentation updater? It's a 25MB download and yet when you try to launch the EXE, it tells you that the file is corrupt. So, you try another download and get the same result.

Am I alone in this? Maybe it's Gozilla's fault?

Rob

Scrollers And The Mouse Scroller..grrr
Hey there.

Got a Dynamic text field connected with a scroller.. all good, works fine. But when i scroll the wheel on my mouse its not reacting...why is that so and what can i do to fix it?

Thanks
Kongy

Grrr... How Do I Make This Function Work?
Hi, tis me again ... I have the following function :
code:
function Spray() {

for (i=0; i<=10; i++) {
duplicateMovieClip(particle, particle+i, i);
scale = random(150)+50;
yVel = random(7)+1;
xVel = random(20)-10;
_root.particle._xscale = scale;
_root.particle._yscale = scale;
peak = 50;
drop = false;
_root.particle._x += xVel;
//above here is what needs to initilize, and below is what need to constantly reapply
if (!drop) {
_root.particle._y -= yVel;
trace("systems nominal");
if (_root.particle._y<=peak) {
drop = true;
}
}
if (drop) {
_root.particle._y += yVel;
trace("la la la");
}
}
}

Spray();


anyway, I tried a couple of ways to make the veriables initialize diffrently for each duplicate, and then constantly applaying the bit of code that makes the particle go up and down, and compact all this in a single function.
can anyone tell me how to do this?
thanks in advance.

Ya Get Me Lodgyik? Frame Lables, Grrr
i want some movie clips to be dependant on variables in the main timeline so they can hop to the relavent frame labels when certain variables are set.

problem being that i cant find how action script can find a frame label.

i thought being able to hop to the label via an expression which builds the frame lable from the variable.




EXPLANATION
first time someone uses the file they set the variables via buttons, these butons also send the movieclips to the right lables. later in the same sessin I want them to be able to view it all again, so this time the movieclips need to be aware of the variables which are set and goto the relavent frames.

Dynamic Text Fields - Grrr
Im having a problem loading text from a text file into a dynamic text field.
the text is loading perfectly on my local machine but is not working at all online.
I have checked for the usual stuff namely the path to the file is correct.
Anyone know what my problem could be.

Random Falling Leaves... Grrr
Okay, okay... so I'm a design guy and as we all know, design guys suck at actionscript. A little help would be great.

I've got a page with a movie of a leaf that twists and turns as it glides down at guide. I'd love to make this leaf randomly fall. Even if its as simple as making the movie play every so often on a random interval.

How can it be done?

I feel like such a noob.

I've only got mx... I upgraded to 8 but it hasn't arrived yet.

[F8] Grrr....easy Mouse Rotation Please?
i gotta get a couple of books lol...
i know this is something simple, but i don't know how to do it lol...
i looked at tutorials and they are all a lot longer and more complicated than i think it could be. how should i make a mc rotate with the mouse?

_width Property Not Accurate? - (grrr)
Hi,
I have a small square movieclip that I am dynamically sizing (width only), however after setting the _width property to the desired value, I trace the movieclip's width, and the value returned is off by a few pixels.

Hoping someone might know what is causing this, or know some work around, It's driving me crazy!

JMC
www.macromediadeveloper.com

Grrr ... Line Breaks In Dynamic Text
... how go about it? Pressing "enter" doesn't give me a paragraph or line break. Instead, I get error messages.

Tne text is in

On clip event (load) ... variablename="mytextbutnolinebreakpossible"

GRRR Fellas, Gimmie A Hand Here Im STUCK
I have a horizontal line of images which scroll left or right depending on where you move the mouse. The more you move the mouse over to the the edges the speed of the horizontal images slowly accelerates but when it come to the end of the images they just stop suddenly...

What I wanna do is make them decellerate and ease to a stop when it come to the end of the horizontal bar of images.

See what I mean here:

http://www.booji.com/helpmeplease

cheers guys,
jimbo

Accesing The Main Movies Timelime ... Grrr*
Hi Flashers!

I split a big movie in 5 smaller movies and want to load them one after the other automatic into a mainmovie.

If I try to access the mainmovie from one of this 5 loaded movies to skip to the next scene to load the second movie and unload the first movie I used this script:

_level0.gotoAndPlay("F1",5);
stop();

The mainmovie should jump to frame 5 unload the current movie and skip to the next scene to import the second movie and so on.

But nothing happens

How have I to adress the main timeline of the mainmovie from a loaded movie in level x?

What I`ve done wrong?

Thank you!

Regards,

Mikalux

Checkboxes, Lists, And Video Autoplay... Grrr
This kind of a multipart question...

I'm a bit stuck with this new project. I'm creating a video playback system that does the following:
1) Populates a list box with video titles from a CF page/DB. The list box is called "VideoListBox".
2) When you click the video title, it automatically plays a movie in a playback window called "VideoFrame".
3) Has a checkbox marked "Autoplay", so you can select if you want the video to playback automaticaly or not when click, or if it loads first. The CheckBox instance is called "APCheck".

A) The List Box:

The listbox is populating fine. However, I cannot seem to get the selected index from it. I'm using the following just to trace the index, but it keeps spitting back "undefined":


Code:
// Located on the "VideoListBox" instance itself
on(change) {
// Find out which list item is selected and output it
var CurVideo = VideoListBox.selectedIndex;
trace(CurVideo);
}
How do you get the value and the label out of a list?

B) The CheckBox

When you click the "APCheck" CheckBox instance, it is supposed to determine whether VideoFrame.autoplay is set to true or false, and then change it accordingly. It also changes the label on the CheckBox to read "on" or "off"

If add the "trace(VideoFrame.autoPlay);" line to a separate frame on the timeline, it outputs the correct state.

However, when I have as part of the "on(click)" function, it outputs "undefined". Also, the label does not change, and I've tried it both calling the name of the instance ("APCheck") and using "this.label=".


Code:
on(click) {
trace(VideoFrame.autoPlay);
if (VideoFrame.autoPlay == true) {
APCheck.label("AutoPlay Off");
VideoFrame.autoPlay = false;
}
else {
APCheck.label("AutoPlay On");
VideoFrame.autoPlay = true;
}
trace(VideoFrame.autoPlay);
}
I'm really stuck. The whole thing seems to be easy enough, but I just can't get it working...

MX04: Problem With Rollovers Showing Grrr.. :(
Hi I'm having some trouble with this segmant of a website i'm working on, basically if you swf it out and then hit the white bar on the left, a list of links will scroll up, unfortunatly one of the boxes underneath it all always seems to 'get stuck' showing when i don't want it too.

Any help on this would help me out greatly, ta!

dean
ps-i'm a complete novicce when it comes to actionscript, so please spell it out for me if i need to do any coding here!!

[F8] Grrr HOW THE HECK DO YOU DO REMOTE ROLLOVERS OMFG
IVE BEEN HERE FOR 1 HOUR TRYING HOW TO DO A REMOTE ROLL OVER CAN SOMEONE JUST FIX
spshq.tripod.com/gees/gees.html

Bitmaps, Alpha Channel And Buttons. Grrr
I have a MovieClip which contains a Bitmap with a transparent section (Think DOHnut!).

I have another MovieClip(btn) that moves behind said MovieClip(with Bitmap) which has a CLICK event handler attached.

I can click the MovieClip(btn) fine when visible on the stage. However when it moves behind the MovieClip with the Bitmap, though I can still see it, I can no longer click it.

I don't want do use a transparent button which tracks the MoveClip(btn).
Is there any other way to overcome this problem?

This is probably stupidly basic stuff but Thanks in advance.

Grrr... Closing A Browser Window Using FScommand
Hello,

Could someone please tell me, how does one close a browser window using the FSCommand. The normal 'quit' option works only closes a projector file. But i need to close a browser window.

I hear there is some technical javascript wizadry which allows one to do this. Please help....

Thank Ye,
Gopaldass

Shaky Animation + Transparent Flash + Grrr
Again Flash is driving me up the walls because of yet another bug.

I've been working on an image viewer that's nearly complete. The people I'm doing this for want to use this in their websites and sometimes with a transparent background. Now I notice that there's a problem with the animation of my thumbnails when I rollover using a transparent flash. The thumbnails look shaky and I don't know why. Is this normal? Is there a reason for this? Is there a sollution?

Here is the same movie with and without transparent background:
Image viewer
Image viewer transparent with shaky rollover
(just so there's no confusion: you can't click the thumbnails in this version)

I really hope someone can help me with this one!

update: I've just commented the code that makes the color of the thumbnails change on rollover and the problem is gone. So I guess it's just a flaw with the flash player that it can't show the color transformation nicely?

This is the code that causes the problem:

PHP Code:



 var image:MovieClip = this;highlightin = new Tween(image, "waarde", Regular.easeOut, 0, 100, 0.3, true);highlightin.onMotionChanged = function():Void {var my_color:Color = new Color(image);var myColorTransform:Object = { rb: this.position, gb: this.position, bb: this.position };my_color.setTransform(myColorTransform);}; 

Grrr... TypeError 1009 Is Evil Among Other Things
So... Learning AS3 within 12 hrs time is probably not the smartest goal to set for oneself.

Anyway, I'm just a few steps away from finishing my first half-decent flash site when TypeError #1009 decides to bite me in the rear end. I've found the sources, but I don't know how to remedy the problem.

Line of code causing the problem:


Code:
MovieClip(root).about.addEventListener(MouseEvent.MOUSE_UP, newContent);
Now, I've been searching for several hours how to reference a MovieClip on the stage from a separate AS file, and the casting solution seemed to be the winner. Apparently, I was wrong. I have an FLA file that imports and adds an AS class extending Sprite as a child. The line of code shown is attempting to add an event listener to a Button symbol I've created (and made an instance name for) in the FLA file.

A second problem I'm having has to do with importing an HTML file into a TextField. Using the following code I snatched from the internet, I'm trying to display a TextField containing HTML constrained by the stated dimensions with a scroll wheel to view the content. I was under the impression that stating the dimensions and making the content larger than the TextField would limit the size of the field and add scrolls. Poor assumption on my part. Any tips? Code follows:


Code:
package {

import flash.display.*;
import flash.events.*;
import flash.text.TextField;
import flash.net.*;

public class LoadHTML extends Sprite {
private var txtField:TextField;
private var HTMLData:String;
private var myHTMLFile:URLLoader;

public function LoadHTML(but:String) {
myHTMLFile = new URLLoader();
myHTMLFile.addEventListener(Event.COMPLETE, onLoadHTML, false, 0, true);
myHTMLFile.addEventListener(IOErrorEvent.IO_ERROR, ioError, false, 0, true);
myHTMLFile.load(new URLRequest(but + ".html"));
}

private function onLoadHTML(e:Event):void {
HTMLData = e.target.data;
initTextField();
}

private function initTextField():void {
txtField = new TextField();
txtField.x = 76;
txtField.y = 155;
txtField.width = 647;
txtField.height = 340;
txtField.multiline = true;
txtField.wordWrap = true;
txtField.autoSize = "left";
txtField.selectable = false;
txtField.htmlText = HTMLData;

addChild(txtField);

myHTMLFile.removeEventListener(Event.COMPLETE, onLoadHTML);
myHTMLFile.removeEventListener(IOErrorEvent.IO_ERROR, ioError);
}

private function ioError(e:IOErrorEvent):void {
trace("Error: File " + e.text + " could not be loaded");
}
}
}

Grrr... Closing A Browser Window Using FScommand
Hello,

Could someone please tell me, how does one close a browser window using the FSCommand. The normal 'quit' option works only closes a projector file. But i need to close a browser window.

I hear there is some technical javascript wizadry which allows one to do this. Please help....

Thank Ye,
Gopaldass

Why Doesnt Text From Defined Variable Sin Component/smartclip Show In Swf? Grrr
I followed a tutorial for creating smartclips in Flash 5, but i guess ended up creating a component in flash mx 2004, but when i preview my movie....the text areas (with variables defining the dynamic text from the paramters I set in my clip) show nothing - just blank?

whyyyyyy

Any help offered appreciated...

thanks in advance

Cheska

Array, Array HELP - Importing A External File Into N ARRAY - Almost There
I am reading and external file with the following code:

ActionScript Code:
on (release, keyPress "<Enter>") {
lv = new LoadVars();
lv.onLoad = function() {
questions1 = this.filelist0.split(",");
answers1 = this.filelist1.split(",");
for(i=0;i<questions1.length;i++)
//trace(questions1[i]+"   "+answers1[i]);
trace(questions1[i]);

//assumes same number of scores in each list
};
lv.load("questions.txt");
}


When I parse the file it puts it into an columar format as it should...however I need it to look like this:

questions1=new Array ("2+4=?","What is the capital of Illinois?","What color is the sky?","10x(5+2)=?");

answers1=new Array ("8","springfield","blue","70");


How do I do that?

Text file look like this:

&questions1=2+4=?,What is the Capital of Illinois?,What color is the sky?,10x(5+2)=?")&
&answers1=8,springfield,blue,70&

Grrr. Loaded Not Loaded.
I am trying to get things to size based on the size of imported JPG.

Trouble is, even when I use a getbytesloaded/getbytestotal for each JPG to make sure, Flash occasionally gets ahead of itself and doesn't give the correct size of the JPG.

This is usually the first load of the day - after that it works perfectly.

Any ideas?

Pls Help: Need To Create New Array Taking 3 Random Entries From An Existing Array
Hello

I have a 2d array:

qTeeth[1] = [How many teeth do we have?, 1-10, 11-20, 21-30, 11-20]
etc.

It goes [question, option1, option2, option3, real answer]

I now just want to extract 3 or so of these entries and create a new array with them. Since I want to just use 3 or so questions randomly from a large array of questions.

Does anyone know a good tidy script to do this with??


Thanks in advance,
Ben.

If I Type Array[1]=array[2] Their Values Are Permanently Linked. How Do I Change This
e.g.

Code:
array[2][0] = 4;
array[1] = array[2];
array[1][0] = array[1][0] + 3;

trace("array[1]= " + array[1]);
trace("array[2]= " + array[2]);


Result:
array[1]=7;
array[2]=7;


The result I want is:
array[1]=4;
array[2]=7;




How do I achieve this?

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