Alan Neilsen schrieb:
Thanks dr.ache



I still can't get this to work. Whatever is wrong, it doesn't like the line "public 
function completeHandler(event:Event) {".

ok, lets go trough this:

package {

      // Import stuff

      import flash.events.addEventListener;
what should that be? you can only import Classes, not Methods...so this line should look like this:
import flash.events.EventDispatcher;
because that is the class you can use to addEventListeners

      import flash.events.Event
this should have an ; at the end of the line
      import flash.events.MouseEvent;

      import flash.display.*;

      import flash.net.URLRequest;

      import flash.display.Graphics;



      public class rte2124buserName {
you should name your class with a capital letter at the beginning....
            var rect1:Shape = new Shape();

            rect1.graphics.beginFill(0xFFFFFF);

            rect1.graphics.drawRect(0, 0, 1966, 660);
here you should enter:
rect1.endFill();
otherwise flash would not draw anything....
            addChild(rect1);

            var ldr1:Loader = new Loader();

            ldr1.mask = rect;
what you you doing here? if you want to mask ldr1 with rect1 then
a) you must addChild(rect1); to the display list and
b) you should name it rect1 not rect
            var url1:String = "topics/rte2124b_topic1.swf";

            var urlReq1:URLRequest = new URLRequest(url1);

            ldr1.load(urlReq1);

            
ldr1.contentLoaderInfo.addEventListener(Event.COMPLETE,completeHandler1);

i cut out the second shape here....

after that... you must close the constructor function..that is your main fault.
here it comes:  }

now your completeHandler1 is outside of the constructor function and a method of your class.

            // Call up topics from topics folder.

            public function completeHandler1(event:Event) {
this line should look like this:
                public function completeHandler1(event:Event):void {


                  MovieClip(event.currentTarget)._parent = this;

                  trace(_parent.ldr1);

            }

      }

}



All I want to do is to pass user input (user name) from a parent SWF to a child 
SWF. Could somebody please tell me all the code I need and where the code goes 
to do this. I am sorry that I can't work this out, and to be honest, Flash help 
is less than useless unless you have been doing OO programming for years. It 
does not contain decent examples of everything one needs to do to get stuff to 
work.
Flash help "helps" you alot if you read it ... you need to read more depending on your level of knowledge. and for sure it does not give you all the code for every situation you could come in.
but it definitely shows you how to set up your first class  properly:

Manual - Programming AS3 - Object Oriented programming - Classes

and how to use the loader class:
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/Loader.html

If you cant deal with it... pay someone for doing your job.

The examples written at the loader class page assume that you put the code on the first frame of a fla file.. not in a seperate class file...that is why the compiler complaints....
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to