Problem with addEventListener

Created preloader, and after flash loaded want stop on label 'welcomeSite'. And on that label will have button, after click this button what play code from function 'irisDescription'.
But see error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at FlashSite/flashSiteLoading()[FlashSite.as:28]
code:
package
     import flash.display.MovieClip;
     import flash.events.*;
     import flash.text.*;
     public class FlashSite extends MovieClip 
          //constructor
          public function FlashSite()
               stop();
               addEventListener(Event.ENTER_FRAME, flashSiteLoading);
          public function flashSiteLoading(event:Event)
               var mcBytesLoaded:int=this.root.loaderInfo.bytesLoaded;
               var mcBytesTotal:int=this.root.loaderInfo.bytesTotal;
               var mcKLoaded:int=mcBytesLoaded/1024;
               var mcKTotal:int=mcBytesTotal/1024;
               flashSiteLoading_txt.text="Loading: "+mcKLoaded+"Kb of "+mcKTotal+"Kb";
               if (mcBytesLoaded>=mcBytesTotal)
                    removeEventListener(Event.ENTER_FRAME, flashSiteLoading);
                    gotoAndPlay('welcomeSite');
                    irisBtn.addEventListener(MouseEvent.CLICK, irisDescription);
          public function irisDescription(event:MouseEvent):void
               trace("Iris description goes here.");
27 line is: irisBtn.addEventListener(MouseEvent.CLICK, irisDescription);
thanks for help

irisBtn isn't defined (in the scope of that class).
if that's your document class, irisBtn isn't in frame 1 of your main timeline.

