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




Xml Array Assignment Problem



Hi,

I'm trying to populate an array with info loaded in from an xml file. I've got the xml loading fine and I can trace everything but cannot seem to access the info outside of the function...here's my code:


Code:
myXML.onLoad = function(success) {
if (success) {
populateNav(myXML);
} else {
trace("xml did not load");
}
};
myXML.load("nowplaying.xml");

function populateNav(myXML) {
var nowplayingXML = myXML.firstChild;
var totalXML:Number = nowplayingXML.childNodes.length;
var totalCases = totalXML;
var spacing:Number = contentMC.itemsMC._width+10;
var numberOfCases:Number = totalCases;
var i:Number = -1;
while (++i<numberOfCases) {
var movie_title = nowplayingXML.childNodes[i].childNodes[0].firstChild;
var image_path = nowplayingXML.childNodes[i].childNodes[1].firstChild;
var link_to:Array = [nowplayingXML.childNodes[i].childNodes[2].firstChild];
trace(image_path);
}
}

var imageholder:Array = [image_path];
trace(imageholder);
My trace inside of the populateNav function works great...all the info is there and image_path returns all of my...image paths. So my XML is fine...what I can't seem to do is pass that info outside of the populateNav function. My imageholder trace returns undefined. I think it's got something to do with the fact that the imageholder trace is being performed before the xml is fully loaded...not sure what to do about that though...any help would be greatly appreciated.

Thanks,

Gjuddy



KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 11-27-2006, 06:07 PM


View Complete Forum Thread with Replies

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

[as1.0] Array Assignment
Has anyone here run into problems when trying to assign an array (in one movieClip) to another array (in another movieClip)? After a couple of hours/days of struggling the following seems to apply:


ActionScript Code:
targetClip.nodeArray = [];
targetClip.nodeArray = otherClip.nodeArray;


This will not always work. It seems to append to the other array, even if I assign that array to []. And, at the same time, it seems to create some form of a link between the 2 arrays, even if they are in different movieClips.

However, if you do this:


ActionScript Code:
targetClip.nodeArray = [];
for (c=0; c<otherClip.nodeArray.length; c++) {
    targetClip.nodeArray.push(otherClip.nodeArray[c]);
}


Then it seems to work. Anyone know why?

Loop For Array Value Assignment? How?
I'm still learning about loops and how powerful they are. I know how to assign values to variables (named sequentially) using a loop, but am still a big newbie at arrays. I have 6 sets of images - each with 80+ images in them. I am dreading writing these arrays out.

How would the following be expressed with a loop (there are 81 values needed)?

img_ce2003Wed=["ce2003Wed0","ce2003Wed1","ce2003Wed2",...]

Thanks in advance...

Multidimensional Array Assignment
Hiya Guys,

I have done a search on the forum but coiuldn't see the same problem and I'm probably just having a brain fart anyway but...

this piece of code works...


Code:
Var GridArr=new Array()
for (var i=0;i<10;i++){
GirdArr[i]=123
}
trace(GridArr)
but this doesn't...

Code:
var GridArr= new Array()
for (var i=0;i<10;i++){
for(var j=0;j<10;j++){
GridArr[i][j]=123
}
}
trace(GridArr)
Anybody know why?

I'm sure I must have done this a million times before and it has worked but i cannot get it to work for the last 24 hrs!!

cheers for any help

Z

Loop For Array Value Assignment? How?
I'm still learning about loops and how powerful they are. I know how to assign values to variables (named sequentially) using a loop, but am still a big newbie at arrays. I have 6 sets of images - each with 80+ images in them. I am dreading writing these arrays out.

How would the following be expressed with a loop (there are 81 values needed)?

img_ce2003Wed=["ce2003Wed0","ce2003Wed1","ce2003Wed2",...]

Thanks in advance...

Multidimensional Array And Dynamic Assignment...
I have a menu that is reading a php generated xml file that populates the main tabs with the title, and then the links under it with story data. I have set up for loop to read the xml file and assign the appropriate place in the multidimensional array.

My question is that I want to take that data and dynamically insert it into the right text box instead of doing something like this:
Code:
menuItem01.story01.title_text.text=menuTab[0][0].attribute.title;
// so you know I have four buttons menuItem01-menuItem04
// under each button is five stories numbered story01-story05
I have tried a few things but they haven't worked. What I tried to do was create another array that held the menuItem names but when I ran the swf it just got confused.

Is there a way to assign them with the use of a for loop? Or do I just hard code the assignments since I know how to do that?

If you need more info I can provide it. Thanks in advance.

Array Assignment Problem / Weirdness
Hi guru's, etc

I might be a little sleepy, but I'm sure that this should be able to be done, but it doesn't work.

Can anyone explain why the variable 'prb' shows as empty throughout this code - assuming that the variable 'prereq' has some data in it eg: "FRED.12~JIM.34"

I'm splitting it, then splitting the result, assigning it into the 'prb' array and then trying to display the 'prb' array result.

// CODE SNIPPET HERE ----

var prb = [];
if(prereq.length>0)
{
var pra = prereq.split("~");
trace("Pre: "+pra.toString()); // Shows fine here
for(var i in pra)
{
var c = pra[i].split(".");
trace("jjjj:" +pra[i]+ " c "+c[0]+"_"+c[1]); // Shows perfect here
prb[c[0]] = c[1];
trace("Prb1: ["+prb.length+"] "+prb.toString()); // Shows "Prb1: [0] " - Wrong!!
}
}
trace("Prb: "+prb.toString()); // Shows "Prb: " - Wrong!!

// ---- END CODE

I'm assuming that c[0] is a string, and as usual I can use a string as an index into an array.

Any help/guidance would be very welcome...

Zingo

