Jump to content
Search Community

Xristi

Premium
  • Posts

    59
  • Joined

  • Last visited

Everything posted by Xristi

  1. Hi, I meant that when I run the parent I got the null in the child, both from the first trace and the second trace in the if statement. I work in CS4, but I ran your code in a trial version of CC2014.1 exactly as presented. One last try - I have attached a zip file with my CS4 code (which fails to load the child, but gives no "null" messages either). Can you look at it and see why it is failing. One thing that puzzles me about you response above, though, is your reference to a variable myName. The code that I got from you uses the function doStuff. Maybe we are not looking at the same code?child to parent info passing.zip
  2. Hi, I can only get a null from the code referenced above... and, as you wrote, that means that I have the child swf running on its own. However, the onComplete function that I wrote into the code (in the SWFLoader in the parent) indicates that the child is loaded. What must I do differently? On a personal note, I am a 4th year PhD student in Ed. Tech. writing an intelligent tutoring system to teach story problem solution. I have been working on this system for over two years learning as3 as I go - your help is greatly appreciated as my target date of graduation is fall of 2015.
  3. Carl did a great job of explaining how to send a variable from the parent swf to the child swf using LoaderMax. Is the reverse possible?
  4. Wonderful!! Thank you, Carl, so much, for your expertise and patience... nonpareil!
  5. OK - removed all extraneous code. There are two fla files (parent and child) with associated as. doc files (Main and MainChild). I am getting the rawContent trace value on the LoaderMax load of the child swf, but I don't understand how to read it into the child file. The zip of all files is attached.SWFTrialTwo.zip
  6. Hi, Thank you very much for your patience. Here is the code for the parent fla (SwfLoadTrial): import flash.display.*; import com.greensock.*; import com.greensock.easing.* import com.greensock.loading.*; import com.greensock.events.LoaderEvent; import com.greensock.loading.display.*; var queue:LoaderMax = new LoaderMax(); queue.append( new SWFLoader("checkExpressionTrial.swf", {estimatedBytes:3000, container:this, x:250, y:100, autoPlay:false, onComplete:completeHandler})); queue.load(); function completeHandler(event:LoaderEvent):void { event.target.rawContent.testString = "it's here"; trace("rawContent: " + event.target.rawContent.testString); //Correct - event.target refers to the SWFLoader trace("it's loaded"); } Here is the code for the document file (MainCA) for the child swf: package { import flash.display.MovieClip; public class MainCA extends MovieClip { private static var rootInstance:MainCA = null; var myCA2; var myCARF; var testString:String; var matchingParentheses:Boolean; //public function Main() class constructor public function MainCA() { rootInstance = this; myCA2 = new CheckAnswer2; myCARF = new C_aRelationalFunctions; myCARF.setProbLevel(0); myCARF.setProbNumber(0); myCARF.setProbFunction(0); numericalAnswer_txt.text = String(myCARF.returnFunction(inputExpression_txt.text)); showTestString(); } function showTestString():void { testString_txt.text = testString; } //function to get root instance of Main public static function getInstance():MainCA { return rootInstance; } } } the error I get now is: Error #1056: Cannot create property testString on MainCA. Sorry, how do I send the .zip file?
  7. Thank you, Carl for your prompt reply. Below is the test code I have written. I get this error msg when the first line in the function completeHandler is not commented out. 1119: Access of possibly undefined property rawContent through a reference with static type com.greensock.loading:LoaderMax. As the code is now, the swf child is showing and the trace statement in the completeHandler is written. Is there something I need to do in the parent document file first? import flash.display.*; import com.greensock.*; import com.greensock.easing.* import com.greensock.loading.*; import com.greensock.events.LoaderEvent; import com.greensock.loading.display.*; var queue:LoaderMax = new LoaderMax(); queue.append( new SWFLoader("checkExpressionTrial.swf", {estimatedBytes:3000, container:this, x:250, y:100, autoPlay:false, onComplete:completeHandler})); queue.load(); function completeHandler(event:LoaderEvent):void { //queue.rawContent.testString = "someValue"; //trace("rawContent: " + queue.rawContent.testString); //Correct - event.target refers to the SWFLoader trace("it's loaded"); }
  8. Is there any way to use LoaderMax and possibly rawContent to provide variable values for the the child swf that are contained in the parent swf? I have a document class (MainCA) for the parent swf that contains the variables. When I use LoaderMax and the rawContent property I am given the document class of the parent as an object. Using dot notation for the specific variable produces an error "Error #1069: Property testString not found on MainCA and there is no default value".This is my first post and my first experience with LoaderMax, although I have used TweenLite for several years. I work in AS3. Thank you for any help that can be afforded.
×
×
  • Create New...