Similar Messages

  • Having Problems with removing an addEventListener

    Greetings Adobe community,
    Im currently having a problem with my flash assignment,
    I have a:   this.addEventListener(Event.ENTER_FRAME, onPanSpace);
    who is causing errors when I go to the next frame:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
              at Confabulation_fla::mc2_3/onPanSpace()[Confabulation_fla.mc2_3::frame1:13]
    I would like to remove this addEventListener when I go to the next frame(which is by clicking on a door) but to be honest, I have no clue how.
    So I ask you "How do I remove this addEventListener on my next frame?"
    Kind Regards
    Notnao

    function addTheListeners():void {
         addEventListener(Event.ENTER_FRAME, onPanSpace);
         addEventListener(Event.REMOVED_FROM_STAGE, cleanUp);
    var snelheidNum:Number = 0.5;
    var snelheid:Number = 0;
    var MouseIsLinks:Boolean;
    function onPanSpace(e:Event):void
              var afstand:Number = Math.round(this.x - this.bg1.x);
              var percentage:Number = Math.floor((100 * afstand) / (this.bg1.width - root.stage.stageWidth));
              snelheid = -((root.stage.mouseX - (root.stage.stageWidth / 2))/110)/snelheidNum;
              if(root.stage.mouseX < (root.stage.stageWidth / 2)) { MouseIsLinks = true }
              if(root.stage.mouseX > (root.stage.stageWidth / 2)) { MouseIsLinks = false }
              if( (percentage < (1 - 100) && MouseIsLinks) || (percentage > (80 - 100) && !MouseIsLinks)) {snelheid = 0;}
              this.bg1.x += (snelheid / 1);
    function cleanUp(e:Event):void {
         removeEventListener(Event.ENTER_FRAME, onPanSpace);
         removeEventListener(Event.REMOVED_FROM_STAGE, cleanUp);
    //this.addEventListener(Event.ENTER_FRAME, onPanSpace);
    stop();
    This is what I got now, It removes the addeventListeners and I have no problems at the next frame but now my first frame doesnt have the onPanspace effect.

  • Problem with FLVPlayback and component

    First of all I had problem with control component. they are not working so i just named that ppo and change the visibility to false to get rid of problem!
    ppo.visible=false;
    Question1
    (is there anyway to solve the problem? I mean to match the controlbar with screen of FLVplayer.)
    Question2
    what is the difference btw Flvplayback and FLVplayback 2.5 ?
    Question3
    whenever I click in btn1 it plays the flv.but sometimes it has no action so i click again and suddenly it plays the 001.flv twice and simultanously(even more than twice!)
    how can I solve my problem ?
    ___________________Frame 1______________
    import fl.video.*;
    import flash.events.MouseEvent;
    var myVideo:FLVPlayback = new FLVPlayback();
    control.visible=false;
    myVideo.x = 115;
    myVideo.y = -10;
    myVideo.skinBackgroundColor = 0x333333;
    myVideo.skinAutoHide=true;
    myVideo.skinFadeTime=300;
    addChild(myVideo);
    btn1.addEventListener(MouseEvent.CLICK , c1);
    function c1(e:MouseEvent):void
    myVideo.source = '001.flv';   
    Question 4 : I want to jump to another frame and start another flv but I want to stop previous flv. and again add myVideo2 to stage like frame 1 pattern. Is it true ? is there any better way to do this ?
    ---------------------------frame5-----------------------
    import fl.video.*;
    import flash.events.MouseEvent;
    var myVideo2:FLVPlayback = new FLVPlayback();
    control2.visible=false;
    myVideo2.x = 115;
    myVideo2.y = -10;
    myVideo2.skinBackgroundColor = 0x333333;
    myVideo2.skinAutoHide=true;
    myVideo2.skinFadeTime=300;
    addChild(myVideo2);
    btn2.addEventListener(MouseEvent.CLICK , c2);
    function c2(e:MouseEvent):void
    myVideo2.source = '002.flv';   
    thank you in advanced..

    Question1
    (is there anyway to solve the problem? I mean to match the controlbar with screen of FLVplayer.)
    what are you calling the '..controlbar' and what are you calling the '...control component'?
    Question2
    what is the difference btw Flvplayback and FLVplayback 2.5 ?
    2.5 has more features, http://blogs.adobe.com/ktowes/2009/05/announcing_dvrcast_and_flvplay.html
    Question3
    whenever I click in btn1 it plays the flv.but sometimes it has no action so i click again and suddenly it plays the 001.flv twice and simultanously(even more than twice!)
    how can I solve my problem ?
    remove the click listener so you can only click once.  then you may need to wait if testing online.
    ___________________Frame 1______________
    import fl.video.*;
    import flash.events.MouseEvent;
    var myVideo:FLVPlayback = new FLVPlayback();
    control.visible=false;
    myVideo.x = 115;
    myVideo.y = -10;
    myVideo.skinBackgroundColor = 0x333333;
    myVideo.skinAutoHide=true;
    myVideo.skinFadeTime=300;
    addChild(myVideo);
    btn1.addEventListener(MouseEvent.CLICK , c1);
    function c1(e:MouseEvent):void
    myVideo.source = '001.flv';   
    Question 4 : I want to jump to another frame and start another flv but I want to stop previous flv. and again add myVideo2 to stage like frame 1 pattern. Is it true ? is there any better way to do this ?
    ---------------------------frame5-----------------------
    import fl.video.*;
    import flash.events.MouseEvent;
    myVideo.stop();
    removeChild(myVideo);
    myVideo=null;
    var myVideo2:FLVPlayback = new FLVPlayback();
    control2.visible=false;
    myVideo2.x = 115;
    myVideo2.y = -10;
    myVideo2.skinBackgroundColor = 0x333333;
    myVideo2.skinAutoHide=true;
    myVideo2.skinFadeTime=300;
    addChild(myVideo2);
    btn2.addEventListener(MouseEvent.CLICK , c2);
    function c2(e:MouseEvent):void
    myVideo2.source = '002.flv';   

  • Problem with drag and drop

    Hi! I'm having a problem with getting this code working, basically I want to drag and drop two things onto another the things dissapear then it moves onto a new page, the first item works properly but then the second item wont dissapear and remains stuck to the cursor. Heres the code I'd be greatful of any help.
    import flash.events.MouseEvent;
    import fl.motion.MotionEvent;
    stop();
    Back6_btn.addEventListener(MouseEvent.CLICK, onBack6Click)
    function onBack6Click(event:MouseEvent):void{
        gotoAndPlay("Bedroom2");
        Forward6_btn.addEventListener(MouseEvent.CLICK, onForward6Click)
    function onForward6Click(event:MouseEvent):void{
        gotoAndPlay('Brother bit');
    var inGran:Number=0;
    Gin.addEventListener(MouseEvent.MOUSE_DOWN, dragOn);
    Tonic.addEventListener(MouseEvent.MOUSE_DOWN, dragOn);
    function dragOn(event:MouseEvent):void {
        event.target.startDrag(false);
        stage.addEventListener(MouseEvent.MOUSE_UP, dragOff);
    function dragOff(event:MouseEvent):void {
        event.target.stopDrag();
        if (event.target.dropTarget!=null&&event.target.dropTarget.parent==Gran) {
            event.target.visible=false;
            inGran++;
        stage.removeEventListener(MouseEvent.MOUSE_UP, dragOff);
    function checkPage(e:Event):void {
        if (inGran==2) {
            gotoAndPlay("Bedroom1");

    you have some mismatched brackets, change your target properties to currentTarget (and i'm not sure you're dropping onto the correct target) but, try:
    import flash.events.MouseEvent;
    import fl.motion.MotionEvent;
    stop();
    Back6_btn.addEventListener(MouseEvent.CLICK, onBack6Click)
    function onBack6Click(event:MouseEvent):void{
        gotoAndPlay("Bedroom2");
        Forward6_btn.addEventListener(MouseEvent.CLICK, onForward6Click)
    function onForward6Click(event:MouseEvent):void{
        gotoAndPlay('Brother bit');
    var inGran:Number=0;
    Gin.addEventListener(MouseEvent.MOUSE_DOWN, dragOn);
    Tonic.addEventListener(MouseEvent.MOUSE_DOWN, dragOn);
    function dragOn(event:MouseEvent):void {
    event.currentTarget.parent.addChild(event.currentTarget);
        event.target.startDrag(false);
        stage.addEventListener(MouseEvent.MOUSE_UP, dragOff);
    function dragOff(event:MouseEvent):void {
        event.target.stopDrag();
        if (event.target.dropTarget!=null&&event.target.dropTarget.parent==Gran) {
            event.target.visible=false;
            inGran++;
        stage.removeEventListener(MouseEvent.MOUSE_UP, dragOff);
    function checkPage(e:Event):void {
        if (inGran==2) {
            gotoAndPlay("Bedroom1");

  • Problem with hardware acceleration on HBO GO

    I just got a Zotac ZBOX AD02 (AMD E-350 APU w/ Radeon HD 6310) and in general it's working great.  However, I  have a problem with Flash video on HBO GO.  For the first minute or so  of steaming video, everything seems perfect.  Video is high quality and  smooth, CPU is around 50%.  Then after a minute or two there will always  be some visible video glitch and CPU utilization will jump up to  90-100% and playback becomes extremely choppy.  So I'm guessing Flash  hardware acceleration is working initially, then something happens that  kills the hardware acceleration, and of course the E-350 CPU is not up the  task by itself.
    The really strange thing is that it seems to be specific to HBO GO.  I  can stream HD all day long from Amazon Instant Video and Youtube (at least when Youtube is able  to dish it out fast enough).  And it's definitely not a bandwidth  problem.  I have Comcast cable (20Mb down), and a bigger computer I have hooked up  to another TV  has no problem with HBO GO.  I think the same problem happens on the bigger computer, but it's faster CPU can overcome the lack of hardware acceleration.
    I've got the latest drivers from AMD and the latest Flash player (even  tried the 11 beta) and have tried all the main browsers (FF, IE, Chrome), but it's always  the same: 1-2 minutes of perfect playback and moderate CPU utilization,  then jacked up CPU and choppy playback.
    Unfortunately, there doesn't seem to be any way to contact HBO GO directly about this problem (support links just refer you to your cable provider), so I thought I'd give it a shot here. Is anyone else out there having this problem with HBO GO or any other  Flash video sites?  Any thoughts on what else I could do to track down the  root cause?

    Well, my idea with 10.x on IE didn't really work.  Results were not nearly as good as in Firefox, and I'm not willing to use 10.x in my main browser.
    However, based on your insight on the wmode=transparent issue, I started playing around with a Greasemonkey script to force wmode=direct, and I think it actually works.  I haven't been able to try it at home yet on the problem PC, but here on my work PC (don't tell anyone I'm not actually working) it makes a massive difference in CPU utilization.  Without the script CPU is around 80-90% during video playback.  When I enable the script it drops to around 20%.  The only issue is that I usually have to refresh the page once video playback starts to get wmode=direct to take effect (start video playback, then once the video playback page loads, hit refresh in the browser).
    My script is just a modified version of this one I found:
    http://userscripts.org/scripts/show/67260
    Here's my modified Greasemonkey script (hopefully the forum will allow javascript in posts):
    // ==UserScript==
    // @name           Force flash wmode direct on HBO GO
    // @namespace      http://userscripts.org/topics/3090#posts-11620
    // @description    Force flash video playback on HBO GO to use wmode direct to allow hardware acceleration
    // @include        http://www.hbogo.com/*/video*
    // @grant          none
    // ==/UserScript==
    (function ()
        nodeInserted();
    document.addEventListener("DOMNodeInserted", nodeInserted, false);
    function nodeInserted()
        for (var objs = document.getElementsByTagName("object"), i = 0, obj; obj = objs[i]; i++)
            if (obj.type == 'application/x-shockwave-flash')
                var skip = false;
                for (var params = obj.getElementsByTagName("param"), j = 0, param; param = params[j]; j++)
                    if (param.getAttribute("name") == "wmode")
                        skip = true;
                        param.setAttribute("value", "direct");
                        break;
                if(skip) continue;
                var param = document.createElement("param");
                param.setAttribute("name", "wmode");
                param.setAttribute("value", "direct");
                obj.appendChild(param);

  • Problem with XML loading and xmlns

    I'm having a problem with loading an XML file that was created by Filemaker.  Filemaker will output an XML file using one of two different grammars.  One outputs in a mostly standard form that I can use with one glitch.  Flash CS4 AS3 seems to have a problem with the xmlns in one of the nodes.
    Specifically:
    <FMPDSORESULT xmlns="http://www.filemaker.com/fmpdsoresult">
    If I remove the xmlns="http://www.filemaker.com/fmpdsoresult" the file loads properly and I can access the various fields with no problem.  However, when I leave the xmlns=... in, it will trace out the XML properly but I can't access the fields using the code listed below.  This is driving me crazy!
    With the xmlns part in the XML file I get the following error when it tries to load the thumbnail files:
    TypeError: Error #1010: A term is undefined and has no properties.
    I need to have it so that the user can enter/edit data and simply output the XML file from Filemaker and then Flash will load up the unaltered XML file and show the info requested by the user.  That is to say I could have the user open the XML file in a word processing application and have them delete the xmlns..., but that is rather cumbersome and not very user friendly.
    I've tried every xml.ignore function I could find but it doesn't help.  Hopefully someone out there can help
    Thanks,
    -Mark-
    Partial XML:
    XML From Filemaker Export:
    <?xml version="1.0" encoding="UTF-8" ?>
    <!-- This grammar has been deprecated - use FMPXMLRESULT instead -->
    <FMPDSORESULT xmlns="http://www.filemaker.com/fmpdsoresult">
      <ERRORCODE>0</ERRORCODE>
      <DATABASE>Sport.fp7</DATABASE>
      <LAYOUT></LAYOUT>
      <ROW MODID="1" RECORDID="1">
        <FirstName>Mark</FirstName>
        <LastName>Fowle</LastName>
        <Sport>Sailing</Sport>
        <Medal>None</Medal>
        <CourseOfStudy>Design</CourseOfStudy>
        <Year>1976-1978</Year>
        <HomeState>California</HomeState>
        <ImageName>93</ImageName>
      </ROW>
    </FMPDSORESULT>
    AS3 Code:
    import fl.containers.UILoader;
    var aPhoto:Array=new Array(ldPhoto_0,ldPhoto_1,ldPhoto_2,ldPhoto_3,ldPhoto_4,ldPhoto_5);
    var toSet:int=10;//time out set time
    var toTime:int=toSet;
    var photoPerPage:int=6;
    var fromPos:int=photoPerPage;
    var imgNum:Number;
    //var subjectURL:URLRequest=new URLRequest("testData_FM8.xml");
    var subjectURL:URLRequest=new URLRequest("Sports.xml");
    var xmlLoader:URLLoader=new URLLoader(subjectURL);
    xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
    var subjectXML:XML = new XML();
    subjectXML.ignoreWhitespace=true;
    subjectXML.ignoreComments=true;
    subjectXML.ignoreProcessingInstructions=true;
    function xmlLoaded(evt:Event):void {
        subjectXML=XML(xmlLoader.data);
        if (root.loaderInfo.bytesTotal==root.loaderInfo.bytesLoaded) {
            removeEventListener(Event.ENTER_FRAME, xmlLoaded);
            trace("XML Data File Loaded");
            trace(subjectXML);
        } else {
            trace("File not Found");
        imgNum=2;//subjectXML.ROW.length;
        trace(subjectXML);
        loadThumb(0);
    function loadThumb(startPos:int):void {
        var count:Number=aPhoto.length;
        trace(subjectXML.DATABASE);
        for (var i=0; i<count; i++) {
        try{
            aPhoto[i].source="images/"+subjectXML.ROW[startPos+i].ImageName+"_main.jpg";
        }catch (e:Error){
            trace(e);
            aPhoto[i].mouseChildren=false;
            aPhoto[i].addEventListener(MouseEvent.MOUSE_DOWN, onThumbClick);
        trace("Current mem: " + System.totalMemory);
        ldAttract.visible=false;
    function unloadThumb():void {
        var count:Number=aPhoto.length;
        for (var i=0; i<count; i++) {
            aPhoto[i].unload();
            aPhoto[i].removeEventListener(MouseEvent.MOUSE_DOWN, onThumbClick);
        trace("Current mem: " + System.totalMemory);
    function onThumbClick(evt:MouseEvent) {
        var i:Number;
        //trace("Thumbnail Clicked " + evt.target.name);
        i=findPos(evt.target.name);
        ldLrgPhoto.source="images/"+subjectXML.ROW[i+fromPos].LOCAL_OBJECT_ID+"_main.jpg";
        ldLrgPhoto.visible=true;
        btnPrev.visible=false;
        btnNext.visible=false;
        gotoAndStop("showPhoto");
    function findPos(thumb:String):Number {
        var pos:Number;
        var count:Number=aPhoto.length;
        for (var i:Number=0; i<count; i++) {
            if (thumb==aPhoto[i].name) {
                pos=i;
        return pos;

    Hi,
    I was trying to use xml namespaces, so in my application I receive an XML file from the server. The file has a namespace, so when I parse the file I need to specify the namespace:
    I got the following piece of xml:
    <ls:exchange xmlns:ls=".../tsw" xmlns:tm="http://kxa">
        <ls:projects>
             <tm:annotation id="" date="" action="getprojects" status="responseok"/>         
        <ls:project id="" name="proj" description="..." owner="asss"  release="2" />
            <ls:projectV  id="" version="" creationdate="" modificationdate=""/ >
        </ls:project>
    </ls:projects>
    </ls:exchange>
    and the following code
    <mx:VBox label="WELCOME" verticalScrollPolicy="off" horizontalScrollPolicy="off">
          <mx:Tree id="tree" dataProvider="{srv.lastResult.project}" labelField="@name"  width="300" height="100%" itemOpen="itemOpenEvt(event);" />
    </mx:VBox>
    So i want to display the content of the xml (project nodes”) in a tree view, but i don’t know how to includes the namespace"ls:" in the data provider “srv.lastResult.project”. can u help me it’s urgent.
    sincerly
    Celine

  • Having problem with change of name in the datagrid Coding

    I am having problem with changing the name of the datagrid header text name for one of the data either in the flash file or the php file.
    The thing is i want to change the Course_Name to Course Name that has no underscore so that it will look nicer in the datagrid but if I change it in the php file like SELECT Course_Name as 'Course Name' ....., it will not turn out in the datagrid when I CTRL ENTER the flash file but the others like Price,description and display is shown.
    There is no problem with my php code but I do not know how to change the Course_Name into Course Name so please help me resolve this error that I am having.
    This is my flash code
      function goCourse(e : MouseEvent):void
      gotoAndStop(5);
      refreshResponder = new Responder (refreshSuccess, onFault);
      connection = new NetConnection ();
      connection.connect (gateway);
      dataDG.addEventListener (Event.CHANGE, gridItemSelected);
      refreshData (true);
      function gridItemSelected (e: Event): void {
      ID = e.target.selectedItem.ID;
      courseTxt.text = e.target.selectedItem.Course_Name;
      priceTxt.text = e.target.selectedItem.Price;
      descTxt.text = e.target.selectedItem.Description;
      private function getParams () {
      var param: Object = new Object ();
      param.ID = ID;
      param.Course_Name = courseTxt.text;
      param.Price = priceTxt.text;
      param.Description = descTxt.text;
      return param;
      private function refreshData (refresh: Boolean): void {
      if (refresh)
      connection.call ("Course.viewCourse", refreshResponder);
      private function refreshSuccess (result: Object): void {
      dataDG.dataProvider = RecordSetDP.toDataProvider (result);
         dataDG.columns = ["Course_Name","Price","Description","Display"];
      private function onFault (fault: Object): void {
      trace (String (fault.description));
    This is my php file code.
      function viewCourse()
      $this->connect();
      $sql = "SELECT Course_Name,Price,Description,Display
      FROM coursetb";
      return mysql_query($sql,$this->_connection);

    i don't see where you're calling your php file in your code, but change 'Course Name' to 'Course_Name' (or vice-versa) there.

  • Problem with TLF - floating an inline image

    I am running the latest version of Flash Builder 4 (4.0.1).  The problem that I having:
    When I use an InlineGraphicsElement if aTextFlow (in a RichEditableText component), if I set a value for the "float" attribute of an <img> element; the image is not visible.  Without the float attribute, I see the image.
    Is this a version problem with TLF?  How do I know which version of TLF that I'm using?  How do I install the correct version of TLF?
    Thanks for the help.
         Oz
    Some code fragments:
    The TextFlow string with "float":
    <div color="#444444" fontFamily="Times New Roman" fontSize="20" paragraphSpaceAfter="15" textIndent="10">
    <p><span color="0xff0000" >Alice, </span><span>really, was </span><span color="0xff0000" >beginning </span><span>to </span><span color="0xff00" >get very </span><span>tired of </span><span color="0xff00" >sitting </span><span>by her </span><span color="0xff00" >sister </span><span>on the </span><span color="0xff00" >bank, </span><span>and of </span><span color="0xff00" >having nothing </span><span>to do:  once or twice she had peeped into the book her </span><span color="0xff00" >sister </span><span>was reading, but it had no </span><span color="0x888800" >pictures </span><span>or </span><span color="0xffff" >conversations </span><span>in it, `and what is the use of a book,' thought </span><span color="0xff0000" >Alice `</span><span>without </span><span color="0x888800" >pictures </span><span>or </span><span color="0xff00" >conversation?'</span></p>
    <p>
    <img float="left" width="100" source="assets/library/alice/images/White Rabbit.png" height="100"/>
    <span>So she was </span><span color="0xffff" >considering </span><span>in her own mind</span><span>(</span><span>as well as she could, for the hot day made her feel </span><span color="0xff00" >very </span><span>sleepy and stupid), whether the pleasure of making a daisy-chain would be </span><span color="0x880000" >worth </span><span>the trouble of getting up and picking the daisies, when suddenly a White </span><span color="0xff00" >Rabbit </span><span>with pink eyes ran close by her.</span></p>
    </div>
    Without "float":
    <div color="#444444" fontFamily="Times New Roman" fontSize="20" paragraphSpaceAfter="15" textIndent="10">
    <p><span color="0xff0000" >Alice, </span><span>really, was </span><span color="0xff0000" >beginning </span><span>to </span><span color="0xff00" >get very </span><span>tired of </span><span color="0xff00" >sitting </span><span>by her </span><span color="0xff00" >sister </span><span>on the </span><span color="0xff00" >bank, </span><span>and of </span><span color="0xff00" >having nothing </span><span>to do:  once or twice she had peeped into the book her </span><span color="0xff00" >sister </span><span>was reading, but it had no </span><span color="0x888800" >pictures </span><span>or </span><span color="0xffff" >conversations </span><span>in it, `and what is the use of a book,' thought </span><span color="0xff0000" >Alice `</span><span>without </span><span color="0x888800" >pictures </span><span>or </span><span color="0xff00" >conversation?'</span></p>
    <p>
    <img width="100" source="assets/library/alice/images/White Rabbit.png" height="100"/>
    <span>So she was </span><span color="0xffff" >considering </span><span>in her own mind</span><span>(</span><span>as well as she could, for the hot day made her feel </span><span color="0xff00" >very </span><span>sleepy and stupid), whether the pleasure of making a daisy-chain would be </span><span color="0x880000" >worth </span><span>the trouble of getting up and picking the daisies, when suddenly a White </span><span color="0xff00" >Rabbit </span><span>with pink eyes ran close by her.</span></p>
    </div>
    A bit of MXML code:
        <s:Group id="myGroup" width="100%" height="100%">
            <s:RichEditableText id="myRichText" lineBreak="toFit">
            </s:RichEditableText>
            <!--- Do not set the height of the RichEditableText - since it seems to prevent the appearance of the vertical scroll bars -->
        </s:Group>
    And some Actionscript that adds components:
                scroller = new SxScroller();
                scroller.dx = dxScroller;
                scroller.dy = dyScroller;
                scroller.addEventListener(FlexEvent.CREATION_COMPLETE,scrollerEvent);
                scroller.addEventListener(FlexEvent.UPDATE_COMPLETE,scrollerEvent);
                richText = scroller.richText;
                richText.editable = false;  // textCharacter.enableEdit; // probably false.  TODO:  support true???
                richText.selectable = true; // required
                richText.width = dxRichText;
    And finally the import of a TextFlow string:
    richText.textFlow = TextFlowUtil.importFromString(textFlowString, WhiteSpaceCollapse.PRESERVE);

    On the TextFlow forum I found the answer:
    Use Flash Builder Hero, since it support TLF 2.0 out-of-the-box.  The InlineGraphics support several valuable attributes, including float="left" etc.
    Beautiful.

  • Problem with Loader, trying to load multiple png files, error 1069 on the contentLoaderInfo

    Hi helpers !@
    im trying to load multiple external png files from a folder.  the path for the images comes from an xml attribute and i got no problem with the path. The error message pops on when i try to add the loader into an array for later use and then when im done remove each child i created.  There is something in my pratice that is not ok , i meen i know im wrong with at some point !  Duh theres an Error message for each loader i create .. .
    ReferenceError: Error #1069: Property Loader not found on flash.display.LoaderInfo and there is no default value.
    here some code  , pls  guide me !
    function affichageM(){
      var nodeM:XML;
    for each ( nodeM in listeM ){
       var reqM:String = localLogoM + nodeM.attribute("icon_max2");
       var imageLoaderJ = new Loader();
       imageLoaderJ.contentLoaderInfo.addEventListener(Event.INIT,addM);
       imageLoaderJ.load(new URLRequest(reqM));
         // just counting for fun
       iNodeM ++;
    function addM(e:Event){
    try { var l_img:Loader = Loader(e.currentTarget.Loader);
           l_img.name = "imageLoaderJ" + mc_ArrayImg.length().toString() ;
           l_img.visible = false;
           mc_ArrayImg.push(l_img);
           mc_Jour.addChild(l_img);
             //calling the fucntion that will animate all img in the array and had some text to them.....
          drawMyImg(mc_ArrayMImg.length()-1);
    catch (error:Error) {
           //just counting errors for fun
          iErreurM++;
            var errorMessage:TextField = new TextField();
            errorMessage.autoSize = TextFieldAutoSize.LEFT;
            errorMessage.textColor = 0xFF0000;
            errorMessage.text = error.message + " " +  mc_Jour.numChildren + " " + mc_ArrayImg.length;
            errorMessage.x = 10*iErreurM;
            addChild(errorMessage);
            return;

    Hi, I'm not sure you are on the correct forum. This is the Flash Player forum. When you first open your thread, look to your right "More like This" and perhaps one of those forums would be helpful. Perhaps the Flash forum?
    Thanks,
    eidnolb

  • HTMLLoader problem with comboBox

    hi guys
    I'm trying to loader pdf file using XML to retrieve the URL  and I have CombBox to list all the files ,and I need to load another file every time I change the silder for the CombBox
    the problem is the pdf file load only first time and dosent  change if I select another one from the list, I dont know what the the probelm I tried manything like removeChild and I tried to use container but no change, only first time the file loaded
    this is the code
    cb_list.addEventListener(
    SliderEvent.CHANGE,changehandler);
    function changehandler(e:Event):void {
        var sort1:String=cb_list.value;
        var id:String = myXML.tip.(title == sort1)[email protected]();
         //trace(id)
        var slectedtip = myXML.tip.(title == sort1).fulltip.text();
        tit_label.text=myXML.tip.(@ID == id).title .text();
        date_label.text=myXML.tip.(@ID == id).date.text();
        full_tip.text=myXML.tip.(@ID == id).fulltip.text();
         var flashfileURL = myXML.tip.(@ID == id).picURL.text();
        swfURL.text=flashfileURL;
        var url:String = new String();
        url= myXML.tip.(@ID == id).picURL.text().toXMLString();
        var requestpdf:URLRequest=new URLRequest(url);
         var container:Sprite = new Sprite();
        var pdf = new HTMLLoader();
        pdf.height=stage.stageHeight-150;
        pdf.width=stage.stageWidth-270;
        pdf.y=100;
        pdf.x=260;
        pdf.load(requestpdf);
           pdf.addEventListener(Event.COMPLETE, completeHandler);
        function completeHandler(event:Event):void {
            addChild(pdf);

    [problem with combobox comes infront of popup window|http://forum.java.sun.com/thread.jspa?threadID=5291468]

  • Problem with fileShare Pod.

    Hi every one
    i am using fileshare pod in an lccs based application and  facing a problem with fileshare pod.i create the pod after loing to the lccs appplication and when the synchronization event is called i load all the pods like fileshare ,whiteBoard, etc.and then pass them the connectionSession.all other pods are working but file share pod loses its connection with the service.
    Its
                       fileSharePod.isSynchronized
    property is seting to false and upload and down button is disabled.
    if any one understand the problem please guide me.thanks
    regards
    xaiban

    Hi Hironmay & Arun
    in my application i am creating my all pods in action script
    here is my code,it is not the complete code because it is in different files and too long,but the flow of creation of the pods is such like this.if you may tackle the issue it is too good otherwise i will send you the complete code.
    lccsConnectSession is the id of connectSessionContainer and iam creating this in mxml
    private function init()
    lccsConnectSession.addEventListener(SessionEvent.SYNCHRONIZATION_CHANGE,onSync_Handler);
    private function loginToLCCSService(uname:String,pwd:String,displayName:String):void
          serviceAuthenticator=new AdobeHSAuthenticator();
          serviceAuthenticator.addEventListener(AuthenticationEvent.AUTHENTICATION_SUCCESS,loginSuc cess_Handler);
          serviceAuthenticator.addEventListener(AuthenticationEvent.AUTHENTICATION_FAILURE,loginFai lure_Handler);
          serviceAuthenticator.userName=uname;
          serviceAuthenticator.password=pwd;
          if(serviceAuthenticator.userName.length>0 && serviceAuthenticator.password.length>0)
           //Alert.show("host login"+serviceAuthenticator.userName+":"+serviceAuthenticator.password);
           lccsConnectSession.authenticator=serviceAuthenticator;
              lccsConnectSession.login();
          else
           Alert.show("Invalide Password Or ID");
            private function onSync_Handler(event:SessionEvent):void
       if(!lccsConnectSession.isSynchronized)
          Alert.show("your connection with the service is lost.\n Do you want ot Reconnect?","!Warning",Alert.YES|Alert.NO,this,conAlertClose_Hanlder);
       else
        createSharedCollectionNode();
        createPods();
               lccsConnectSession.userManager.setUserDisplayName(lccsConnectSession.userManager.getUserD escriptor(lccsConnectSession.userManager.myUserID).userID,displayName1);
    private function createPods():void
       //Alert.show("hostAppload");
       createScreenSharePod();
       createSharedWhiteBoardPod();
           createTextChatPod();
                createVideoChatPod();
                createSharedNotesPod();
                  createSharedFilesPod();
           private function createSharedFilesPod():void
           fileSharePod=new FileShare();
           fileSharePod.addEventListener(CollectionNodeEvent.SYNCHRONIZATION_CHANGE,onSyn);
           fileSharePod.id="fshare";
           fileSharePod.connectSession=lccsConnectSession;
           fileSharePod.subscribe();
    private function onSyn(event:CollectionNodeEvent):void
         Alert.show("synchange"+fileSharePod.isSynchronized);
    like createSharedFilesPod method ,i create the other pods like whiteBoard,sharedNotes,chatPod etc

  • Some strange problem with Flash/As3

    Hi,
    I am having some strange problem with my flash cs3.
    Whatever script I write in as3  doesn't work, even a stop() function doesn't work . But when I change my publish setting to as2 it works fine.
    Not sure about the root cause, may be some setting or preference or my cs3 is corrupted.
    Can anybody please advise.
    Thanks,
    Kishor

    try this
    create a new fla as3,
    select frame 1
    open the actions panel
    paste in the following code
    var squares:Array = new Array;
    setup();
    function setup():void {
        for (var i = 0; i < 25; i++) {
            var square:Sprite = new Sprite();
            //square.name = "square" + i;
            square.graphics.beginFill(Math.random() * 0xffffff);
            squares.push(square);
            squares[i].graphics.drawRect(0, 0, 100, 100);
            squares[i].x = i*3;
            squares[i].y = i*3;
            squares[i].filters = [];
            square.graphics.endFill();
            stage.addChild(squares[i]);
    for (var j = 0; j < squares.length; j++) {
        squares[j].addEventListener(MouseEvent.MOUSE_DOWN, dragMovie);
        squares[j].addEventListener(MouseEvent.MOUSE_UP, dropMovie);
        squares[j].buttonMode = true;
    function dragMovie(event:MouseEvent):void {
        event.target.startDrag();
    function dropMovie(event:MouseEvent):void {
        event.target.stopDrag();

  • Memory leak problems with loading videos over and over.

    I'm having memory leak problems with loading videos into a VideoPlayer aswell as FLVPlayback.
    What the flash should do:
    - Should be running for 7 days without having to restart the projector.
    - Interface that shows people around a 360 3D model with 5 different parts and at the stops it makes during the rotation you can click to zoom in on a location which plays a movie for that aswell.
    - Shows a video out of 5 parts for a 360 rotation in 3D in mp4 video (added each time and cleaned up, see code below).
    - Still images are used when the video clips are done playing (MovieClip in stage).
    - Should run automatically when there is no user interaction for X minutes.
    What the problem is:
    - The flash (as a exe and swf i guess) starts to consume memory over time (say 10 hours) until the projector crashes. This usually at around 1.75 GB of memory.
    I cannot see why the Flash cannot garbage collect this and free up the memory. Mabye there is something I don't understand about the garbage collection in flash?
    Here is some code from the video loading and playing:
    var fVideo:VideoPlayer;
    VideoCreate();
    function VideoReady(pEvent:VideoEvent):void
    trace("VideoReady()");
         // start playing video
    fVideo.play();
    function VideoLoad(pUrl:String):void
         trace("VideoLoad(" + pUrl +
         VideoCreate();
         if (pUrl != "")
              if (fVideoFolder + pUrl == fVideo.source)
                   fVideo.seek(0);
    VideoReady(null);
              } else {
    trace(fVideo.state);
                   if (fVideo.state !=
    VideoState.DISCONNECTED) fVideo.stop();
    fVideo.close();                                
    fVideo.load(fVideoFolder + pUrl);
         } else {
    // error no url
    function VideoCreate():void
         trace("VideoCreate()");
         // remove old one
         if (getChildAt(0) == fVideo)
              removeChildAt(0);
         fVideo = new
    VideoPlayer(1024, 768);
         addChildAt(fVideo, 0);
         fVideo.autoRewind = false;
    fVideo.addEventListener(VideoEvent.COMPLETE, VideoDonePlaying);
    fVideo.addEventListener(VideoEvent.READY, VideoReady);

    Hmm. It's in connection with Dropbox. Så apparantly you can only use one of the two at the same time if you want the programs integrated in Finder.

  • I have some problems with work in Flash cs6

    I have some problem with my game when I created it using adobe flash cs6
    When the duck hits the screen, like from right to left it shows
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
      at Duck/ducksmove()
      at flash.utils::Timer/_timerDispatch()
      at flash.utils::Timer/tick()
    This is the code so please help check which is wrong
    package  {
      import flash.display.MovieClip;
      import flash.utils.Timer;
      import flash.events.TimerEvent;
      import flash.events.MouseEvent;
      public class Duck extends MovieClip {
      var moveDuck:Timer = new Timer(10);
      var speedX:Number;
      public function Duck() {
      this.addEventListener(MouseEvent.CLICK,KillDuck);
      moveDuck.addEventListener(TimerEvent.TIMER,ducksmove);
      moveDuck.start();
      speedX = 10;
            function ducksmove(evt:TimerEvent):void
      this.x -= speedX;
      if (this.x <=0)
      moveDuck.stop();
      moveDuck.removeEventListener(TimerEvent.TIMER,ducksmove);
      this.parent.removeChild(this);
      function KillDuck(evt:MouseEvent):void
      var p:MovieClip = this.parent as MovieClip;
      p.setScore();
      p.updatecount();
      this.removeEventListener(MouseEvent.CLICK,KillDuck);
      this.parent.removeChild(this);
      moveDuck.addEventListener(TimerEvent.TIMER,ducksmove);

    You appear to be trying to remove the same object twice, first in the KillDuck function and then in the ducksmove function.  If it is removed already you can't try to remove it again because it is no longer in the display list.

  • Problem with removeEventListener

    Hi
    I have a code:
    package
         import adobe.utils.CustomActions;
         import flash.display.MovieClip;
         import flash.events.MouseEvent;
         import flash.text.TextField;
         import flash.events.*;
         import flash.utils.getTimer;
         public class MyMatching extends MovieClip
              public var play_btn:MyButton = new MyButton();//creating new object play_btn
              public var xIconsContainer=100;//all icons start to draw from this x
              public var yIconsContainer=100;//all icons start to draw from this y
              private var iconsVertical=2;//icons columns
              private var iconsHorizontal=2;//icons rows
              private var firstIcon;//player click to first icon
              private var secondIcon;//player click to second icon
              private var deletedIcons;//if firstIcon==secondIcon we will delete 2 icons
              //private var myTimer:MyTimer;
              public var startTime:int = getTimer();
              public var timeString:String;
              private var playerScoreSum:int;//sum of all players points
              private var playerScorePreview:TextField;//showing players points to the window
              private var matchPoints:int = 20;//if player match 2 icons we add 20 points to his playerScoreSum
              private var missPoints:int = 1;//if miss we delete 1 points from playerScoreSum
              //constructor
              public function MyMatching():void
                   welcomeScreen();
                   deletedIcons = 0;
                   playerScoreSum = 0;
              public function welcomeScreen():void
                   gotoAndStop('WelcomeScreen');
                   play_btn.x=210;
                   play_btn.y=300;
                   play_btn.visible=true;
                   addChild(play_btn);//draw play_btn object
                   play_btn.addEventListener(MouseEvent.CLICK, goToLevel_1);//added event for the play_btn object
              public function startingStopwatch():void
                   addEventListener(Event.ENTER_FRAME, stopwatch);
              public function stopingStopwatch():void
                   removeEventListener(Event.ENTER_FRAME, stopwatch);
              public function stopwatch(event:Event)
                   var timePassed:int = getTimer()-startTime;
                   var seconds:int = Math.floor(timePassed/1000);
                   var minutes:int = Math.floor(seconds/60);
                   seconds -= minutes*60;
                   timeString = minutes + ":" + String(seconds + 100).substr(1, 2);
                   stopwatch_txt.text = timeString;
              public function goToLevel_1(event:MouseEvent)
                   play_btn.visible=false;
                   gotoAndStop('Level_1');
                   startingStopwatch();
                   var iconsArray:Array = new Array();//creating new object iconsArray
                   for (var i:int; i < iconsVertical*iconsHorizontal/2; i++)
                        iconsArray.push(i);
                        iconsArray.push(i);
                   trace(iconsArray);
                   //added timer to the screen
                   //myTimer = new MyTimer();
                   //addChild(myTimer);
                   //added score to the sceen
                   playerScorePreview = new TextField();
                   playerScorePreview.text = String(playerScoreSum);
                   playerScorePreview.x=200;
                   playerScorePreview.y=0;
                   addChild(playerScorePreview);
                   for (var x:int = 0; x < iconsVertical; x++)
                        for (var y:int = 0; y < iconsHorizontal; y++)
                             var iconsList:Icon = new Icon();
                             addChild(iconsList);
                             iconsList.stop();
                             iconsList.x=x*51+xIconsContainer;
                             iconsList.y=y*51+yIconsContainer;
                             var myRandom:int=Math.floor(Math.random()*iconsArray.length);//creates a random number that will be related to an index of the array named "iconsArray"
                             //var showIcon;//cast as whatever type of element the array is holding
                             iconsList.showIcon=iconsArray[myRandom];//assigns the randomly selected element of iconsArray to the variable showIcon
                             iconsArray.splice(myRandom,1);//removes the randomly selected element (now showIcon) from the array (not the last one, the random one) //we use the splice command to remove number from the array so that it won’t be used again
                             //iconsList.gotoAndStop(iconsList.showIcon+2);//showIcon+2 would be the next frame in the timeline after the frame for the random item deleted, so that code is essentially moving in the timeline to the frame just after the frame for the item that was removed from the array
                             trace(myRandom);
                             iconsList.addEventListener(MouseEvent.CLICK, clickToIcon);
                             deletedIcons++;//when we draw icons we every time add +2 icons to our deletedIcons variable, in future we will deleted 2 icons from this variable if firstIcon==secondIcon
                   trace("*************************random finished ******************************");
              public function clickToIcon(event:MouseEvent)
                   var thisIcon:Icon = (event.currentTarget as Icon);//what icon player clicked...
                   trace(thisIcon.showIcon);//trace clicked icon to the output pannel
                   if (firstIcon==null)
                        firstIcon=thisIcon;
                        firstIcon.gotoAndStop(thisIcon.showIcon + 2);
                   else if (firstIcon == thisIcon)
                        firstIcon.gotoAndStop(1);
                        firstIcon=null;
                   else if (secondIcon==null)
                        secondIcon=thisIcon;
                        secondIcon.gotoAndStop(thisIcon.showIcon + 2);
                        if (firstIcon.showIcon==secondIcon.showIcon)
                             playerScoreSum += matchPoints;// +20 points for playerScoreSum
                             playerScorePreview.text = String(playerScoreSum);
                             removeChild(firstIcon);
                             removeChild(secondIcon);
                             deletedIcons -= 2;
                             if (deletedIcons == 0)
                                  //myTimer.Stop();//stoping timer, so now we know how time player spend to playing the level 1
                                  stopingStopwatch();
                                  stopwatch_txt.text = timeString;//why i don't see time?
                                  gotoAndStop('GameoverScreen');//if player match all icons we go to GameoverScreen                              
                        else
                             playerScoreSum -= missPoints;// -1 point from playerScoreSum
                             playerScorePreview.text = String(playerScoreSum);
                   else
                        firstIcon.gotoAndStop(1);
                        secondIcon.gotoAndStop(1);
                        firstIcon = null;
                        secondIcon = null;
    There problem with my timer.
    Code for timer:
    public var startTime:int = getTimer();
              public var timeString:String;
    public function startingStopwatch():void
                   addEventListener(Event.ENTER_FRAME, stopwatch);
              public function stopingStopwatch():void
                   removeEventListener(Event.ENTER_FRAME, stopwatch);
              public function stopwatch(event:Event)
                   var timePassed:int = getTimer()-startTime;
                   var seconds:int = Math.floor(timePassed/1000);
                   var minutes:int = Math.floor(seconds/60);
                   seconds -= minutes*60;
                   timeString = minutes + ":" + String(seconds + 100).substr(1, 2);
                   stopwatch_txt.text = timeString;
    When i come to function 'goToLevel_1' i start funciton 'startingStopwatch();'
    So all working i see my stopwatching.. time going..
    Then when i go to gameover screen i don't see a timer:
    if (deletedIcons == 0)
                                  //myTimer.Stop();//stoping timer, so now we know how time player spend to playing the level 1
                                  stopingStopwatch();
                                  stopwatch_txt.text = timeString;//why i don't see time?
                                  gotoAndStop('GameoverScreen');//if player match all icons we go to GameoverScreen                              
    Why its happend?
    And one more question:
    When i click to play_btn i see error in output window:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at MyMatching/stopwatch()
    how i can fix it?
    Thank you.

    The 1009 error indicates that one of the objects being targeted by your code is out of scope, and I suspect it involves your stopwatch_txt textfield.  This could mean that the object....
    - is not in the display list
    - doesn't have an instance name (or the instance name is mispelled)
    - does not exist in the frame where that code is trying to talk to it
    - is animated into place but is not assigned instance names in every keyframe for it
    - is one of two or more consecutive keyframes of the same objects with different names assigned.
    If you go into your Publish Settings Flash section and select the option to Permit debugging, your error message should have a line number following the frame number which will help you isolate which object is involved.

Maybe you are looking for