[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

variables to child

Posted on 2004-11-13
13
Medium Priority
?
159 Views
Last Modified: 2010-04-03
I am simply trying to have a child movie, that was loaded into level 1, recognize the variables in the parent movie.

In the parent movie I have this:
_global.address = "222";
loadMovieNum("somemovie.swf", 1);

In the child movie I have used all of there but they don't work;
trace(_level1.address);
trace(_parent.address);
trace(address);
trace(_global.address);

Does anyone know of one that would work? Or is there something else I should do like a POST, if so what would the code look like?

 
0
Comment
Question by:Docjayman
  • 5
  • 4
  • 2
  • +1
13 Comments
 
LVL 16

Assisted Solution

by:vickerleung
vickerleung earned 300 total points
ID: 12572799
Docjayman,

How about

trace (this._parent.address);
trace (_root.address);

Vicker
0
 
LVL 6

Expert Comment

by:nishasrilankan
ID: 12572879
trace(_global.address); is working....just check with

Ctrl+Enter >> Debug >> List Variables
0
 

Author Comment

by:Docjayman
ID: 12572905
For some reason when I do hit list variable I get about 1000 lines of code come up which would be impossible to scroll through.  The traces didn't work for me.  Would it matter if the child movie loaded an external swf?  Maybe the _global thing only works with movies within the main movie and not with swfs that are loaded in.  
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 6

Expert Comment

by:nishasrilankan
ID: 12573016
no..I tested it here...as you said..it works man...
Ctrl+Enter >> Debug >> List Variables >> Ctrl+F >> "222" >>Enter

//just find "222" in the listed variables...
0
 

Author Comment

by:Docjayman
ID: 12573191
I agree I made a test movie and it worked, but the original movie containing on the data and forms will not allow it to work for some strange reason.  
0
 
LVL 6

Expert Comment

by:nishasrilankan
ID: 12573281
Sorry...cannot say anything without seeing the .fla

my email is "n i s h a n t h e @ g m a i l . c o m"
you can send it to check.
0
 
LVL 16

Expert Comment

by:vickerleung
ID: 12574535
me2~ vicker@gmail.com
0
 
LVL 39

Expert Comment

by:blue-genie
ID: 12581650
docmanjay.

*laughing at comment*   some reason when I do hit list variable I get about 1000 lines of code come up which would be impossible to scroll through.

your list variables is an integral part of development and debugging, if you're looking for a particular variable simply right click in the output window and use the find option.

ps. shout if it doesnt' get resolved.

blu
0
 
LVL 6

Accepted Solution

by:
nishasrilankan earned 400 total points
ID: 12582571
when I load the external .swf through the atletic.swf....I cannot run the output window (Flash stucked)..I think thats because the variable list is quite big to handle with the output window.
0
 

Author Comment

by:Docjayman
ID: 12583254
You just have to wait a second for Flash to catch up.  I know it seems as if Flash is stuck but it isn't, I thought the same thing but I just waited it out and the list will complete.  
0
 

Author Comment

by:Docjayman
ID: 12587435
The syntax error is some where in the function validateForm(), in the actions layer, in the academic movie clip.  When I take everything out of this function except the LoadMovieNum(baseballform.swf, 1) it works.  Here is the code:
errors = new Array();
function validateForm() {
      errorLog.text = "";
      errors.length = 0;
      validateACT();
      validateSAT();
      //validateGPA();
      validateClassRank();
      if (errors.length > 0) {
            errorLog.htmlText = "<b>ERRORS:</b><br>";
            var i = -1;
            while (++i < errors.length) {
                  errorLog.htmlText += errors[i] + newline;
            }
errormovie.play();
      } else {
      _root.toolbar.gotoAndStop(3);
      if(already == 2){
      if(sport == "Baseball") {
            loadMovieNum("baseballform.swf", 1);
            _global.already = 3;
      }
      }
      else {
            _level1._visible = true;}
      
      
      _root.academic._visible = false;
      //getURL("athletedatain.cfm", "", "post");
      }
}

function validateAct() {
      if (zip.length > 2 || isNaN(zip) == true) {
            errors.push("Invalid ACT.");
            actR.gotoAndStop(2);
      }else {
            actR.gotoAndStop(1);
      }
}
function validateSAT() {
      if (zip.length > 4 || isNaN(zip) == true) {
            errors.push("Invalid SAT.");
            satR.gotoAndStop(2);
      }else {
            satR.gotoAndStop(1);
      }
}

function validateGPA() {
      if(gpa.lenght != "") {
      if ((gpa.indexOf(".") != 1) || (gpa.length != 4)) {
            errors.push("Invalid GPA ex.=(3.02) or (3.50)");
            gpaR.gotoAndStop(2);
      }else {
            gpaR.gotoAndStop(1);
      }
      }
      }

function validateClassRank() {
      if (isNaN(zip) == true) {
            errors.push("Invalid Class Rank.");
            classrankR.gotoAndStop(2);
      }else {
            classrankR.gotoAndStop(1);
      }
}
0
 
LVL 39

Expert Comment

by:blue-genie
ID: 12590908
djm, what error message are you getting?
or is it simply not working?

0
 

Author Comment

by:Docjayman
ID: 12623198
Thanks guys, but I figured it out.  I learned that _global vaiables don't play by exactly the same rules a var variables.  
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question