Unique Assignment Of A Nested Function Within An Array Loop (i Know It's Bad)
Hey guys,

I'm having probs with preloading swfs into an array. Basically, it's the preloader for the individual swfs that are loaded on demand by the user into each's respective attached movieclip in the array. I know it's naughty, but i've put a function in a function (I hear this is evil). Anyway, each iteration in the the putBtn function is uniquely assigned(.num = i etc etc), but i've got a preloading function (preloadContainer) within PutBtn. How would i go about uniquely assigning each iteration of this, so that i can refer in the preloadContainer function to the particular Putbtn clicked?

excuse my poor code. i've only learnt arrays a couple of days ago.

i've seen senocular's helpful FAQ on uniquely assignment of loop iterations (thanks senocular ), but i'm having probs with this one..

any ideas guys?

ps I'm guessing that for the most part, the bit you should focus on is the innards of the PutBtn button function.


Code:
var imageArray:Array = new Array();
imageArray[0] = largePanel.panel1_mc.paul.img1;
.. to ... (shortened this bit)
imageArray[32] = largePanel.panel1_mc.kohei.img11;

for (var i:Number = 0; i < imageArray.length; i++) {
var imgHeight:Number = imageArray[i]._y;
var imageSel = imageArray[i];
var putBtn:MovieClip = imageArray[i].attachMovie("button", "button", 1000+i);
putBtn.num = i;
imageSel.createEmptyMovieClip("vid", i);
var vidBtn:MovieClip = imageArray[i].attachMovie("button", "vid", 100+i);
vidBtn.num = i;
var slideTo:Number = -200;

putBtn.onRelease = function() {
for (var i:Number = 0; i < imageArray.length; i++) {
imageArray[i].button._visible = true;
};
var speedNum:Number = 0;
var ycenter:Number = 150;
var speed:Number = speedNum;
largePanel.onEnterFrame = function() {
var distance=_root._ymouse-ycenter;
this._y+=(distance*speed);
if (this._y > 0) this._y=-6597;
if (this._y < -6597) this._y=0;
};
var speedNum:Number = 0;
this._visible = false;
imageArray[this.num].vidBtn._visible = true;

//slider
var theMove:Number = this.num * slideTo;
largePanel.tween('_y', theMove, 0.5, easeInOutQuint, 0);

//unload the vids
for (var i:Number = 0; i < imageArray.length; i++) {
imageArray[i].vid.unloadMovie();
};

imageArray[this.num].vid.loadMovie("videos/" + this.num + ".swf", 100);
attachMovie("preloader anim", "preloader_mc", 500, {_x:200, _y:0});
onEnterFrame = preloadContainer;

//load the individual vid
function preloadContainer(){
var bytes_loaded = imageArray[1].vid.getBytesLoaded();
var bytes_total = imageArray[1].vid.getBytesTotal();
trace(bytes_loaded);
imageArray[this.num].vid.stop();
imageArray[this.num].vid._visible = false;
if (bytes_total > 0){
var percent_loaded = bytes_loaded/bytes_total;
preloader_mc.value = percent_loaded;
if (percent_loaded == 1){
imageArray[1].vid.play();
imageArray[1].vid._visible = true;
preloader_mc.removeMovieClip();
delete onEnterFrame;
};
};
};
//imageArray[this.num].vid.loadMovie("videos/" + this.num + ".swf", 100);
return speedNum;
};
//vid button
vidBtn.onRelease = function() {
var speedNum:Number = 1/7;
var ycenter:Number = 150;
var speed:Number = speedNum;
largePanel.onEnterFrame = function() {
var distance=_ymouse-ycenter;
this._y+=(distance*speed);
if (this._y > 0) this._y=-6597;
if (this._y < -6597) this._y=0;
if (_xmouse < 0 || _xmouse > 300) {
speed -= speed/12;
};
if (_xmouse >= 0 && _xmouse <= 300) {
speed = 1/7;
};
};
for (var i:Number = 0; i < imageArray.length; i++) {
imageArray[i].vid._visible = false;
};
for (var i:Number = 0; i < imageArray.length; i++) {
imageArray[i].button._visible = true;
};
imageArray[this.num].vid.unloadMovie("videos/" + this.num + ".swf", 100);
return speedNum;
};
};

Uni Assignment Help
heya - ihave a uni assignment to do on an interactive character. i was planning on having a fish float randomly around a fish bowl - and i have no clue how to make it float around. And i also need to make it do various things randomly - how do i do this (ie frame jumps) without having to click on the fish?
all help greatly appreciated!!

VERY SIMPLE VAR ASSIGNMENT
Check it, I got 2 layers "Actions" & "dynamText"
dynamText has four display fields called: disp0,disp1,disp2,disp3

On the actions layer i have this code
--------------------------------------------------------
var people = ["john", "jay", "mike", "matt"] ; //create people array
var i = 0
while (i < people.length) {
var disp+i = "array element + i + is people[i]";
i++;
}
--------------------------------------------------------

I want to with each loop assign the text to each display var with each pass of the loop. My problem is the 5th line how do i say make disp+whatever i = at that pass is = "this string"

if someone can help me with this it will solve a more complex problem of mine!

Another Form Assignment...
First off I would like to say thank you to everyone who helped me on the last form assignment.

Here is the next assignment:


Create a user input form. Your form should include:


1) A piece of static text that describes the form to your user

2) Four input text fields that allow the user to input their name, age, state, and email address

3) A "submit" button

4) Four dynamic text fields that populate with the user information when "submit" is pressed

5) Assign the age and state fields to have a maximum input length of two characters

6) Turn off selectability on all dynamic text fields

7) Turn on the border/bg for all input text fields and turn off all border/bg features for dynamic text fields


I have completed every step to this point except step four. I added the dynamic fields but do not know how to populate them when the user presses the submit button.

If anyone can help I would greatly appreciate it. Thanks.

HELP My Assignment Is Due In 2morrow
Hi
Mum said that i could come here for help! I have made a assignment in Flash MX. I have saved it as an AVI file. It plays perfectly. I need to be able to convert this into VCD so i can present it at school. I have tried this using Nero but when i play it back it splits the movie so that the left side play on the right and the right on the left. I have downloaded Magic swf to avi however after it converts it there it comes up saying unable to find file and stops working? I also have imported MP3 files and now the flash file is very big. Any help would be appreciated as my assignment is due tomorrow and its part of my mid year assessment!

Please Help - Flash Assignment
Hi!

I need some help. I have a Uni assignment in flash. I have created a movie in NetGui In a Flash 3 and imported it into flash, the last section i need to create of the assignment is an interactivity scene. For this I have decided to list 3 images with buttons and have users vote for who they want to win.

When i create this interactivy screen, it runs in the background with the movie playing in front of it and the audio skips in a loop and makes this horrible echoing sound.

I have treid everything i can think of to fix this and it won't work.

If someone could please help me or give me soem ideas on how to fix this, i would really appreciate it.

Thanks

Please Help - Flash Assignment
Hi!

I need some help. I have a Uni assignment in flash. I have created a movie in NetGui In a Flash 3 and imported it into flash, the last section i need to create of the assignment is an interactivity scene. For this I have decided to list 3 images with buttons and have users vote for who they want to win.

When i create this interactivy screen, it runs in the background with the movie playing in front of it and the audio skips in a loop and makes this horrible echoing sound.

I have treid everything i can think of to fix this and it won't work.

