I'm having some trouble with passing a variable from a movieclip timeline to a child movieclip's class.
I've created 7 movieclips on the main timeline and within each of these moviecilps I've create a movieclip named "moreInfo" with the class MoreInfo.as assigned to it. This class simply opens a web url when the movieclip is clicked. I'm trying to reuse this movieclip in each of the 7 parent movieclips by setting the url on the parent movieclip timeline and passing it to the instance of moreInfo. I've followed the thread above and I'm receiving the following error when the instance of moreInfo shows up:
"TypeError: Error #1034: Type Coercion failed: cannot convert "http://wvsokids.org/the-music/elements-of-music/melody.html" to com.musicalbuildingblocks.MoreInfo.
I've placed the following on the parent movieclip's timeline:
public class MoreInfo extends MovieClip
public var myURL:String;
public function MoreInfo(urlS:String):void
myURL = urlS;
this.buttonMode = true;
private function onClick(e:MouseEvent):void
navigateToURL(new URLRequest(myURL), "_blank");
Thank you for responding. What exacty does "MoreInfo=new MoreInfo" do?
I used the above code and I'm now receiving this error:
ArgumentError: Error #1063: Argument count mismatch on com.musicalbuildingblocks::MoreInfo(). Expected 1, got 0.