If someone could please help me or give me soem ideas on how to fix this, i would really appreciate it.

Thanks

Please Help - Flash Assignment
Hi!

I need some help. I have a Uni assignment in flash. I have created a movie in NetGui In a Flash 3 and imported it into flash, the last section i need to create of the assignment is an interactivity scene. For this I have decided to list 3 images with buttons and have users vote for who they want to win.

When i create this interactivy screen, it runs in the background with the movie playing in front of it and the audio skips in a loop and makes this horrible echoing sound.

I have treid everything i can think of to fix this and it won't work.

If someone could please help me or give me soem ideas on how to fix this, i would really appreciate it.

Thanks

Assignment Troubles
ok for school i have to do a project for a multimedia course, the project requires me to contact some one in the industry and ask them a few questions, up to now ive send out about 17emails to people askin for a little help, and none have replied, so anyone who could lend me a hand, even for a few questions email me at scriptersx@gmail.com

I Don't Understand This Assignment
please I don't understand this assignment to a generic Object. What's this line doing?:

clips[card._name] = {id:linkageArr[i], clip:clip};

as you'll see in the code, clips is a generic Object, clip is a MovieClip which contains a reference to a MovieClip in the library, card is a reference to a MovieClip which has just been drawn dynamically, and linkageArr is an Array containing linkage names for all MovieClips in the library.

Here's the summarized code:


PHP Code:



var clips:Object = new Object();

var linkageArr:Array = ["A", "A", "B", "B", "C", "C", "D", "D", "E", "E", "F", "F"];

.........

initialize();

function initialize():Void {
    var clip:MovieClip;
    var card:MovieClip;
    var x:Number = 10;
    var y:Number = 10;
    
    for (var i:Number = 0; i<linkageArr.length; i++) {
        depth = this.getNextHighestDepth();
        
        clip = this.attachMovie(linkageArr[i], "clip"+depth, depth, {_x:x, _y:y});
        card = drawRectangle(Math.random()*0xFFFFFF, clip._width, clip._height, x, y);
        
        clips[card._name] = {id:linkageArr[i], clip:clip}; // Here it is

        ..............
    }
}

...............

[CS3] Really Need Some Help On A Game For An Assignment
Hi guys,

I'm still sorta new to flash so I thought i'd post here.

I'm doing an assignment where I have to create a game in flash. My game is based on the TV series Lexx, which you control a moving spaceship (ie, Moth) and you need to shoot enemies and defeat the big boss for each level. It's a side scrolling game.

I've got the first level working, but when it comes to the second level it doesnt really work. For the second level I need to change the background, and add change the enemies to different pictures. Even though I've duplicated the keyframe and tried to change the image, the image on the original keyframe gets changed also. I don't know why this is happenening, it shouldn't be. So what I had to do was create duplicate layers for the moth, enemies, background, and firing weapon and copy the coding over. But because I cant use the orignal variables I added the letter "B" onto the end of each one. Therefore they are all new variables doing the same thing.

When I get to the second level it's all stuffed up and I don't know why. I really need help with this I just don't know what to do. I've got several other problems still in the first level but I just want to be able to link to the second level. (The first level the enemies won't dissapear, the hittest takes off the life too quickly - I need a timer in there)

Here is a link to the file, I hope I can get some help

http://www.filecrunch.com/fileDownlo...&fileId=144907

Flash 5 Assignment
I got stuck the portion of my Information Technology assignment called Procedding Data and Sending it to the Server. Problem is, nobody else in my class has got it working quite right and my "teacher" does not actually know actionscript, although he usually throws a few kinks in what's given to us to have us figure out what's wrong with it. *sigh*

So I turn to you, good people of the forums, for help. Here's what I was given to work with, exactly as was on the paper.


Code:
on (press) {
entry="<b>On"+new Date().toString()+", <font color="0000FF"><a href="mailto:"+userEmail+"|>username+"</a></font> entered the following:</b><br>"+userEntry+<br><br>";
action="write"
this.loadVariables("url cut for space","GET");
}
Thanks!

Assignment For College
hi all im new to this forum and incredibly new to flash. im making a website for college and for my opening page to enter the site i hav embedded a flash movie into the html. on the flash file it has a button that should link you to the site. but unfortunatly the button dosent seem to work. now i dont know if it the flash that is messing up or if its my html page that needs sorting out. any help on this would be greatly apprciated thanks.

my actionscript on the button is-
on (release) {
getURL("/pages/home.html") (target="self");
}
and my html for the page is -
<html>
<head>
<title> index </title>
</head>
<body bgcolor="#ffffff" leftmargin="0" topmargin="0" marginwidth="0" marginheaight="0">
<!-- ImageReady Slices (web.psd) -->
<table width="800" border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td background="images/title.jpg" width=800 height=144 alt=""></td>
</tr>
<tr>
<td background="images/banner.jpg" width=800 height=59 align="center" valign="middle">



</td>

</tr>
<tr>
<td background="images/perload_08.jpg" width=800 height=397 align="center" ><p align="center"><embed src="webassignment2.swf" width ="350" height="290" align="center" scale="exactfit"/>
<p align="center"><a href="pages/home.html" class="style6">Skip Intro</a></td>
<p align="center">




</tr>
</table>
<!-- End ImageReady Slices -->
</h5>
</h1>
</div>
</div>
</BODY>

</html>

thanx for any help im really pulling my hair out on this one

Assignment Operator
Hi...

I have the following problem.
I have an array that has a name for a square.
In my i want to edit the _width value of each square by using a loop.
The first part with the for loop works and shows 4 squares.
The second loop must change the _width for each square but this doesn't work.
grafieken[g].onEnterFrame = function() { were grafieken[g] is the array does not work. However, if i change this too grafiek1.onEnterFrame = function() { this will work for only the first square.

How do make sure all the squares will change


Code:
grafieken = new Array("klant1", "klant2", "klant3", "klant4");
count = 0;

//first part

for (g=0; g<grafieken.length; g++) {
_root.grafiek1.duplicateMovieClip("grafiek"+grafieken[g], count);
trace(grafieken[g])
oCount = eval("grafiek"+grafieken[g]);
with (oCount) {
_width=10;
_height=10;
_x = (count % 16)*_width;
_y = (count % 16)*_height;
count++;
}
}

//second part

for (g=0; g<grafieken.length; g++) {
//trace(grafieken[g])

grafieken[g].onEnterFrame = function() {

if (this._width <= 99) {
this._width += ratio;
if (this._width == 100) {
grafieken[g]_uitslag = this._width;
trace("Maximum is bereikt");
}
}
}
}
thanks

Pleaze Help Me Out Of My Assignment
helo guys. my self athreya.

i am handling an assigment, where i am supposed to make a flashtool for a company.
the architecture of it is as follows
(i) first page with four button each having unique function.
(ii) on clicking any of these buttons again 6 subbuttons enter the stage
(iii) these subbutons perform the final work. each buton is suposed to handle a task, and the task is to display a form ( may it be excel sheet or database sheet or a document or an application interface ) that too with in a confined area.Not just displaying it should be even able to manipulate the logic in the forms


like this each of the for buttons has 6 sub butons, now i wold like to seek help in achievingnbthis task. i have finished the first two steps.
now i would likte to know how can we assign any tpe of external content (viz., spreadsheet, any application etc.,) to these subbuttons, and that too with in a specific area of stage.

please4 help me out any one.

Compound Assignment In Compound Assignment
Ok, check out this code here

x="a";
x=x+"b"+(x+="c");

trace(x);

//outputs : abac



Shouldn't the "x+=c" be evaulated first , making 'x' be "ac" ?

so then
x="ac"+"b"+("ac")

// ? acbac


Flash isnt reevaluating the vars outside of the assignment in parentheses , is that just supposed to be the way it is ?

Is Assignment By Value (not By Reference) Possible In As3 ?
The way I see it as3 forces us to use pointers , am I right ?

This is the code

var a:Point = new Point();
var b:Point = new Point();
b.x=1;b.y=1;
trace(b)
b=a;
a.x=2;a.y=2;
trace(b) // same b as upper but meanwhile a was modified
//horror movie scene ... b toooo !!!!

And this is the output

(x=1, y=1)
(x=2, y=2)

I want the output to be like yhis

(x=1, y=1)
(x=1, y=1)

I know a and b are references , I just want to know the simplest way to get the wanted output

I could assign property by property like this b.x=a.x . b.y=a.y , but :
1. what do I do when there are not 2 but 50 properties ?
2. what do I do when I want to pass the value of a as a parameter to a function that assigns a to b ?

School Assignment...PLEASE HELP
for a school assignment, i am supposed to use a support forum to come up with "Complex interactivity (buttons, navigation, etc.) can be built into Flash using what computer programming language?"
does anybody know what this is?
thanks!

Assignment Between Levels
If I have a button on level0 and code it
on (release) {
homepress=true;
//or _level2.homepress=true;
}

Then on level 2 have a frame script

if (homepress==true) {

loadMovieNum("home_mc.swf",2);
}

Why does level2 not see the assigment from level 0 and load the swf? It will load it if I set homepress to true on level 2.

This Week Assignment
I think every week we should make assignments :D

Consider this the first assignment
We have to bild a photo gallery based on 3D DistortImage Photo Stack :D
The photo gallery should be via XML

If this in not a good idea, maybe you can suggest another one ;)

I think this will be very interesting :D

Button Assignment Actionscript
Ok, I'm not quite sure how to pose this question but I will try all the same.
I'm creating my first web site using Flash 5. I have nothing uploaded yet so it's difficult to give an example. My question is this (actually it has a few parts)

the site has a main text using a scrolling text box. when the site opens this text box comes in from the right hand side as a movie clip. I have 7 buttons and when I click any one of these buttons I want the previous text box to move out to the left and that buttons text to come in from the right. I've tried using the "on Release" goto and Play command but in the long run I don't think that's going to work because when I click the first button the main text goes to the left and the new text comes in from the right, but! each time I click that same button the main text moves to the left instead of the text that should be moving to the left.

I hope I didn't confuse anyone by asking this but this is something that I really stuck on. If there's someone out there that can help me, I'd really appreciate it.

Button Assignment Actionscript
Ok, I'm not quite sure how to pose this question but I will try all the same.
I'm creating my first web site using Flash 5. I have nothing uploaded yet so it's difficult to give an example. My question is this (actually it has a few parts)

the site has a main text using a scrolling text box. when the site opens this text box comes in from the right hand side as a movie clip. I have 7 buttons and when I click any one of these buttons I want the previous text box to move out to the left and that buttons text to come in from the right. I've tried using the "on Release" goto and Play command but in the long run I don't think that's going to work because when I click the first button the main text goes to the left and the new text comes in from the right, but! each time I click that same button the main text moves to the left instead of the text that should be moving to the left.

I hope I didn't confuse anyone by asking this but this is something that I really stuck on. If there's someone out there that can help me, I'd really appreciate it.

Variable Assignment Quirk(?)
I have a very simple Flash movie that works fine in Flash5 but not in Flash6, and I was wondering if anyone knew why:

I've have two mc's on my main timeline:

MC1 is in frame 1. It has 1 frame with: _root.var = "Hello"
MC2 is in frame 2. It has 1 frame with: trace(_root.var)

when i run it, the output shows: undefined.

Any ideas?

Dynamic Task Assignment
Hello, I am writing a dynamic menu component - so far I have the ability to create a number of labeled buttons dynimcally and have them display nicely. My problem is dynamic task assignment. For example...

function test(){
trace("that works");
}

----

onClipEvent (load) {
TotalButtons=1;
labels="one"
tasks="_root.test()";
labelList=labels.split(",");
taskList=tasks.split(",");
for (i=1;i<=TotalButtons;i++){
this.attachMovie("m_button",["b"+i],i+200);
this["b"+i]._y=(0-(i*20)+10);
this["b"+i]._x=49;
this["b"+i].label=labelList[i-1];
this["b"+i].doThis=taskList[i-1];
}
}

What I want to happen is when the button is clicked, the function is called... Any thoughts? Thanks in advance for your help...

F5 Vs. F6 EVAL And ASSIGNMENT Don't Work? *help**
I want to assign the value on an eval to a dynamically generated variable like
so:

eval(holding[i].nodeName+"window.title")= holding[i].nodeName;

this works in flash 5 but does not in flash 6
the error in flash 6 says:
Left side of assignment operator must be variable or property.

but it IS a variable! but flash 6 doesn't got through the eval to find that
out..
flash 5 did.
what do I do?

thanks for any help,
my brain hurts...

DuplicateMovieClip Variable Assignment
I'm trying to build a somewhat dynamic menu where you can set the number of menu items you want and it will create the menu for you.

I created a movie clip named "item_name" with a dymanic text box with a variable named "label_name".

Then on the root timelime I have the code below:

//declares how many main nav items there are
var num_of_nav = 4;

//defines the main nav items
var nav_items_1 = "about";
var nav_items_2 = "policy";
var nav_items_3 = "show";
var nav_items_4 = "contact";

//hides the original nav item in which to be copied
item_name._visible = false;

//builds the main level nav items
var num = num_of_nav;
var i = 1;
var y_pos = 0;

while (num > 0) {
duplicateMovieClip (_root.item_name, "nav"+i, i);
setProperty ("nav"+i, _x, 0);
setProperty ("nav"+i, _y, y_pos+25);

//need to set the variable for "label_name" here?

i++;
num--;
y_pos = y_pos + 25;
}
__________________________

How do I go about setting the label_name in the newly created movieclips?

Please help!!

Thanks,
mquach

Help With Dynamic Assignment Construction...
ok... here goes~

i have made copies of an MC on the field like this:

for(x=0;x<=10;x+=1){
UnitNum = "Unit'+x;
duplicateMovieClip(_root.unit, UnitNum,x);
}

my problem is now i need to access each of them individually to assign a value individual to them so they "remember" their numbers,
like:
_root.unit1.no = 1
_root.unit2.no = 2
_root.unit10.no = 10

but how do i insert an assignment in the loop to make that assignment?

_root.unit+x.no = x;
doesn't work...
nor does
eval("_root.unit"+x+".no") = x;

but you sort of get the drift... how do i call such an assignment?

Lava Lamp Assignment
http://www.bosscomp.com/upload/lava.swf

http://www.bosscomp.com//upload/moo3.fla


This is a lava lamp assignment I am currently working on. Still alot I want to do with it in terms of making it look better... which is why I'm here!

1. How can I make the blobs look better? Like makign it look more 3D or having a good lighting effect on them?

2. When you use an actual lava lamp, suppose the blobs are floating, but then you turn it off.. then the blobs eventually come back down. Would this be possible to do in Flash with what I currently have right now? If not, are there alternatives to this which are not as good but acheive a similar goal to this?

Thanks for your help.

Flash Assignment - Want To Make A Few Bob?
Hey guys,

As part of my multimedia communication degree at uni we are doing flash. I'm reading thorugh flash demystified as quickly as i can, but i am one slow reader, and the whole thing must be in for a weeks time. Any of you guys would find this a awalk in the park, and only a few hours work at most. It only must be done simply, and i am offereing the wage of £50 for the job.

Now i know about all the lectures i am due about, 'you should learn it yourself', and 'you should have done this earlier' but i really dont have time to hear it chaps.

Here is the assignment............. if you choose to accept it????:


Task Description

You will demonstrate your understanding of the techniques involved in building multimedia applications using a timeline authoring environment.

Produce a multimedia application that demonstrates the following four areas of Mathematics:

•Addition
•Subtraction
•Multiplication
•Division

The target audience is school children aged between 6 and 10. So only the most simple of examples should be used. Each principle should be demonstrated by the following types of media:

•Video (talking head)
•Audio.
•Animation.
•Textual notes.

The user should be able to select or deselect the media that are currently displaying. All displayed media should be synchronised. Video and audio selection should be mutually exclusive i.e. you should be able to play only one medium at once.


Deliverables

•A CDR containing your source code and flash movie. This must be readable on machines in the Multimedia Labs (P230 or P228). This includes opening and reading all documentation as well as reading the directories on the CD. Make sure you test this before handing in the assignment. This should be handed into the assignment box on the due date.

Dynamic Button Assignment
Hi, I am dynamically generating a mc's as buttons based on an array returned from a webservice. Everything works great except the function below surrounded by ************. When pressed, any of the buttons should display the appropriate value in news_txt, but instead, it just goes blank. I have been trying to crack this for days!! Please help me!!!


Code:
function GetNews_Result(re:ResultEvent):Void {
//set TextFormats
myImpact_fmt = new TextFormat();
myImpact_fmt.color = 0xCCCCCC;
myImpact_fmt.font = "impact";
myImpact_fmt.size = "14";
myTahoma_fmt = new TextFormat();
myTahoma_fmt.color = 0xFFFFFF;
myTahoma_fmt.font = "tahoma";
myTahoma_fmt.size = "12";
result_length = re.result.length;
//length of web service query (number of rows)
//initialize variables
var headlines = "";
var story = "";
//initialize loop counters
i = 0;
//index
h = 0;
//height factor
d = 1;
//depth factor
//create story textfield and populate with latest story
story = re.result[0].STORY;
this.createTextField("news_txt", 100+d, 5, -135, 280, 280);
this.news_txt.html = true;
this.news_txt.multiline = true;
this.news_txt.wordWrap = true;
this.news_txt.htmlText = story;
this.news_txt.embedFonts = true;
this.news_txt.setTextFormat(myTahoma_fmt);
//loop over web service result array
while (i<result_length) {
headlines = "<font size='11'>"+re.result[i].HEADLINE+"</font>";
//create textfields for headlines
this.createTextField("headline_txt"+i, 1+d, -205, -135+h, 200, 20);
//set textfield attributes
this["headline_txt"+i].html = true;
this["headline_txt"+i].multiline = true;
this["headline_txt"+i].wordWrap = true;
this["headline_txt"+i].htmlText = headlines;
//this["headline_txt"+i].embedFonts = true;
this["headline_txt"+i].setTextFormat(myImpact_fmt);
//create buttons for headlines
this.createEmptyMovieClip("button"+i, 200+d);
this["button"+i].lineStyle(2, 0x000000, 100);
this["button"+i].beginFill(0x999999, 100);
this["button"+i].moveTo(0, 0);
this["button"+i].lineTo(202, 0);
this["button"+i].lineTo(202, 20);
this["button"+i].lineTo(0, 20);
this["button"+i].endFill(0, 0);
this["button"+i]._x = -207;
this["button"+i]._y = -133+(i*22);
this["button"+i]._alpha = 10;
//create actions for buttons
this["button"+i].onRollOver = function() {
this._alpha = 60;
};
this["button"+i].onRollOut = function() {
this._alpha = 10;
};
//****************************************
this["button"+i].onPress = function() {
news_txt.htmlText = re.result[i].STORY;
};
//****************************************
i = i+1;
h = h+22;
d = d+1;
}
}

Function Assignment Not Working...
I am making a top-down shooter game in Flash 8 that is nonlinear (you can fly in any direction) and I am having a hard time getting the weapon system to work. here is my code:

Code:
shots = [];
weapon = "laser";
laserspeed = 20;
onMouseDown = function () {
addon = true;
for (i=0; i<shots._length; i++) {
if (!shots[i]) {
shots[i] = true;
this[weapon].duplicateMovieClip("shot"+i, 2+i);
this["shot"+i]._x = active._x;
this["shot"+i]._y = active._y;
this["shot"+i]._rotation = 90-dir*180/Math.PI;
this["shot"+i].shotmove(dir, eval(weapon+"speed"));
addon = false;
break;
}
}
if (addon) {
this[weapon].duplicateMovieClip("shot"+shots.length, 2+shots.length);
this["shot"+shots.length]._x = active._x;
this["shot"+shots.length]._y = active._y;
this["shot"+shots.length]._rotation = 90-dir*180/Math.PI;
this["shot"+shots.length].shotMove(dir, eval(weapon+"speed"), shots.length);
shots.push(true);
}
};
MovieClip.prototype.shotMove = function(direct, sspeed, place) {
ttlcounter = 125;
this["shot"+place].onEnterFrame = function () {
ttlcounter--;
if (ttlcounter == 0) {
this.removeMovieClip();
for (i=shots.length; i>0; i--) {
if (shots[i]) {
break;
} else {
shots.pop();
}
}
}
for (i=0; i<total.length; i++) {
if (total[i].hitTest(_x, _y, true)) {
this.removeMovieClip();
for (j=shots.length; j>0; j++) {
if (shots[j]) {
break;
} else {
shots.pop();
}
}
}
}
this["shot"+place]._x += Math.cos(direct)*sspeed-_global.xspeed;
this["shot"+place]._y -= Math.sin(direct)*sspeed-_global.yspeed;
};
};

i have all the weapon type as a string stuff so that i can add different weapons later. dir is the direction the ship is facing in radians. I have tried debugging this and what seems to happen is that the function shotMove gets assigned to the shot, but only for one frame. the laser MC just stays right there in the middle of the ship. this might seem like a newbie question, but what can i do to keep shotMove assigned to the shot?

Function Assignment Problem
I'm making a top-down shooter game and I have a very simple problem: i want to assign a function to the movieclip of the lasers that the player shoots. I do that by writing a prototype function named shotMove that takes the direction the spaceship is facing and the speed the laser should move as arguments, with an onenterframe function inside that moves the shot the specified speed in the specified direction. then i have a separate onMouseDown function that attaches a laser movieclip and assigns shotMove to it, with the necessary arguments. however, when i debug the game and click the mouse, it goes through the steps in the shotmove function only during the frame in which the mouse was clicked. How do i assign an onenterframe function to a movieclip permanently?

Help Needed With Flash Assignment
Hi, I'm creating a small Flash document as part of my end of year assignment, but am having trouble with one of the buttons acting kooky.

Intro Screenshot:


The two buttons load two different XML docs, one for each section. The Tutorial part works fine, I'm just having problems with the Quiz part. When I click on the Quiz button, it loads the XML file correctly (traces fine). I answer the first question and then when I click the Next Button (btnQuiz) I get taken to the first page of the tutorial - even though the action script says this:


Code:
btnQuestion.onRelease = function()
{
/*Start outer IF statement*/
if(bAnswered)
{
if(current<totalQuestions)
{
current++;
updateTextboxes();
}
if(current==totalQuestions-1)
{
txtResult.text="Last Question";
}
if (current=totalQuestions)
{
gotoAndStop("frmResult");
}
}
else
{
txtResult.text = "Unanswered!!!";
}
/*Outer IF statement ended.*/
}
I've exported the SWF file and included it in a web page - here

FLA is here if anyone can help me.

[f8] Boolean Assignment Not Working?
I have a function which moves an object l2c to the left. This function also should set the boolean l2_isRight to false (as the object is now on the left!) It also should move button_2 to x=0.


Code:
function move_2_left() { //move 524 pixels to the left in 1/2 second.
button_2._x = 0;
//move x=524 -> 59
l2o._x = 58;
l2c._x = 524;
var alpha_interval:Number = setInterval(fadeImage, 5, l2c);
function fadeImage(target_mc:MovieClip):Void {
target_mc._x -= 17; //7.2
if (target_mc._x <= 75) {
target_mc._x = 58;
clearInterval(alpha_interval);
}
}
l2_isRight = false;
}
When I run this function as is, l2c moves to the left, but button_2 does not move and l2_isRight is still true. If I comment out the boolean assignment (last line in function) button_2 now moves as expected.

I have tried initializing l2_isRight in the following manners: (one at a time of course)


Code:
l2_isRight = Boolean(true);
l2_isRight = true;
var l2_isRight:Boolean = new Boolean(true);
I have also tried moving the boolean assignment to a different part of the function. None of these seems to fix my problem. Can anyone help?


Thanks in advance!

Dynamic Naming/assignment Help?
ok.. Im having some trouble here.. maybe you can help me sort it out real quick. First I explain what Im trying to do...

then I'll post a couple of the ways I have tried it..

summary:

Im attaching "a movieClip to the stage from the library "XX" amount of times.

this movieClip is made up of:

1.) 1 textField
2.) 1 empty movieClip being used to load an image into. (containerClip)

as I am attaching this clip to the stage.. I also pass variables/data into each clip as it is attached/initialized..

example:


PHP Code:




for (i = 0; i < totalLocations; i++) {
                var locationClip = attachMovie("locationObject", xmlSource.firstChild.childNodes[2].childNodes[i].childNodes[0].firstChild.nodeValue, 1000 + i);
        var locName = xmlSource.firstChild.childNodes[2].childNodes[i].childNodes[1].firstChild.nodeValue;
        locationClip.locationName_txt.border = true;
        locationClip.locationName_txt.borderColor = 0x07268A;
        locationClip.locationName_txt.background = true;
        locationClip.locationName_txt.backgroundColor = 0xFFFFFF;
                locationClip.locationName_txt.html = true;
        locationClip.locationName_txt.htmlText = locName;
                //onPress actions
        locationClip.onRelease = function() {
            trace("clicked: [release]");
        };
        locationClip.onRollOver = function() {
            trace("rolledOver");
        };
        locationClip.onRollOut = function() {
            trace("rolledOut");
        };
}







my problem is coming into play when I am trying to assign a movieClipLoader() and a listener to each clip as it is being attached to watch for the image being loaded into it.. and when done (onInit)....do something.. (position the textField)..

but I cant seem to get it right.. it seems I can NOT dynamically create/name my objects


I tried adding this:

PHP Code:




//----- [image loader code] -----//
        //locationImage listener/onInit function
        var locationListener:Object = new Object();
        locationListener.onLoadInit = function(target_mc:MovieClip) {
            trace("init fired/location Object placed");
            target_mc._x -= Math.round(target_mc._width / 2);
            target_mc._y -= Math.round(target_mc._height / 2);
            //set textField placement
            locationClip.locationName_txt.htmlText = cityName;
            locationClip.locationName_txt._y = Math.round(locationClip.imageContainer._y + locationClip.imageContainer._height);
            locationClip.locationName_txt._x = Math.round((locationClip.imageContainer._x + locationClip.imageContainer._width / 2) - locationClip.locationName_txt._width / 2);
        };
        var locationLoader:MovieClipLoader = new MovieClipLoader();
        locationLoader.addListener(locationListener);
        locationLoader.loadClip(cityImage, locationClip.imageContainer);
        //----- [image loader code] -----//







but this is just using the same instance (I believe..and NOT creating a new one on each iteration/loop).. I say this because only the LAST attached clip has the correct placement of the textField.....

I tried this:

PHP Code:




//----- [image loader code] -----//
        //locationImage listener/onInit function
        locationListener = locationClip.locationListener = new Object();
        //var locationListener:Object = new Object();
        locationListener.onLoadInit = function(target_mc:MovieClip) {
            trace(locationClip._name+" locationListener init fired/location Object placed");
            trace("I: "+i);
            target_mc._x -= Math.round(target_mc._width / 2);
            target_mc._y -= Math.round(target_mc._height / 2);
            //set textField placement
            trace("LOC NAME2: "+locName);
            locationClip.locationName_txt._y = Math.round(locationClip.imageContainer._y + locationClip.imageContainer._height);
            locationClip.locationName_txt._x = Math.round((locationClip.imageContainer._x + locationClip.imageContainer._width / 2) - locationClip.locationName_txt._width / 2);
        };
        locationLoader = locationClip.locationLoader = new MovieClipLoader();
        //var locationLoader:MovieClipLoader = new MovieClipLoader();
        locationLoader.addListener(locationListener);
        locationLoader.loadClip(locImage, locationClip.imageContainer);
        //----- [image loader code] -----//







same results..

even this:


PHP Code:




//----- [image loader code] -----//
        //locationImage listener/onInit function
        locationListener = this["locationListener" + i] = new Object();
        //var locationListener:Object = new Object();
        locationListener.onLoadInit = function(target_mc:MovieClip) {
            trace("locationListener" + i +" init fired/location Object placed");
            trace("I: "+i);
            target_mc._x -= Math.round(target_mc._width / 2);
            target_mc._y -= Math.round(target_mc._height / 2);
            //set textField placement
            trace("LOC NAME2: "+locName);
            locationClip.locationName_txt._y = Math.round(locationClip.imageContainer._y + locationClip.imageContainer._height);
            locationClip.locationName_txt._x = Math.round((locationClip.imageContainer._x + locationClip.imageContainer._width / 2) - locationClip.locationName_txt._width / 2);
        };
        locationLoader = this["locationLoader" + i] = new MovieClipLoader();
        //var locationLoader:MovieClipLoader = new MovieClipLoader();
        locationLoader.addListener(locationListener);
        locationLoader.loadClip(locImage, locationClip.imageContainer);
        //----- [image loader code] -----//







so Im at a loss here.. how can I dynamically create a unique movieClipLoader/Listener for each attached clip? so that when each image is loaded into it..it calls the required call back/function/actions?

thanks

Variable Assignment Issue
Hi,

I am a newbie to Actionscript and the way it is going, I am not sure for how long I will remain in same state. As of now I am trying to modify a code sample I got on net for my need. In the process I am as well attempting to convert it from AS2 to AS3. I am appending my .as file below.

The text that it is printing is:
load func called
gridMovie width= 0 sx= 40
loaded image image1.jpg0 0

Ideally gridMovie width should be printed as 40 as I am assigning it the value of sx. Please suggest why is this happening.

And after that I receive plethora of errors:
ArgumentError: Error #2015: Invalid BitmapData.
at flash.display::BitmapData$iinit()
at ImageGrid/loadFunc()
at ImageGrid$iinit()
at portfolioas3_fla::MainTimeline/portfolioas3_fla::frame1()
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at ImageGrid/enterFrameFunc()


I think these errors are being caused by aforementioned issue of width being assigned wrongly.

Please let me know what am I doing wrong. I am using Adobe Flash CS3 to build it.

Thanks,
Mukesh

Code:



package {

import flash.ui.Mouse;
import flash.display.*;
import flash.geom.Point;
import flash.net.URLRequest;
import flash.events.Event;
import flash.events.MouseEvent;
import flash.events.IOErrorEvent;
import flash.geom.Matrix;

public class ImageGrid extends MovieClip {
var points:Array;
var range:Number = 80 // representative of how close mouse effects points
var accel:Number = .4 // elasticicty acceleration
var fric:Number = .55 // elasticicty friction
var gw:Number = 4 // grid width (points in grid)
var gh:Number = 4 // grid height

public function ImageGrid() {
//addEventListener(flash.events.Event.COMPLETE, loadFunc);
addEventListener(flash.events.Event.ENTER_FRAME, enterFrameFunc);
addEventListener(flash.events.MouseEvent.MOUSE_DOW N ,mouseDownFunc);
loadFunc();
}
public function loadFunc() {

var sx:Number = 40 // x spacing (distance between points)
var sy:Number = 40 // y spacing
var imgIndex:Number = 1;
var depth:Number = 0;
var movieIndex:Number = 0;

trace ("load func called");
// sections:
var sections:Array = ["cheese wheel","bird claw","movie show","cd polisher","g.i. snow","line lunge","street sign","love turtle","endless hole","grease stain"]


// function to draw line
MovieClip.prototype.DrawLine = function(p1,p2){
this.x = p1.x; this.scaleX = p2.x - p1.x;
this.y = p1.y; this.scaleY = p2.y - p1.y;
}

// Generate Points on the grid/attach buttons
points = new Array();
var currSection:Number = 0;

for (var x:Number=0; x<=gw; x++){
points[x] = []
for (var y:Number=0; y<=gh; y++){
// make point
points[x][y] = new PointNew(x*sx,y*sy)
points[x][y].target = new PointNew()

var gridMovie:MovieClip = new MovieClip();
gridMovie.name = "b" + ++movieIndex;
gridMovie.y = y*sy;
gridMovie.x = y*sx;
gridMovie.width = sx;
gridMovie.height = sy;
trace ("gridMovie width= " + gridMovie.width + " sx= " + sx);
var url:String = "image"+imgIndex+".jpg";
var loader:Loader = new Loader();
var request:URLRequest = new URLRequest(url);

loader.load(request);
//loader.contentLoaderInfo.addEventListener(Event.CO MPLETE, loadImage);
loader.contentLoaderInfo.addEventListener(IOErrorE vent.IO_ERROR, ioErrorHandler);
trace("loaded image " + url + gridMovie.width + " " + gridMovie.height);
var bm:BitmapData = new BitmapData(gridMovie.width,gridMovie.height);
bm.draw(loader,new Matrix());
gridMovie.graphics.beginBitmapFill(bm);
gridMovie.graphics.endFill();
addChild(gridMovie);
imgIndex++;
}
}
//this["b"+gw*gh].section = "the end" // last section

var ls:Number = 2*gw*gh + gw + gh // number of lines
// Attach lines:
/*for (var i:Number=0; i<ls; i++){
this.attachMovie("line","l" + i, ++depth)
}*/
}

private function ioErrorHandler(event:IOErrorEvent):void {
trace("Unable to load image: " + event);
}
public function enterFrameFunc(event:Event){
var xdiff:Number = 0;
var ydiff:Number = 0;
var targetx:Number = 0;
var targety:Number = 0;
var d:Number = 0;
// Position points
for (var x:Number=0; x<=gw; x++){
for (var y:Number=0; y<=gh; y++){
var p:PointNew = points[x][y] // current point
xdiff = p.base_x - mouseX // x distance
ydiff = p.base_y - mouseY // y distance
d = Math.sqrt(xdiff*xdiff+ydiff*ydiff) // distance
if (d < range){ // if within range of effect from mouse
if (!d) d = .00001;
targetx = p.base_x-(xdiff-range*(xdiff/d))
targety = p.base_y-(ydiff-range*(ydiff/d))
}else{ // put at original position (base)
targetx = p.base_x
targety = p.base_y
}
// elastically move based on targets
p.xspeed = ((targetx-p.x)*accel+p.xspeed)*fric
p.yspeed = ((targety-p.y)*accel+p.yspeed)*fric
p.x += p.xspeed
p.y += p.yspeed
}
}

//Draw lines:
var currL:Number = 0
for (x=0; x<=gw; x++){
for (y=0; y<=gh; y++){
if (x) this["l"+currL++].DrawLine(points[x][y], points[x-1][y])
if (y) this["l"+currL++].DrawLine(points[x][y], points[x][y-1])
}
}

}

public function mouseDownFunc(event:Event){

/*for (i=0;i<points.length;i++){
for (j=0;j<points[0].length;j++){
trace("point["+i+"]["+j+"]: "+points[i][j].x+", "+points[i][j].y)
}
}
*/

}

}

}

import flash.geom.Point;
// Simple Point class:
class PointNew extends Point{
var base_x:Number;
var base_y:Number;
var xspeed:Number = 0;
var yspeed:Number = 0;
public var target:PointNew;

public function PointNew(x=0,y=0):void{
this.base_x = this.x = x;
this.base_y = this.y = y;
}
}

Variable Assignment From SWF To Loaded SWF
Hi, I have been playing with this for a day and haven't been able to figure out the proper path to load this variable.

So I have a main movie, a menu (movie clip) in it, and each menu option loads an external swf in a movie clip instance (called content) in the main movie.

Loading the movies works fine.

My problem is I want assign a variable that I have declared in a loaded movie in the 'content' instance.

Main Movie
|
- Menu (MC)
-onrelease -loads movie.swf, assigns defaultpage var a value
|
_ content (MC)
|
- Movie loaded dynamically from Menu (eg. movie.swf)
-Variable defaultpage is declared on frame 1


Here is the onrelease code I'm using

on (release) {
this._parent.content.loadMovie("company.swf"); //this works
this._parent.content.defaultpage = "somevalueinhere"; //this doesnt
}


What am I doing wrong? thanks

Help With AS 2.0 Class And Assignment To MovieSymbol
Hi, I have made a Picture class, and have it in a function called center. It's supposed to center the picture on the stage. It is defined as follows:
Code:
public function center()
{
trace("Centering picture.");
}
I have also created a MovieClip symbol in my library called PictureHolder and assigned the Picture class to it. When I tried to execute the center function through an instance of the PictureHolder symbol, nothing is traced.

Example:
Code:
pH.center();
where pH is an instance of PictureHolder and is on the stage.

I'm new to this, any help would be appreciated. Thanks

Combo Box Link Assignment
A real quickie for you actionscript heavyweights, not so for pre-evolutionaries.

I have a combo box and I want to assign an html link to each of the items in the box, without using a go button. Each time the item is selected the browser is re-directed automatically.

Any help will be, well help.

Please respond in monkey proof language, as my brain hurts from my mother ******* cpu.

Cheers

Variable Assignment From SWF To Loaded SWF
Hi, I have been playing with this for a day and haven't been able to figure out the proper path to load this variable.

So I have a main movie, a menu (movie clip) in it, and each menu option loads an external swf in a movie clip instance (called content) in the main movie.

Loading the movies works fine.

My problem is I want assign a variable that I have declared in a loaded movie in the 'content' instance.

Main Movie
|
- Menu (MC)
-onrelease -loads movie.swf, assigns defaultpage var a value
|
_ content (MC)
|
- Movie loaded dynamically from Menu (eg. movie.swf)
-Variable defaultpage is declared on frame 1


Here is the onrelease code I'm using

on (release) {
this._parent.content.loadMovie("company.swf"); //this works
this._parent.content.defaultpage = "somevalueinhere"; //this doesnt
}


What am I doing wrong? thanks

Code Optimization With Assignment?
Hi,
do you think the below would improve code performance?


ActionScript Code:
for (i in o) {
        (j = o[i]).f.apply(null, j.arg);
}


see post at
Fix shortcut assignment in brackets

Void And Variable Assignment Test
Hello,

may sound stupid but I am looking for an elegant way to check whether a specific variable, object instance, or MC instance exists or not.(don't need to test all case at once of course).

I don't know if it's linked, but I can't figure out how the void( ) function can be used and what it exactly does (assignment and comparison). No real documentation from MM about it.

THANKS

This Is Not A Working Project. This Is For A Class Assignment.
This is not a working project. This is for a class assignment.

I need to find out how to redirect a user by the answers they submit. I have a Flash MX file you can look at if you email me. I need the user to answer five questions and then either be sent to a frame or html page that says passed or failed. If it’s something fairly easy and you can show me on the file I have that would be great. If you can help me I will send you the file. It is very small. Let me know if you can help.


blazin1@earthlink.net

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