TextLayout error 1009

I have a web chat room application used textflow to render the user message embed swf emotions. After I updated to flex 4.5 sdk, I get these errors oftenly and I just can't debug with it so I don't where went wrong exactly. Please Help me out , or just point out in what situtation will cause this error
Thanks a lot
TypeError: Error #1009:
       at flashx.textLayout.container::ContainerController/http://ns.adobe.com/textLayout/internal/2008::updateGraphics()[C:\Vellum\branches\v2\2.0\d ev\output\openSource\textLayout\src\flashx\textLayout\container\ContainerController.as:318 2]
       at flashx.textLayout.container::ContainerController/http://ns.adobe.com/textLayout/internal/2008::updateCompositionShapes()[C:\Vellum\branches \v2\2.0\dev\output\openSource\textLayout\src\flashx\textLayout\container\ContainerControll er.as:3080]
       at flashx.textLayout.compose::StandardFlowComposer/updateCompositionShapes()[C:\Vellum\branc hes\v2\2.0\dev\output\openSource\textLayout\src\flashx\textLayout\compose\StandardFlowComp oser.as:616]
       at flashx.textLayout.compose::StandardFlowComposer/updateToController()[C:\Vellum\branches\v 2\2.0\dev\output\openSource\textLayout\src\flashx\textLayout\compose\StandardFlowComposer. as:559]
       at flashx.textLayout.compose::StandardFlowComposer/updateAllControllers()[C:\Vellum\branches \v2\2.0\dev\output\openSource\textLayout\src\flashx\textLayout\compose\StandardFlowCompose r.as:517]
       at flashx.textLayout.container::TextContainerManager/updateContainer()[C:\Vellum\branches\v2 \2.0\dev\output\openSource\textLayout\src\flashx\textLayout\container\TextContainerManager .as:1343]
       at spark.components::RichEditableText/updateDisplayList()[E:\dev\hero_private\frameworks\pro jects\spark\src\spark\components\RichEditableText.as:2944]
       at mx.core::UIComponent/validateDisplayList()[E:\dev\hero_private\frameworks\projects\framew ork\src\mx\core\UIComponent.as:8989]
       at mx.managers::LayoutManager/validateDisplayList()[E:\dev\hero_private\frameworks\projects\ framework\src\mx\managers\LayoutManager.as:736]
       at mx.managers::LayoutManager/doPhasedInstantiation()[E:\dev\hero_private\frameworks\project s\framework\src\mx\managers\LayoutManager.as:819]
       at mx.managers::LayoutManager/doPhasedInstantiationCallback()[E:\dev\hero_private\frameworks \projects\framework\src\mx\managers\LayoutManager.as:1180]

Ok,I reproduce it with the code below, replace the 04.swf with any small swf animation is ok
click the button will raise the exception
Is there any workaround ?
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
                               xmlns:s="library://ns.adobe.com/flex/spark"  creationComplete="application1_creationCompleteHandler(event)"
                               xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="400" minHeight="300" xmlns:local="*"
                                >
         <fx:Script>
                   <![CDATA[
                            import flashx.textLayout.elements.InlineGraphicElement;
                            import flashx.textLayout.elements.ParagraphElement;
                            import flashx.textLayout.elements.TextFlow;
                            import flashx.textLayout.formats.WhiteSpaceCollapse;
                            import mx.events.FlexEvent;
                            import spark.utils.TextFlowUtil;
                            [Bindable]
                            private var chatTLF:TextFlow;
                            protected function application1_creationCompleteHandler(event:FlexEvent):void
                                    var str:String = "";
                                     var i:int = 30;
                                     while(i>0){
                                               str += i+"\n"
                                               i--;
                                    chatTLF = TextFlowUtil.importFromString(str,WhiteSpaceCollapse.PRESERVE);
                                     var p:ParagraphElement = new ParagraphElement();
                                     var graphicElement:InlineGraphicElement = new InlineGraphicElement();
                                     graphicElement.source = "04.swf";
                                     graphicElement.width  = 28;
                                     graphicElement.height = 30;
                                     p.addChild(graphicElement);
                                     chatTLF.addChildAt(0,p);
                            protected function chatContentBox_updateCompleteHandler(event:FlexEvent):void
                                     callLater(function():void{
                                               scroller.verticalScrollBar.viewport.verticalScrollPosition = scroller.verticalScrollBar.maximum;
                            protected function button1_clickHandler(event:MouseEvent):void
                                     var tf:TextFlow = TextFlowUtil.importFromString("aaa",WhiteSpaceCollapse.PRESERVE);
                                     for each(var p:ParagraphElement in tf.mxmlChildren){
                                               chatTLF.addChild(p);
                   ]]>
         </fx:Script>
         <fx:Declarations>
                   <!-- Place non-visual elements (e.g., services, value objects) here -->
         </fx:Declarations>
         <s:Scroller id="scroller" x="10" y="10" width="138" height="226" verticalScrollPolicy="on">
                   <s:RichEditableText id="chatContentBox" editable="false" focusEnabled="false"  updateComplete="chatContentBox_updateCompleteHandler(event)"
                                                                 textAlign="left" textFlow="{chatTLF}"/>
         </s:Scroller >
         <s:Button x="62" y="288" click="button1_clickHandler(event)" label="click me"/>
</s:Application>

Similar Messages

  • Flowcomposer updateAllControllers Error #1009

    Hello Forum,
    I get Error #1009 when I'm calling flowcomposer.updateAllControllers of my textflow AND the text is too big to fit in my container...
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at flashx.textLayout.compose::BaseCompose/parcelHasChanged()
    at flashx.textLayout.compose::BaseCompose/advanceToNextParcel()
    at flashx.textLayout.compose::BaseCompose/fitLineToParcel()
    at flashx.textLayout.compose::ComposeState/composeNextLine()
    at flashx.textLayout.compose::BaseCompose/composeParagraphElementIntoLines()
    at flashx.textLayout.compose::BaseCompose/composeParagraphElement()
    at flashx.textLayout.compose::ComposeState/composeParagraphElement()
    at flashx.textLayout.compose::BaseCompose/composeBlockElement()
    at flashx.textLayout.compose::BaseCompose/composeInternal()
    at flashx.textLayout.compose::ComposeState/composeInternal()
    at flashx.textLayout.compose::BaseCompose/composeTextFlow()
    at flashx.textLayout.compose::ComposeState/composeTextFlow()
    at flashx.textLayout.compose::StandardFlowComposer/http://ns.adobe.com/textLayout/internal/2008::callTheComposer()
    at flashx.textLayout.compose::StandardFlowComposer/internalCompose()
    at flashx.textLayout.compose::StandardFlowComposer/updateToController()
    at flashx.textLayout.compose::StandardFlowComposer/updateAllControllers()
    Does anyone know why I get this error? My solution now is to just ignore the error with a try and catch...it works, but I don't like it....

    O.k.! I was making a small test to try and reproduce the error:
    package {
    import flash.display.Sprite;
    import flashx.textLayout.formats.TextLayoutFormat;
    import flashx.textLayout.container.ContainerController;
    import flashx.textLayout.elements.ParagraphElement;
    import flashx.textLayout.elements.SpanElement;
    import flashx.textLayout.elements.TextFlow;
    public class Test extends Sprite
      public function Test() {
       var tekstLayoutFormat:TextLayoutFormat = new TextLayoutFormat();
       var cs:Sprite = new Sprite();
       addChild(cs);
       var textFlow:TextFlow = new TextFlow();
       textFlow.format = tekstLayoutFormat;
       textFlow.flowComposer.addController(new ContainerController(cs, 400, 10));
    //   textFlow.flowComposer.updateAllControllers();
       var paragraphElement = new ParagraphElement();
       var spanElement = new SpanElement();
       spanElement.text = "sdgfsd";
       spanElement.fontSize = 70;
       paragraphElement.addChild(spanElement);
       textFlow.addChild(paragraphElement);
       textFlow.flowComposer.updateAllControllers();
    i get this result:
    but when I call textFlow.flowComposer.updateAllControllers(); twice (also earlier in the test-program), i get this result:
    Why is there a difference?

  • Error #1009, Is this a bug?

    I am using latest build of TLF (418),  when I tried to bind textFlows to the textFlow setter in SimpleEditorPanel(the Adobe example), the textFlows are from an ArrayCollection, the binding looks like:
    <local:SimpleEditorPanel id="simpleEditor"
                        textFlow="{TextFilter.importToFlow(this.myModel.userResponse.pageContent.getItemAt(this.m yModel.userResponse.currentPageNum).content, TextFilter.TEXT_LAYOUT_FORMAT)}" />
    Basically, I need to dynamically add pages, each page stores in a textFlow,
    I also added a listener to listen the damageEvent, if a textFlow's got changed, then the listener function exports the textFlow to the ArrayCollection,
    I've got the following error when I tried to edit a textflow:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at flashx.textLayout.edit::EditManager/finalizeDo()
        at flashx.textLayout.edit::EditManager/doOperation()
        at flashx.textLayout.edit::EditManager/flushPendingOperations()
        at flashx.textLayout.edit::SelectionManager/enterFrameHandler()
    Is this a bug? any suggestions to work around?
    Thanks in advance.

    When a TextFlow is deepCopied the new returned TextFlow will have a flowComposer created using the origianl's configuration.  The configuration specifies a flowComposerClass and a flowComopser of that class is created.  No interactionManager is created.  That's by design.
    When a TextFlow is us create a TextScrap for a clipboard the flowComposer is nulled.  That's the only place I know of where we clear the flowComposer.  That's also by design - a flowComposer isn't useful on the clipboard at this time.
    I don't understand the ArrayCollection issue from the description.  Do you have a code snippet that demonstrates the flowComposer getting nulled by TLF?
    Best Regards,
    Richard

  • Error #1009 Using SpellUIForTLF

    The error occurs when you activate the spelling
    APPLICATION
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
       xmlns:s="library://ns.adobe.com/flex/spark"
       xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" initialize="application1_initializeHandler(event)">
    <fx:Declarations>
    <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <fx:Script>
    <![CDATA[
    import com.adobe.linguistics.spelling.SpellUIForTLF;
    import flashx.textLayout.elements.TextFlow;
    import mx.events.FlexEvent;
    import spark.utils.TextFlowUtil;
    [Bindable]
    public var flow:TextFlow = TextFlowUtil.importFromString("<TextFlow xmlns='http://ns.adobe.com/textLayout/2008'><p><span>Spell cheecking in s:RichEditableText does not woork</span></p></TextFlow>");
    protected function application1_initializeHandler(event:FlexEvent):void
    //SpellUIForTLF.spellingConfigUrl = "config/AdobeSpellingConfig.xml";
    private function enableFeature():void {
    SpellUIForTLF.enableSpelling(richTextArea.textFlow, "en_US");
    private function disableFeature() :void {
    SpellUIForTLF.disableSpelling(richTextArea.textFlow);
    ]]>
    </fx:Script>
    <s:layout>
    <s:VerticalLayout />
    </s:layout>
    <s:HGroup>
    <s:Button id="tt2" label="enable Feature" click="enableFeature()" />
    <s:Button id="tt1" label="disable Feature" click="disableFeature()" />
    </s:HGroup>
    <s:RichEditableText id="richTextArea" width="100%" height="100%" fontSize="30" textFlow="{flow}"/>
    </s:Application>
    ERROR
    TypeError: Error #1009: No se puede acceder a una propiedad o a un método de una referencia a un objeto nulo.
    at flashx.textLayout.container::TextContainerManager/getContentBounds()[C:\Vellum\branches\v 1\1.1\dev\output\openSource\textLayout\src\flashx\textLayout\container\TextContainerManage r.as:644]
    at spark.components::RichEditableText/textContainerManager_compositionCompleteHandler()[E:\d ev\4.x\frameworks\projects\spark\src\spark\components\RichEditableText.as:3990]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flashx.textLayout.container::TextContainerManager/dispatchEvent()[C:\Vellum\branches\v1\1 .1\dev\output\openSource\textLayout\src\flashx\textLayout\container\TextContainerManager.a s:1472]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flashx.textLayout.elements::TextFlow/dispatchEvent()[C:\Vellum\branches\v1\1.1\dev\output \openSource\textLayout\src\flashx\textLayout\elements\TextFlow.as:773]
    at flashx.textLayout.compose::StandardFlowComposer/http://ns.adobe.com/textLayout/internal/2008::callTheComposer()[C:\Vellum\branches\v1\1.1\ dev\output\openSource\textLayout\src\flashx\textLayout\compose\StandardFlowComposer.as:690 ]
    at flashx.textLayout.compose::StandardFlowComposer/internalCompose()[C:\Vellum\branches\v1\1 .1\dev\output\openSource\textLayout\src\flashx\textLayout\compose\StandardFlowComposer.as: 758]
    at flashx.textLayout.compose::StandardFlowComposer/updateToController()[C:\Vellum\branches\v 1\1.1\dev\output\openSource\textLayout\src\flashx\textLayout\compose\StandardFlowComposer. as:557]
    at flashx.textLayout.compose::StandardFlowComposer/updateAllControllers()[C:\Vellum\branches \v1\1.1\dev\output\openSource\textLayout\src\flashx\textLayout\compose\StandardFlowCompose r.as:519]
    at com.adobe.linguistics.spelling::SpellingContextMenuForTLF()[E:\glo_lib\esg\users\ravi\squ iggly\main\AdobeSpellingUITLF\src\com\adobe\linguistics\spelling\SpellingContextMenuForTLF .as:95]
    at com.adobe.linguistics.spelling::SpellUIForTLF/addContextMenu()[E:\glo_lib\esg\users\ravi\ squiggly\main\AdobeSpellingUITLF\src\com\adobe\linguistics\spelling\SpellUIForTLF.as:481]
    at com.adobe.linguistics.spelling::SpellUIForTLF/loadDictComplete()[E:\glo_lib\esg\users\rav i\squiggly\main\AdobeSpellingUITLF\src\com\adobe\linguistics\spelling\SpellUIForTLF.as:464 ]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at com.adobe.linguistics.spelling.framework::SpellingService/loadDictComplete()[E:\glo_lib\e sg\users\ravi\squiggly\main\AdobeSpellingFramework\src\com\adobe\linguistics\spelling\fram ework\SpellingService.as:110]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at com.adobe.linguistics.spelling::HunspellDictionary/loadDictionaryComplete()[E:\glo_lib\es g\users\ravi\squiggly\main\AdobeSpellingEngine\src\com\adobe\linguistics\spelling\Hunspell Dictionary.as:150]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at com.adobe.linguistics.spelling.core.utils::SquigglyDictionaryLoader/loadDictionaryComplet e()[E:\glo_lib\esg\users\ravi\squiggly\main\AdobeSpellingEngine\src\com\adobe\linguistics\ spelling\core\utils\SquigglyDictionaryLoader.as:205]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at com.adobe.linguistics.spelling.core.utils::DictionaryLoader/handleComplete()[E:\glo_lib\e sg\users\ravi\squiggly\main\AdobeSpellingEngine\src\com\adobe\linguistics\spelling\core\ut ils\DictionaryLoader.as:83]
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/onComplete()

    In his code he is sending a TextFlow as the parameter to SpellUIForTLF.enableSpelling.  So does it matter whether it is a  text flow from RichEditableText, as long as it is a TextFlow ?
    SpellUIForTLF.enableSpelling(richTextArea.textFlow, "en_US");
    Could you please explain what you mean by
    "So in this particular case using SpellUIforTLF for TextFlow inside RichEditableText is the problem.
    For now you may try to use SpellUIforTLF on TextFlow and make your own custom containers instead of using RichEditableText."
    Asking this to get it clarified, as I am also going to use Squiggly in my TLF editor. Me too using RichEditableText. So I am going to use it like this.
                             var currentEditor:RichEditableText = editors.getChildByName(itemName) as RichEditableText;
                             var currTextFlow:TextFlow = currentEditor.textFlow.deepCopy() as TextFlow;                      
                             SpellUIForTLF.enableSpelling(currTextFlow, "en_US");
    Anything wrong with this?
    Thanks

  • Error #1009 in /computeSelectionIndexInContainer()

    TypeError: Error #1009: Cannot access a property or method of
    a null object reference.
    at
    flashx.textLayout.edit::SelectionManager$/computeSelectionIndexInContainer()
    at flashx.textLayout.edit::SelectionManager$/
    http://ns.adobe.com/textLayout/internal/2008::computeSelectionIndex()
    at flashx.textLayout.edit::SelectionManager/selectionPoint()
    at
    flashx.textLayout.edit::SelectionManager/setNewSelectionPoint()
    at
    flashx.textLayout.edit::SelectionManager/mouseDownHandler()
    at
    flashx.textLayout.container::ContainerControllerBase/processMouseDownEvent()
    at flashx.textLayout.container::ContainerControllerBase/
    http://ns.adobe.com/textLayout/internal/2008::mouseDownHandler()
    Sometimes when i just drag mouse on tf container, it throws
    this exception. Quite many times.

    I am not sure if I can be a help but you can try this anyway.... Thanks!
    Issue
    Issue FLEXENT-742 has been logged against AdobeFlex Builder Professional when used with the Automated Testing module and the AdvancedDataGrid. Specifically, when using Quick Test Pro to record a "select" action on a cell with a RendererProvider as the content holder, the following ActionScript error is displayed:
    An ActionScript error has occurred:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
    Solution
    The following procedure may be used to work around this error:
    Download the following ActionScript file:
    http://bugs.adobe.com/jira/secure/attachment/17407/AdvancedListBaseContentHolderAutomation Impl.as
    <!--[if !supportLists]-->
    Add this file into the src folder of the Flex Builder project and include this delegate using the -includes option as follows:
    -locale en_US -includes AdvancedListBaseContentHolderAutomationImpl
    -include-libraries
    "C:\Work\flex\sdk_3.0.0.256\frameworks\libs\automation.swc"
    "C:\Work\flex\sdk_3.0.0.256\frameworks\libs\automation_dmv.swc"
    "C:\Work\flex\sdk_3.0.0.256\frameworks\libs\automation_agent.swc"
    "C:\Work\flex\sdk_3.0.0.256\frameworks\libs\qtp.swc

  • Error #1009 in my Platform Game! Please Help!!!

    In my basic platform game I have a "hero" that can walk and jump on the "ground." There is also a door to the next scene, which is the next level.The first scene works fine, but "TypeError: Error #1006: value is not a function. at Charles3_fla::MainTimeline/frame1()" pops up once in the output. It works however, and I'm not worried about it. The second I go throught the door though, Scene 2 opens, but then starts flashing as "TypeError: Error #1009: Cannot access a property or method of a null object reference. at Charles3_fla::MainTimeline/onenter()" pops up A LOT in the output. I don't know how to fix it, and would like help. P.S. I am using Adobe CS5 with actionscript 3
    Here is the code for Scene 1:
    hero.gotoAndStop('still');
    var Key:KeyObject = new KeyObject(stage);
    var vy:Number=0;
    var gravity:Number=2;
    var jumped:Boolean = false;
    stage.addEventListener(Event.ENTER_FRAME,onenter)(true);
    function onenter(e:Event):void{
    vy+=gravity;
    if(! ground.hitTestPoint(hero.x,hero.y,true)) {
      hero.y+vy;
    if(ground.hitTestPoint(hero.x+(hero.width/2), hero.y-(hero.height/2), true)) {
      hero.x-=13;
    if(ground.hitTestPoint(hero.x-(hero.width/2), hero.y-(hero.height/2), true)) {
      hero.x+=13;
    if (vy>10) {
      vy=10;
    for (var i:int = 0; i<10; i++) {
      if (ground.hitTestPoint(hero.x,hero.y,true)) {
       hero.y--;
       vy=6;
       jumped=true;
    if(door.hitTestObject(hero)){
        gotoAndPlay(1,"Scene 2");
    if(hero.y>300){
      vy=6;
      jumped=true;
      if(Key.isDown(Key.UP) && jumped){
       vy=-13;
       jumped=false;
       hero.y+=vy;
    if(Key.isDown(Key.RIGHT)){
      hero.x+=10;
      hero.scaleX=1;
      hero.gotoAndStop('walking');
      }else if(Key.isDown(Key.LEFT)){
      hero.x-=10;
      hero.scaleX=-1;
      hero.gotoAndStop('walking');
      }else{
       hero.gotoAndStop('still');
    And for Scene 2...
    hero.gotoAndStop('still');
    var Key1:KeyObject =KeyObject(stage);
    var vy1:Number=0;
    var gravity1:Number=2;
    var jumped1:Boolean = false;
    stage.addEventListener(Event.ENTER_FRAME,onenter1)(true);
    function onenter1(e:Event):void{
    vy1+=gravity;
    if(! ground.hitTestPoint(hero.x,hero.y,true)) {
      hero.y+vy;
    if(ground.hitTestPoint(hero.x+(hero.width/2), hero.y-(hero.height/2), true)) {
      hero.x-=13;
    if(ground.hitTestPoint(hero.x-(hero.width/2), hero.y-(hero.height/2), true)) {
      hero.x+=13;
    if (vy1>10) {
      vy1=10;
    for (var i:int = 0; i<10; i++) {
      if (ground.hitTestPoint(hero.x,hero.y,true)) {
       hero.y--;
       vy1=6;
       jumped1=true;
    if(door.hitTestObject(hero)){
        gotoAndPlay(1,"Scene 2");
    if(hero.y>300){
      vy1=6;
      jumped1=true;
      if(Key.isDown(Key.UP) && jumped1){
       vy1=-13;
       jumped1=false;
       hero.y+=vy;
    if(Key.isDown(Key.RIGHT)){
      hero.x+=10;
      hero.scaleX=1;
      hero.gotoAndStop('walking');
      }else if(Key.isDown(Key.LEFT)){
      hero.x-=10;
      hero.scaleX=-1;
      hero.gotoAndStop('walking');
      }else{
       hero.gotoAndStop('still');
    Please reply as soon as possible, and thanks for your time
    swiatekalex555

    Ok sorry about my misunderstanding. Here's the code with the errors Highlighted. I also downloaded a "KeyObject.as" package, and the contents of that are on the bottom.
    hero.gotoAndStop('still');
    var Key:KeyObject = new KeyObject(stage);
    var vy:Number=0;
    var gravity:Number=2;
    var jumped:Boolean = false;
    stage.addEventListener(Event.ENTER_FRAME,onenter)(true);
    function onenter(e:Event):void{
    vy+=gravity;
    if(! ground.hitTestPoint(hero.x,hero.y,true)) {
      hero.y+vy;
    if(ground.hitTestPoint(hero.x+(hero.width/2), hero.y-(hero.height/2), true)) {
      hero.x-=13;
    if(ground.hitTestPoint(hero.x-(hero.width/2), hero.y-(hero.height/2), true)) {
      hero.x+=13;
    if (vy>10) {
      vy=10;
    for (var i:int = 0; i<10; i++) {
      if (ground.hitTestPoint(hero.x,hero.y,true)) {
       hero.y--;
       vy=6;
       jumped=true;
    if(door.hitTestObject(hero)){
        gotoAndPlay(1,"Scene 2");
    if(hero.y>300){
      vy=6;
      jumped=true;
      if(Key.isDown(Key.UP) && jumped){
       vy=-13;
       jumped=false;
       hero.y+=vy;
    if(Key.isDown(Key.RIGHT)){
      hero.x+=10;
      hero.scaleX=1;
      hero.gotoAndStop('walking');
      }else if(Key.isDown(Key.LEFT)){
      hero.x-=10;
      hero.scaleX=-1;
      hero.gotoAndStop('walking');
      }else{
       hero.gotoAndStop('still');
    And for Scene 2...
    hero.gotoAndStop('still');
    var Key1:KeyObject =KeyObject(stage);
    var vy1:Number=0;
    var gravity1:Number=2;
    var jumped1:Boolean = false;
    stage.addEventListener(Event.ENTER_FRAME,onenter1)(true);
    function onenter1(e:Event):void{
    vy1+=gravity;
    if(! ground.hitTestPoint(hero.x,hero.y,true)) {
      hero.y+vy;
    if(ground.hitTestPoint(hero.x+(hero.width/2), hero.y-(hero.height/2), true)) {
      hero.x-=13;
    if(ground.hitTestPoint(hero.x-(hero.width/2), hero.y-(hero.height/2), true)) {
      hero.x+=13;
    if (vy1>10) {
      vy1=10;
    for (var i:int = 0; i<10; i++) {
      if (ground.hitTestPoint(hero.x,hero.y,true)) {
       hero.y--;
       vy1=6;
       jumped1=true;
    if(door.hitTestObject(hero)){
        gotoAndPlay(1,"Scene 2");
    if(hero.y>300){
      vy1=6;
      jumped1=true;
      if(Key.isDown(Key.UP) && jumped1){
       vy1=-13;
       jumped1=false;
       hero.y+=vy;
    if(Key.isDown(Key.RIGHT)){
      hero.x+=10;
      hero.scaleX=1;
      hero.gotoAndStop('walking');
      }else if(Key.isDown(Key.LEFT)){
      hero.x-=10;
      hero.scaleX=-1;
      hero.gotoAndStop('walking');
      }else{
       hero.gotoAndStop('still');
    the KeyObject.as
    package {
    import flash.display.Stage;
    import flash.events.KeyboardEvent;
    import flash.ui.Keyboard;
    import flash.utils.Proxy;
    import flash.utils.flash_proxy;
      * The KeyObject class recreates functionality of
      * Key.isDown of ActionScript 1 and 2
      * Usage:
      * var key:KeyObject = new KeyObject(stage);
      * if (key.isDown(key.LEFT)) { ... }
    dynamic public class KeyObject extends Proxy {
      private static var stage:Stage;
      private static var keysDown:Object;
      public function KeyObject(stage:Stage) {
       construct(stage);
      public function construct(stage:Stage):void {
       KeyObject.stage = stage;
       keysDown = new Object();
       stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
       stage.addEventListener(KeyboardEvent.KEY_UP, keyReleased);
      flash_proxy override function getProperty(name:*):* {
       return (name in Keyboard) ? Keyboard[name] : -1;
      public function isDown(keyCode:uint):Boolean {
       return Boolean(keyCode in keysDown);
      public function deconstruct():void {
       stage.removeEventListener(KeyboardEvent.KEY_DOWN, keyPressed);
       stage.removeEventListener(KeyboardEvent.KEY_UP, keyReleased);
       keysDown = new Object();
       KeyObject.stage = null;
      private function keyPressed(evt:KeyboardEvent):void {
       keysDown[evt.keyCode] = true;
      private function keyReleased(evt:KeyboardEvent):void {
       delete keysDown[evt.keyCode];
    Help if you can,
    swiatekalex555

  • Error #1009 - think it has to do with a movie file

    This error keeps on coming up when im trying to complete my flash website, the error seams to linked to a movie file that is interrupting something somewhere
    this is the complete error message,
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
              at wokringonsite_fla::MainTimeline/frame3()[wokringonsite_fla.MainTimeline::frame3:16]
              at flash.display::Sprite/constructChildren()
              at flash.display::Sprite()
              at flash.display::MovieClip()
              at flash.display::MovieClip/nextFrame()
              at wokringonsite_fla::MainTimeline/updatePreloader()[wokringonsite_fla.MainTimeline::frame1: 12]
    this is the code from the begining
    stop();
    //Preloader
    loaderInfo.addEventListener(ProgressEvent.PROGRESS, updatePreloader);
    function updatePreloader(evtObj:ProgressEvent):void
              //container for the progress of the site (download)
              var percent:Number = Math.floor((evtObj.bytesLoaded*100)/evtObj.bytesTotal);
              preloader_txt.text = percent+"%";
              if (percent==100){
                        nextFrame();
    next frame
    stop();
    //Animate in the home_mc from right to left, using the Tween class.
    //Flash - go get code that's going to make the tween work...
    import fl.transitions.Tween;
    import fl.transitions.TweenEvent;
    import fl.transitions.easing.*;
    //content_mc animation - animate in..
    var homeTween:Tween = new Tween(content_mc,"x",Regular.easeOut,content_mc.x,350,1,true);
    //Move the background into place
    new Tween(bkgd_mc,"x",Regular.easeOut,bkgd_mc.x,0,1,true);
    //handle events for buttons...
    home.addEventListener(MouseEvent.CLICK, clickSection);
    about.addEventListener(MouseEvent.CLICK, clickSection);
    portfolio.addEventListener(MouseEvent.CLICK, clickSection);
    contact.addEventListener(MouseEvent.CLICK, clickSection);
    AD5.addEventListener(MouseEvent.CLICK, clickSection);
    AD6.addEventListener(MouseEvent.CLICK, clickSection);
    AD7.addEventListener(MouseEvent.CLICK, clickSection);
    tvc.addEventListener(MouseEvent.CLICK, clickSection);
    function clickSection(evtObj:MouseEvent){
              //trace shows what's happening.. in the output window
              trace ("The "+evtObj.target.name+" button was clicked!")
              //go to the section clicked on...
              gotoAndStop(evtObj.target.name);
    var aboutTween:Tween = new Tween(content_mc,"x",Regular.easeOut,content_mc.x, 0,1,true);
    //Move the background into place
    new Tween(bkgd_mc,"x",Regular.easeOut,bkgd_mc.x,-166,1,true); ------- this basic code is used for all windows from home to tvc ,
    tvc code
    var tvcTween:Tween = new Tween(content_mc,"x",Regular.easeOut,content_mc.x,-2500,1,true);
    //Move the background into place
    new Tween(bkgd_mc,"x",Regular.easeOut,bkgd_mc.x,-1500,1,true);
    tvcTween.addEventListener(TweenEvent.MOTION_FINISH,donePlaying);
    function donePlaying(e:TweenEvent):void{
              trace ("done playing!");
              content_mc.tvc_mc.myvideo.play();
    I have absolutely no idea and right now it seams like a maze trapped in the puzzel trapped in pac man,
    any help would be fantastic
    cheers

    hey man this is a screen shot from frame 3, there is nothing in frame 16 which makes me wonder

  • Another TypeError: Error #1009 Problem

    Hey all,   I've searched the 'net and searched these forums but can't seem to figure out what I'm doing wrong.  I'm creating a flash based game for school that so far has ten frames on the timeline.  I have buttons on frame one, frame 5, and frame 10. I have actionscript code to control those buttons on frame 1, frame 5, and frame 10 respectively.  The code is worded identically on each frame with the exception that I've changed the button names and the function names that are called when the mouse button is pressed.   The code works fine on frame 1 and on frame 5, but when I click the button on frame 5 that sends me to frame 10, I get this error immediately:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at keys2BibleTest_fla::MainTimeline/frame10()
        at flash.display::MovieClip/gotoAndStop()
        at keys2BibleTest_fla::MainTimeline/stormBtnHandler1()
    I have verified that each instance of the buttons do indeed have the name of the button being listened for in the event handlers. I can change the type from button to movieclip and it works fine.  I can also remove frames 1 through 9 and the code works.
    Here's the code:
    Frame 1:
    stop();
    enterBtn.addEventListener(MouseEvent.MOUSE_DOWN, enterBtnHandler1);
    function enterBtnHandler1(event:MouseEvent):void {
        gotoAndStop(5, "Scene 1");
    Frame 5:
    import flash.events.MouseEvent;
    stormBtn.addEventListener(MouseEvent.MOUSE_DOWN, stormBtnHandler1);
    function stormBtnHandler1(event:MouseEvent):void {
        gotoAndStop(10, "Scene 1");
    chickenOutBtn.addEventListener(MouseEvent.MOUSE_DOWN, chickenOutBtnHandler1);
    function chickenOutBtnHandler1(event:MouseEvent):void {
        gotoAndStop(1, "Scene 1");
    Frame 10:
    import flash.events.MouseEvent;
    creationBtn.addEventListener(MouseEvent.MOUSE_DOWN, creation);
    function creation(event:MouseEvent):void {
        gotoAndStop(3, "Scene 1");
    lifeBtn.addEventListener(MouseEvent.MOUSE_DOWN, lifeOfChrist);
    function lifeOfChrist(event:MouseEvent):void {
        navigateToURL(new URLRequest("http://www.ceoutreach.org"));
    I can't for the life of me figure out what's wrong.  Can anyone help?
    Thank you,
    Mike

    Ned,
    thank you for your reply. Unfortunately, my buttons are on separate layers and separated by blank keyframes to boot.  When I posted originally, the buttons were all on the same layer BUT separated by blank keyframes. After doing some research on the web, I moved the buttons to their own separate layers (one button per layer) and kept the blank keyframes as well.
    Currently, my only filled keyframes are one, five, and ten. All other keyframes are blank except for my labels and actionscript code. I'm using separate layers for labels and actions, too. I attempted to attach the file with my original post but received the message that .fla files are not allowed.  I don't know about your window, but mine says Max size 5.0 MB (my file is 2), All files types allowed except.... .fla is not one of those in the exception list so I expected it to go.
    It's got something to do with the two buttons on frame 10.... I just went into the actionscript and bypassed frame 5, going directly to frame 10 when the Enter button is depressed, and got the same error message.   There's something in the code I'm just not seeing.... when I comment out the code for the buttons, no error message.  Put the code back in, error message comes back.  Delete the buttons and the code and insert new ones, the error message comes back.
    It's got me totally stumped.
    Thank you for trying,
    Mike
    Edit: I forgot to mention, frame ten is the only place on the timeline where instances of these particular buttons are being used. The other frames are populated with different buttons.  Also, when I change the type to movieclip, everything works.  Weird, huh?

  • Error #1009: Cannot access a property or method

    Here's the context of the problem, in which I will try to include as much information as possible while keeping the explanation brief.
    I am trying to make a portfolio website (architectural design + concept art).  Flash / programing are not my focus and this is my first go at learning the software.  Due to the nature of the content and my (lack) of ability in AS3, I want the the coding to be really simple and still let the site look good.  The way the site is currently structured:
    1) Basic menu buttons that navigate to sections of the site (brings up a new page).
    2) Example, clicking on <Graphics> takes you to a new page and a sub-menu animates in (simple motion tween for the buttons to cascade down).  This animation is a movie clip placed on the main timeline.
    3) On the screen is also a slideshow for all the images within <Graphics>.  Instead of multiple small slideshows, I combined them all into one, so as to avoid complications with add / remove from stage.  There are prev / next buttons that keep images within their sub section (ie 1->2->3->1).  The sub-menu buttons are suppose to link to the start of each sub section, much like chapters on a DVD.  (The slideshow is a movieclip sub-nested in the menu movieclip).
    Main menu buttons work.
    Sub-menu animation works.
    Slideshow works.
    Can't get the sub-menu buttons to access the slideshow chapters.
    I have created and solved about half a dozen errors, and each time I fix something, it just causes another point to break.  I've gone around in circles for days, and not sure which was is up anymore.  So, while the slideshow works independently of the rest of the content, and I think I have the parent referencing correct, the problem I am currently facing is thus:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at 03graphics_fla::MainTimeline/frame1()
    I've browsed some other threads, and I think I know what the problem is.  Since the sub-menu is animated, the buttons do not appear on frame 1 of the nested timeline, while the actionscript is on frame 1 of the main timeline - thus the code doesn't exist yet when I click the button.
    Is this indeed the problem?  If so, how do I go about fixing it?
    Additionally, does the structure makes sense on how my site is organized?  Is there an easier / cleaner way to code it?
    (This thing is completely ghetto-rigged, I just need it to function - it's like my own little Millenium Falcon...)
    Cheers,
    Andy

    Try following this posting, which is just a posting or two away from your own in the forum...
    http://forums.adobe.com/thread/748542?tstart=0

  • First flexunit test is always failing with Error Error #1009: Cannot access a property or method of

    Hi,
    I have flexunit project which I am trying to run on linux server.
    1. I have Tests project.
    2. I am trying to compile it on linux server and creating Tests.swf file and then executing Tests.swf using ant on 64 bit linux server using standalone flash debug player.
    3. Tests project contains 4 tests and first tests always fail with following error,
        test:
         [flexunit] Validating task attributes ...
         [flexunit] Generating default values ...
         [flexunit] Using default working dir [/mnt/build/VinitFlexUnitBranch/workspace/src/Tests]
         [flexunit] Using the following settings for the test run:
         [flexunit] FLEX_HOME: [/var/lib/flex4.1sdk]
         [flexunit] haltonfailure: [true]
         [flexunit] headless: [false]
         [flexunit] display: [99]
         [flexunit] localTrusted: [true]
         [flexunit] player: [flash]
         [flexunit] port: [1024]
         [flexunit] swf: [/mnt/build/VinitFlexUnitBranch/workspace/bin/Tests.swf]
         [flexunit] timeout: [60000ms]
         [flexunit] toDir: [/mnt/build/VinitFlexUnitBranch/workspace/src/Tests/report]
         [flexunit] Setting up server process ...
         [flexunit] Entry [/mnt/build/VinitFlexUnitBranch/workspace/bin] already available in local trust file at [/home/deploy/.macromedia/Flash_Player/#Security/FlashPlayerTrust/flexUnit.cfg].
         [flexunit] Executing 'gflashplayer' with arguments:
         [flexunit] '/mnt/build/VinitFlexUnitBranch/workspace/bin/Tests.swf'
         [flexunit]
         [flexunit] The ' characters around the executable and arguments are
         [flexunit] not part of the command.
         [flexunit]
         [flexunit] Starting server ...
         [flexunit] Opening server socket on port [1024].
         [flexunit] Waiting for client connection ...
         [flexunit] Client connected.
         [flexunit] Setting inbound buffer size to [262144] bytes.
         [flexunit] Receiving data ...
         [flexunit] Sending acknowledgement to player to start sending test data ...
         [flexunit]
         [flexunit] FlexUnit test pause in suite Tests.Classes.DummyASyncTest had errors.
         [flexunit]
         [flexunit] Stopping server ...
         [flexunit] End of test data reached, sending acknowledgement to player ...
         [flexunit] Closing client connection ...
         [flexunit] Closing server on port [1024] ...
         [flexunit] <testcase classname="Tests.Classes::DummyASyncTest" name="pause" time="8" status="error"><error message="Error #1009: Cannot access a property or method of a null object reference." type="Tests.Classes::DummyASyncTest.pause" ><![CDATA[TypeError: Error #1009: Cannot access a property or method of a null object reference.
         [flexunit] at org.fluint.uiImpersonation.flex::FlexEnvironmentBuilder/buildVisualTestEnvironment()
         [flexunit] at org.fluint.uiImpersonation::VisualTestEnvironmentBuilder/buildVisualTestEnvironment()
         [flexunit] at org.flexunit.internals.runners.watcher::FrameWatcher/getStage()
         [flexunit] at org.flexunit.internals.runners.watcher::FrameWatcher()
         [flexunit] at org.flexunit.internals.runners.statements::StackAndFrameManagement()
         [flexunit] at org.flexunit.runners::BlockFlexUnit4ClassRunner/withStackManagement()
         [flexunit] at org.flexunit.runners::BlockFlexUnit4ClassRunner/withDecoration()
         [flexunit] at org.flexunit.runners::BlockFlexUnit4ClassRunner/methodBlock()
         [flexunit] at org.flexunit.runners::BlockFlexUnit4ClassRunner/runChild()
         [flexunit] at org.flexunit.internals.runners::ChildRunnerSequencer/executeStep()
         [flexunit] at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete( )
         [flexunit] at org.flexunit.internals.runners.statements::StatementSequencer/evaluate()
         [flexunit] at org.flexunit.runners::ParentRunner/run()
         [flexunit] at org.flexunit.runners::Suite/runChild()
         [flexunit] at org.flexunit.internals.runners::ChildRunnerSequencer/executeStep()
         [flexunit] at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete( )
         [flexunit] at org.flexunit.internals.runners.statements::StatementSequencer/evaluate()
         [flexunit] at org.flexunit.runners::ParentRunner/run()
         [flexunit] at org.flexunit.runners::Suite/runChild()
         [flexunit] at org.flexunit.internals.runners::ChildRunnerSequencer/executeStep()
         [flexunit] at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete( )
         [flexunit] at org.flexunit.internals.runners.statements::StatementSequencer/evaluate()
         [flexunit] at org.flexunit.runners::ParentRunner/run()
         [flexunit] at org.flexunit.runner::FlexUnitCore/beginRunnerExecution()
         [flexunit] at org.flexunit.runner::FlexUnitCore/verifyRunnerCanBegin()
         [flexunit] at org.flexunit.token::AsyncCoreStartupToken/sendReady()
         [flexunit] at org.flexunit.runner.notification.async::AsyncListenerWatcher/sendReadyNotification()
         [flexunit] at org.flexunit.runner.notification.async::AsyncListenerWatcher/handleListenerReady()
         [flexunit] at flash.events::EventDispatcher/dispatchEventFunction()
         [flexunit] at flash.events::EventDispatcher/dispatchEvent()
         [flexunit] at org.flexunit.listeners::CIListener/setStatusReady()
         [flexunit] at org.flexunit.listeners::CIListener/dataHandler()
         [flexunit] at flash.events::EventDispatcher/dispatchEventFunction()
         [flexunit] at flash.events::EventDispatcher/dispatchEvent()
         [flexunit] at flash.net::XMLSocket/scanAndSendEvent()]]></error></testcase>
         [flexunit] <endOfTestRun/>
         [flexunit] Analyzing reports ...
         [flexunit]
         [flexunit] Suite: Tests.Classes.DummyASyncTest
         [flexunit] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.008 sec
         [flexunit]
         [flexunit] Results :
         [flexunit]
         [flexunit] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.008 sec
         [flexunit]
        BUILD FAILED
        /mnt/build/VinitFlexUnitBranch/workspace/src/Tests/build.xml:26: FlexUnit tests failed during the test run.
        at org.flexunit.ant.tasks.TestRun.analyzeReports(Unknown Source)
        at org.flexunit.ant.tasks.TestRun.run(Unknown Source)
        at org.flexunit.ant.tasks.FlexUnitTask.execute(Unknown Source)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:390)
        at org.apache.tools.ant.Target.performTasks(Target.java:411)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
        at org.apache.tools.ant.Main.runBuild(Main.java:809)
        at org.apache.tools.ant.Main.startAnt(Main.java:217)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
        Total time: 1 second
    Exited with status 1
    [deploy]$
    4. Everytime I run this, any test which is run first will fail and all other tests will pass.
    My Tests.as file is as below:
    * Tests.as
    package
    import Tests.XTestSuite;
    import flash.display.Sprite;
    import mx.core.FlexSprite;
    import org.flexunit.listeners.CIListener;
    import org.flexunit.listeners.UIListener;
    import org.flexunit.runner.FlexUnitCore;
    public class Tests extends Sprite
    public var flexSprite:FlexSprite;
    public function Tests()
    onCreationComplete();
    public function onCreationComplete() : void {
    var core : FlexUnitCore = new FlexUnitCore();
    core.addListener(new CIListener());
    core.runClasses(Tests.XTestSuite);
    public function currentRunTestSuite():Array
    var testsToRun:Array = new Array();
    testsToRun.push(Tests.XTestSuite);
    return testsToRun;
    XTestSuite try to run 4 flexunit test classes.
    one of that flexunit test script class is as below:
    package Tests.Classes
    import flexunit.framework.Assert;
    import org.flexunit.Assert;
    import org.flexunit.asserts.assertEquals;
    public class DummyASyncTest
    [Test]
    public function pause() : void
    assertEquals(true, true);
    trace("I M in dummy");
    All other tests are dummy tests which just asserts(true, true).
    I am not sure if I doing something wrong or forgot to take care of something.

    Hi,
    I have flexunit project which I am trying to run on linux server.
    1. I have Tests project.
    2. I am trying to compile it on linux server and creating Tests.swf file and then executing Tests.swf using ant on 64 bit linux server using standalone flash debug player.
    3. Tests project contains 4 tests and first tests always fail with following error,
        test:
         [flexunit] Validating task attributes ...
         [flexunit] Generating default values ...
         [flexunit] Using default working dir [/mnt/build/VinitFlexUnitBranch/workspace/src/Tests]
         [flexunit] Using the following settings for the test run:
         [flexunit] FLEX_HOME: [/var/lib/flex4.1sdk]
         [flexunit] haltonfailure: [true]
         [flexunit] headless: [false]
         [flexunit] display: [99]
         [flexunit] localTrusted: [true]
         [flexunit] player: [flash]
         [flexunit] port: [1024]
         [flexunit] swf: [/mnt/build/VinitFlexUnitBranch/workspace/bin/Tests.swf]
         [flexunit] timeout: [60000ms]
         [flexunit] toDir: [/mnt/build/VinitFlexUnitBranch/workspace/src/Tests/report]
         [flexunit] Setting up server process ...
         [flexunit] Entry [/mnt/build/VinitFlexUnitBranch/workspace/bin] already available in local trust file at [/home/deploy/.macromedia/Flash_Player/#Security/FlashPlayerTrust/flexUnit.cfg].
         [flexunit] Executing 'gflashplayer' with arguments:
         [flexunit] '/mnt/build/VinitFlexUnitBranch/workspace/bin/Tests.swf'
         [flexunit]
         [flexunit] The ' characters around the executable and arguments are
         [flexunit] not part of the command.
         [flexunit]
         [flexunit] Starting server ...
         [flexunit] Opening server socket on port [1024].
         [flexunit] Waiting for client connection ...
         [flexunit] Client connected.
         [flexunit] Setting inbound buffer size to [262144] bytes.
         [flexunit] Receiving data ...
         [flexunit] Sending acknowledgement to player to start sending test data ...
         [flexunit]
         [flexunit] FlexUnit test pause in suite Tests.Classes.DummyASyncTest had errors.
         [flexunit]
         [flexunit] Stopping server ...
         [flexunit] End of test data reached, sending acknowledgement to player ...
         [flexunit] Closing client connection ...
         [flexunit] Closing server on port [1024] ...
         [flexunit] <testcase classname="Tests.Classes::DummyASyncTest" name="pause" time="8" status="error"><error message="Error #1009: Cannot access a property or method of a null object reference." type="Tests.Classes::DummyASyncTest.pause" ><![CDATA[TypeError: Error #1009: Cannot access a property or method of a null object reference.
         [flexunit] at org.fluint.uiImpersonation.flex::FlexEnvironmentBuilder/buildVisualTestEnvironment()
         [flexunit] at org.fluint.uiImpersonation::VisualTestEnvironmentBuilder/buildVisualTestEnvironment()
         [flexunit] at org.flexunit.internals.runners.watcher::FrameWatcher/getStage()
         [flexunit] at org.flexunit.internals.runners.watcher::FrameWatcher()
         [flexunit] at org.flexunit.internals.runners.statements::StackAndFrameManagement()
         [flexunit] at org.flexunit.runners::BlockFlexUnit4ClassRunner/withStackManagement()
         [flexunit] at org.flexunit.runners::BlockFlexUnit4ClassRunner/withDecoration()
         [flexunit] at org.flexunit.runners::BlockFlexUnit4ClassRunner/methodBlock()
         [flexunit] at org.flexunit.runners::BlockFlexUnit4ClassRunner/runChild()
         [flexunit] at org.flexunit.internals.runners::ChildRunnerSequencer/executeStep()
         [flexunit] at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete( )
         [flexunit] at org.flexunit.internals.runners.statements::StatementSequencer/evaluate()
         [flexunit] at org.flexunit.runners::ParentRunner/run()
         [flexunit] at org.flexunit.runners::Suite/runChild()
         [flexunit] at org.flexunit.internals.runners::ChildRunnerSequencer/executeStep()
         [flexunit] at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete( )
         [flexunit] at org.flexunit.internals.runners.statements::StatementSequencer/evaluate()
         [flexunit] at org.flexunit.runners::ParentRunner/run()
         [flexunit] at org.flexunit.runners::Suite/runChild()
         [flexunit] at org.flexunit.internals.runners::ChildRunnerSequencer/executeStep()
         [flexunit] at org.flexunit.internals.runners.statements::StatementSequencer/handleChildExecuteComplete( )
         [flexunit] at org.flexunit.internals.runners.statements::StatementSequencer/evaluate()
         [flexunit] at org.flexunit.runners::ParentRunner/run()
         [flexunit] at org.flexunit.runner::FlexUnitCore/beginRunnerExecution()
         [flexunit] at org.flexunit.runner::FlexUnitCore/verifyRunnerCanBegin()
         [flexunit] at org.flexunit.token::AsyncCoreStartupToken/sendReady()
         [flexunit] at org.flexunit.runner.notification.async::AsyncListenerWatcher/sendReadyNotification()
         [flexunit] at org.flexunit.runner.notification.async::AsyncListenerWatcher/handleListenerReady()
         [flexunit] at flash.events::EventDispatcher/dispatchEventFunction()
         [flexunit] at flash.events::EventDispatcher/dispatchEvent()
         [flexunit] at org.flexunit.listeners::CIListener/setStatusReady()
         [flexunit] at org.flexunit.listeners::CIListener/dataHandler()
         [flexunit] at flash.events::EventDispatcher/dispatchEventFunction()
         [flexunit] at flash.events::EventDispatcher/dispatchEvent()
         [flexunit] at flash.net::XMLSocket/scanAndSendEvent()]]></error></testcase>
         [flexunit] <endOfTestRun/>
         [flexunit] Analyzing reports ...
         [flexunit]
         [flexunit] Suite: Tests.Classes.DummyASyncTest
         [flexunit] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.008 sec
         [flexunit]
         [flexunit] Results :
         [flexunit]
         [flexunit] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.008 sec
         [flexunit]
        BUILD FAILED
        /mnt/build/VinitFlexUnitBranch/workspace/src/Tests/build.xml:26: FlexUnit tests failed during the test run.
        at org.flexunit.ant.tasks.TestRun.analyzeReports(Unknown Source)
        at org.flexunit.ant.tasks.TestRun.run(Unknown Source)
        at org.flexunit.ant.tasks.FlexUnitTask.execute(Unknown Source)
        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
        at org.apache.tools.ant.Task.perform(Task.java:348)
        at org.apache.tools.ant.Target.execute(Target.java:390)
        at org.apache.tools.ant.Target.performTasks(Target.java:411)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
        at org.apache.tools.ant.Main.runBuild(Main.java:809)
        at org.apache.tools.ant.Main.startAnt(Main.java:217)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
        Total time: 1 second
    Exited with status 1
    [deploy]$
    4. Everytime I run this, any test which is run first will fail and all other tests will pass.
    My Tests.as file is as below:
    * Tests.as
    package
    import Tests.XTestSuite;
    import flash.display.Sprite;
    import mx.core.FlexSprite;
    import org.flexunit.listeners.CIListener;
    import org.flexunit.listeners.UIListener;
    import org.flexunit.runner.FlexUnitCore;
    public class Tests extends Sprite
    public var flexSprite:FlexSprite;
    public function Tests()
    onCreationComplete();
    public function onCreationComplete() : void {
    var core : FlexUnitCore = new FlexUnitCore();
    core.addListener(new CIListener());
    core.runClasses(Tests.XTestSuite);
    public function currentRunTestSuite():Array
    var testsToRun:Array = new Array();
    testsToRun.push(Tests.XTestSuite);
    return testsToRun;
    XTestSuite try to run 4 flexunit test classes.
    one of that flexunit test script class is as below:
    package Tests.Classes
    import flexunit.framework.Assert;
    import org.flexunit.Assert;
    import org.flexunit.asserts.assertEquals;
    public class DummyASyncTest
    [Test]
    public function pause() : void
    assertEquals(true, true);
    trace("I M in dummy");
    All other tests are dummy tests which just asserts(true, true).
    I am not sure if I doing something wrong or forgot to take care of something.

  • New to action script and getting: TypeError: Error #1009: Cannot access a property or method of a nu

    I am getting this message in the output tab for buttons that I am trying to create.  Here's the code:
    import flash.events.MouseEvent;
    stop();
    function goHome(myEvent:MouseEvent):void {
    gotoAndStop("home");
    SoundMixer.stopAll();
    function goAbout(myEvent:MouseEvent):void {
    gotoAndStop("about");
    SoundMixer.stopAll();
    function goBusiness(myEvent:MouseEvent):void {
    gotoAndStop("business");
    SoundMixer.stopAll();
    function goContact(myEvent:MouseEvent):void {
    gotoAndStop("contact");
    SoundMixer.stopAll();
    function goArchives(myEvent:MouseEvent):void {
    gotoAndStop("archives");
    SoundMixer.stopAll();
    function goBioTech(myEvent:MouseEvent):void {
    gotoAndStop("bioTech");
    SoundMixer.stopAll();
    function goRealEstate(myEvent:MouseEvent):void {
    gotoAndStop("realEstate");
    SoundMixer.stopAll();
    function goTechnology(myEvent:MouseEvent):void {
    gotoAndStop("technology");
    SoundMixer.stopAll();
    function goEnergy(myEvent:MouseEvent):void {
    gotoAndStop("energy");
    SoundMixer.stopAll();
    home_btn.addEventListener(MouseEvent.CLICK, goHome);
    about_btn.addEventListener(MouseEvent.CLICK, goAbout);
    business_btn.addEventListener(MouseEvent.CLICK, goBusiness);
    contact_btn.addEventListener(MouseEvent.CLICK, goContact);
    archives_btn.addEventListener(MouseEvent.CLICK, goArchives);
    bioTech_btn.addEventListener(MouseEvent.CLICK, goBioTech);
    realEstate_btn.addEventListener(MouseEvent.CLICK, goRealEstate);
    technology_btn.addEventListener(MouseEvent.CLICK, goTechnology);
    energy_btn.addEventListener(MouseEvent.CLICK, goEnergy);
    I ran the debugger and got this:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
        at peakInsights_fla::MainTimeline/frame1()[peakInsights_fla.MainTimeline::frame1:48]
    I guess it's telling me there's a problem with line 48 but what?
    The home, about, business, contact, and archives button works. On the business page there are the remaining buttons biotech, technology, real estate, and energy. when i test it; i get the finger but the buttons don't work. this is my first flash site so I'am new, new.

    I followed the steps and read some of your comments on the same top topic in another thread. When I put it on the first frame it was okay but the next button on that page had the same problem.  So what I am guessing is that I have to either create a document class or put the actions where the buttons are.  Am I understanding that correctly?  In the other thread in which you helped someone else; there was so comments about document class.  I found a tutorial on it and the way I understand it is that it you can put you actions in an external document.  But you have to include in the event listener the frame in which you want that action to happen.
    Thaks for your help.  And patience.

  • TypeError: Error #1009: Cannot access a property or method of a null object reference.

    Hi all,
    I am new to ActionScript and Flash, and I am getting this error: TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at jessicaclucas_fla::MainTimeline/stopResumescroll()
    I have several different clips in one movie that have scrolling content. When I click a button to move to a different clip that doesn’t have a certain scroll, it gives me this error. I cannot figure out how to fix this. You can see the site I am working on: http://www.jessicaclucas.com. I would really appreciate some help! Thank you in advance. Here is the code:
    //Import TweenMax and the plugin for the blur filter
    import gs.TweenMax;
    import gs.plugins.BlurFilterPlugin;
    //Save the content’s and mask’s height.
    //Assign your own content height here!!
    var RESUMECONTENT_HEIGHT:Number = 1500;
    var RESUME_HEIGHT:Number = 450;
    //We want to know what was the previous y coordinate of the content (for the animation)
    var oldResumeY:Number = myResumecontent.y;
    //Position the content on the top left corner of the mask
    myResumecontent.x = myResume.x;
    myResumecontent.y = myResume.y;
    //Set the mask to our content
    myResumecontent.mask = myResume;
    //Create a rectangle that will act as the Resumebounds to the scrollMC.
    //This way the scrollMC can only be dragged along the line.
    var Resumebounds:Rectangle = new Rectangle(resumescrollMC.x,resumescrollMC.y,0,450);
    //We want to know when the user is Resumescrolling
    var Resumescrolling:Boolean = false;
    //Listen when the user is holding the mouse down on the scrollMC
    resumescrollMC.addEventListener(MouseEvent.MOUSE_DOWN, startResumescroll);
    //Listen when the user releases the mouse button
    stage.addEventListener(MouseEvent.MOUSE_UP, stopResumescroll);
    //This function is called when the user is dragging the scrollMC
    function startResumescroll(e:Event):void {
    //Set Resumescrolling to true
    Resumescrolling = true;
    //Start dragging the scrollMC
    resumescrollMC.startDrag(false,Resumebounds);
    //This function is called when the user stops dragging the scrollMC
    function stopResumescroll(e:Event):void {
    //Set Resumescrolling to false
    Resumescrolling = false;
    //Stop the drag
    resumescrollMC.stopDrag();
    //Add ENTER_FRAME to animate the scroll
    addEventListener(Event.ENTER_FRAME, enterResumeHandler);
    //This function is called in each frame
    function enterResumeHandler(e:Event):void {
    //Check if we are Resumescrolling
    if (Resumescrolling == true) {
    //Calculate the distance how far the scrollMC is from the top
    var distance:Number = Math.round(resumescrollMC.y - Resumebounds.y);
    //Calculate the percentage of the distance from the line height.
    //So when the scrollMC is on top, percentage is 0 and when its
    //at the bottom the percentage is 1.
    var percentage:Number = distance / RESUME_HEIGHT;
    //Save the old y coordinate
    oldResumeY = myResumecontent.y;
    //Calculate a new y target coordinate for the content.
    //We subtract the mask’s height from the contentHeight.
    //Otherwise the content would move too far up when we scroll down.
    //Remove the subraction to see for yourself!
    var targetY:Number = -((RESUMECONTENT_HEIGHT - RESUME_HEIGHT) * percentage) + myResume.y;
    //We only want to animate the scroll if the old y is different from the new y.
    //In our movie we animate the scroll if the difference is bigger than 5 pixels.
    if (Math.abs(oldResumeY - targetY) > 5) {
    //Tween the content to the new location.
    //Call the function ResumetweenFinished() when the tween is complete.
    TweenMax.to(myResumecontent, 0.3, {y: targetY, blurFilter:{blurX:22, blurY:22}, onComplete: ResumetweenFinished});
    //This function is called when the tween is finished
    function ResumetweenFinished():void {
    //Tween the content back to “normal” (= remove blur)
    TweenMax.to(myResumecontent, 0.3, {blurFilter:{blurX:0, blurY:0}});

    Hi again,
    Thank you for helping. I really appreciate it! Would it be easier to say, if resumescrollMC exists, then execute these functions? I was not able to figure out the null statement from your post. Here is what I am trying (though I am not sure it is possible). I declared the var resumescrollMC, and then I tried to put pretty much the entire code into an if (resumescrollMC == true) since this code only needs to be completed when resumescrollMC is on the stage. It is not working the way I have tried, but I am assuming I am setting up the code incorrectly. Or, an if statement is not supposed to be issued to an object:
    //Import TweenMax and the plugin for the blur filter
    import gs.TweenMax2;
    import gs.plugins.BlurFilterPlugin2;
    //Save the content's and mask's height.
    //Assign your own content height here!!
    var RESUMECONTENT_HEIGHT:Number = 1500;
    var RESUME_HEIGHT:Number = 450;
    var resumescrollMC:MovieClip;
    if (resumescrollMC == true) {
    //We want to know what was the previous y coordinate of the content (for the animation)
    var oldResumeY:Number = myResumecontent.y;
    //Position the content on the top left corner of the mask
    myResumecontent.x = myResume.x;
    myResumecontent.y = myResume.y;
    //Set the mask to our content
    myResumecontent.mask = myResume;
    //Create a rectangle that will act as the Resumebounds to the scrollMC.
    //This way the scrollMC can only be dragged along the line.
    var Resumebounds:Rectangle = new Rectangle(resumescrollMC.x,resumescrollMC.y,0,450);
    //We want to know when the user is Resumescrolling
    var Resumescrolling:Boolean = false;
    //Listen when the user is holding the mouse down on the scrollMC
    resumescrollMC.addEventListener(MouseEvent.MOUSE_DOWN, startResumescroll);
    //Listen when the user releases the mouse button
    stage.addEventListener(MouseEvent.MOUSE_UP, stopResumescroll);
    //This function is called when the user is dragging the scrollMC
    function startResumescroll(e:Event):void {
    //Set Resumescrolling to true
    Resumescrolling = true;
    //Start dragging the scrollMC
    resumescrollMC.startDrag(false,Resumebounds);
    //This function is called when the user stops dragging the scrollMC
    function stopResumescroll(e:Event):void {
    //Set Resumescrolling to false
    Resumescrolling = false;
    //Stop the drag
    resumescrollMC.stopDrag();
    //Add ENTER_FRAME to animate the scroll
    addEventListener(Event.ENTER_FRAME, enterResumeHandler);
    //This function is called in each frame
    function enterResumeHandler(e:Event):void {
    //Check if we are Resumescrolling
    if (Resumescrolling == true) {
    //Calculate the distance how far the scrollMC is from the top
    var distance:Number = Math.round(resumescrollMC.y - Resumebounds.y);
    //Calculate the percentage of the distance from the line height.
    //So when the scrollMC is on top, percentage is 0 and when its
    //at the bottom the percentage is 1.
    var percentage:Number = distance / RESUME_HEIGHT;
    //Save the old y coordinate
    oldResumeY = myResumecontent.y;
    //Calculate a new y target coordinate for the content.
    //We subtract the mask's height from the contentHeight.
    //Otherwise the content would move too far up when we scroll down.
    //Remove the subraction to see for yourself!
    var targetY:Number = -((RESUMECONTENT_HEIGHT - RESUME_HEIGHT) * percentage) + myResume.y;
    //We only want to animate the scroll if the old y is different from the new y.
    //In our movie we animate the scroll if the difference is bigger than 5 pixels.
    if (Math.abs(oldResumeY - targetY) > 5) {
    //Tween the content to the new location.
    //Call the function ResumetweenFinished() when the tween is complete.
    TweenMax.to(myResumecontent, 0.3, {y: targetY, blurFilter:{blurX:22, blurY:22}, onComplete: ResumetweenFinished});
    //This function is called when the tween is finished
    function ResumetweenFinished():void {
    //Tween the content back to "normal" (= remove blur)
    TweenMax.to(myResumecontent, 0.3, {blurFilter:{blurX:0, blurY:0}});

  • TypeError: Error #1009: Cannot access a property or method of a null object reference.      at FC_Home_A

    Dear Sir,
    I really need your valuable assistance i was about to finish a project but at very last moment i am stuck. Here is the explanation below...
    I have two files called "holder.swf" and "slide.swf" i want to improt the "slide.swf" using this action below
    var myLoader:Loader = new Loader();
    var url:URLRequest = new URLRequest("slide.swf");
    myLoader.load(url);
    addChild(myLoader);
    myLoader.x = 2;
    myLoader.y = 2;
    Also i have attached the flash file of "holder.swf". My concern is the moment i am calling the "slide.swf" inside the "holder.swf" it is showing the following error...
    " TypeError: Error #1009: Cannot access a property or method of a null object reference.
              at FC_Home_Ads_Holder_v2_fla::MainTimeline() "
    Here are the files uploaded for your reference, please download this file http://www.touchpixl.com/ForumsAdobecom.zip
    This error is being occured from "MainTimeline.as" file here is the code been use inside of this file below....
    package FC_Home_Ads_Holder_v2_fla
        import __AS3__.vec.*;
        import adobe.utils.*;
        import com.danehansen.*;
        import com.greensock.*;
        import com.greensock.easing.*;
        import com.greensock.plugins.*;
        import flash.accessibility.*;
        import flash.desktop.*;
        import flash.display.*;
        import flash.errors.*;
        import flash.events.*;
        import flash.external.*;
        import flash.filters.*;
        import flash.geom.*;
        import flash.globalization.*;
        import flash.media.*;
        import flash.net.*;
        import flash.net.drm.*;
        import flash.printing.*;
        import flash.profiler.*;
        import flash.sampler.*;
        import flash.sensors.*;
        import flash.system.*;
        import flash.text.*;
        import flash.text.engine.*;
        import flash.text.ime.*;
        import flash.ui.*;
        import flash.utils.*;
        import flash.xml.*;
        public dynamic class MainTimeline extends flash.display.MovieClip
            public function MainTimeline()
                new Vector.<String>(6)[0] = "Productivity";
                new Vector.<String>(6)[1] = "Leadership";
                new Vector.<String>(6)[2] = "Execution";
                new Vector.<String>(6)[3] = "Education";
                new Vector.<String>(6)[4] = "Speed of Trust";
                new Vector.<String>(6)[5] = "Sales";
                super();
                addFrameScript(0, this.frame1);
                return;
            public function init():void
                var loc1:*=null;
                com.greensock.plugins.TweenPlugin.activate([com.greensock.plugins.Aut oAlphaPlugin]);
                loc1 = new flash.net.URLLoader(new flash.net.URLRequest(this.XML_LOC));
                var loc2:*;
                this.next_mc.buttonMode = loc2 = true;
                this.prev_mc.buttonMode = loc2;
                stage.scaleMode = flash.display.StageScaleMode.NO_SCALE;
                stage.align = flash.display.StageAlign.TOP_LEFT;
                loc1.addEventListener(flash.events.Event.COMPLETE, this.xmlLoaded, false, 0, true);
                this.prev_mc.addEventListener(flash.events.MouseEvent.CLICK, this.minusClick, false, 0, true);
                this.next_mc.addEventListener(flash.events.MouseEvent.CLICK, this.plusClick, false, 0, true);
                return;
            public function xmlLoaded(arg1:flash.events.Event):void
                var loc1:*=null;
                var loc2:*=0;
                this.xmlData = new XML(arg1.target.data);
                loc2 = 0;
                while (loc2 < this.LABELS.length)
                    loc1 = new Btn(this.LABELS[loc2], loc2);
                    this.btnHolder_mc.addChild(loc1);
                    this.BTNS.push(loc1);
                    trace(this.LABELS[loc2]);
                    ++loc2;
                this.current = uint(this.xmlData.@firstPick);
                trace("-----width-----");
                trace(this.contentMask.width);
                var loc3:*=this.contentMask.width / this.LABELS.length;
                trace(loc3);
                loc2 = 0;
                while (loc2 < this.BTNS.length)
                    this.BTNS[loc2].width = loc3;
                    this.BTNS[loc2].x = loc3 * loc2;
                    ++loc2;
                this.btnHolder_mc.addEventListener(flash.events.MouseEvent.CLICK, this.numClick, false, 0, true);
                this.selectMovie();
                return;
            public function numClick(arg1:flash.events.MouseEvent):void
                this.killTimer();
                this.current = arg1.target.i;
                this.selectMovie();
                return;
            public function killTimer():void
                this.timerGoing = false;
                if (this.timer)
                    this.timer.reset();
                    this.timer.addEventListener(flash.events.TimerEvent.TIMER, this.plusClick, false, 0, true);
                    this.timer = null;
                return;
            public function selectMovie():void
                if (this.timerGoing)
                    this.timer = new flash.utils.Timer(uint(this.xmlData.ad[com.danehansen.MyMath.modulo(t his.current, this.xmlData.ad.length())].@delay), 1);
                    this.timer.start();
                    this.timer.addEventListener(flash.events.TimerEvent.TIMER, this.plusClick, false, 0, true);
                while (this.holder_mc.numChildren > 0)
                    this.holder_mc.removeChild(this.holder_mc.getChildAt(0));
                var loc1:*=new flash.display.Loader();
                loc1.load(new flash.net.URLRequest(this.xmlData.ad[com.danehansen.MyMath.modulo(thi s.current, this.xmlData.ad.length())].@loc));
                this.holder_mc.addChild(loc1);
                var loc2:*=0;
                while (loc2 < this.BTNS.length)
                    this.BTNS[loc2].deselect();
                    ++loc2;
                this.BTNS[com.danehansen.MyMath.modulo(this.current, this.xmlData.ad.length())].select();
                var loc3:*=this.BTNS[com.danehansen.MyMath.modulo(this.current, this.xmlData.ad.length())].x + this.BTNS[com.danehansen.MyMath.modulo(this.current, this.xmlData.ad.length())].width / 2 + this.btnHolder_mc.x;
                trace("addLength:" + this.xmlData.ad.length());
                trace(loc3, com.danehansen.MyMath.modulo(this.current, this.xmlData.ad.length()));
                com.greensock.TweenLite.to(this.indicator_mc, 0.3, {"x":loc3, "ease":com.greensock.easing.Cubic.easeOut});
                loc1.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, this.adLoaded, false, 0, true);
                return;
            public function adLoaded(arg1:flash.events.Event):void
                var evt:flash.events.Event;
                var loc1:*;
                evt = arg1;
                try
                    evt.target.content.xmlData = this.xmlData.ad[com.danehansen.MyMath.modulo(this.current, this.xmlData.ad.length())];
                catch (er:Error)
                return;
            public function minusClick(arg1:flash.events.MouseEvent):void
                this.killTimer();
                var loc1:*;
                var loc2:*=((loc1 = this).current - 1);
                loc1.current = loc2;
                this.selectMovie();
                return;
            public function plusClick(arg1:flash.events.Event):void
                if (arg1.type != "timer")
                    this.killTimer();
                var loc1:*;
                var loc2:*=((loc1 = this).current + 1);
                loc1.current = loc2;
                this.selectMovie();
                trace("next");
                return;
            public function ENDED(arg1:flash.events.Event):void
                if (arg1.type != "timer")
                    this.killTimer();
                var loc1:*;
                var loc2:*=((loc1 = this).current + 1);
                loc1.current = loc2;
                this.selectMovie();
                trace("next");
                return;
            public function STARTED(arg1:flash.events.Event):void
                this.killTimer();
                return;
            function frame1():*
                this.timerGoing = true;
                addEventListener("endNow", this.ENDED, false, 0, true);
                addEventListener("startNow", this.STARTED, false, 0, true);
                this.init();
                return;
            public const XML_LOC:String=stage.loaderInfo.parameters.xmlLoc ? stage.loaderInfo.parameters.xmlLoc : "home_ads.xml";
            public const LABELS:__AS3__.vec.Vector.<String>=new Vector.<String>(6);
            public const BTNS:__AS3__.vec.Vector.<Btn>=new Vector.<Btn>();
            public const TRANSITION_TIME:Number=0.2;
            public var contentMask:flash.display.MovieClip;
            public var btnHolder_mc:flash.display.MovieClip;
            public var holder_mc:flash.display.MovieClip;
            public var indicator_mc:flash.display.MovieClip;
            public var prev_mc:flash.display.MovieClip;
            public var next_mc:flash.display.MovieClip;
            public var current:int;
            public var xmlData:XML;
            public var timer:flash.utils.Timer;
            public var timerGoing:Boolean;
    Here is the folder uploaded on the server for you to get clear picture, please click on this link to download the entire folder. http://www.touchpixl.com/ForumsAdobecom.zip
    I am not being able to resolve the issue, it needs a master to get the proper solution. I would request you to help me.
    Thanks & Regards
    Sanjib Das

    Here is the entire code of MainTimeline.as below, please correct it.
    package FC_Home_Ads_Holder_v2_fla
        import __AS3__.vec.*;
        import adobe.utils.*;
        import com.danehansen.*;
        import com.greensock.*;
        import com.greensock.easing.*;
        import com.greensock.plugins.*;
        import flash.accessibility.*;
        import flash.desktop.*;
        import flash.display.*;
        import flash.errors.*;
        import flash.events.*;
        import flash.external.*;
        import flash.filters.*;
        import flash.geom.*;
        import flash.globalization.*;
        import flash.media.*;
        import flash.net.*;
        import flash.net.drm.*;
        import flash.printing.*;
        import flash.profiler.*;
        import flash.sampler.*;
        import flash.sensors.*;
        import flash.system.*;
        import flash.text.*;
        import flash.text.engine.*;
        import flash.text.ime.*;
        import flash.ui.*;
        import flash.utils.*;
        import flash.xml.*;
        public dynamic class MainTimeline extends flash.display.MovieClip
            public function MainTimeline()
                new Vector.<String>(6)[0] = "Productivity";
                new Vector.<String>(6)[1] = "Leadership";
                new Vector.<String>(6)[2] = "Execution";
                new Vector.<String>(6)[3] = "Education";
                new Vector.<String>(6)[4] = "Speed of Trust";
                new Vector.<String>(6)[5] = "Sales";
                super();
                addFrameScript(0, this.frame1);
                return;
            public function init():void
                var loc1:*=null;
                com.greensock.plugins.TweenPlugin.activate([com.greensock.plugins.AutoAlphaPlugin]);
                loc1 = new flash.net.URLLoader(new flash.net.URLRequest(this.XML_LOC));
                var loc2:*;
                this.next_mc.buttonMode = loc2 = true;
                this.prev_mc.buttonMode = loc2 = true;
                stage.scaleMode = flash.display.StageScaleMode.NO_SCALE;
                stage.align = flash.display.StageAlign.TOP_LEFT;
                loc1.addEventListener(flash.events.Event.COMPLETE, this.xmlLoaded, false, 0, true);
                this.prev_mc.addEventListener(flash.events.MouseEvent.CLICK, this.minusClick, false, 0, true);
                this.next_mc.addEventListener(flash.events.MouseEvent.CLICK, this.plusClick, false, 0, true);
                return;
            public function xmlLoaded(arg1:flash.events.Event):void
                var loc1:*=null;
                var loc2:*=0;
                this.xmlData = new XML(arg1.target.data);
                loc2 = 0;
                while (loc2 < this.LABELS.length)
                    loc1 = new Btn(this.LABELS[loc2], loc2);
                    this.btnHolder_mc.addChild(loc1);
                    this.BTNS.push(loc1);
                    trace(this.LABELS[loc2]);
                    ++loc2;
                this.current = uint(this.xmlData.@firstPick);
                trace("-----width-----");
                trace(this.contentMask.width);
                var loc3:*=this.contentMask.width / this.LABELS.length;
                trace(loc3);
                loc2 = 0;
                while (loc2 < this.BTNS.length)
                    this.BTNS[loc2].width = loc3;
                    this.BTNS[loc2].x = loc3 * loc2;
                    ++loc2;
                this.btnHolder_mc.addEventListener(flash.events.MouseEvent.CLICK, this.numClick, false, 0, true);
                this.selectMovie();
                return;
            public function numClick(arg1:flash.events.MouseEvent):void
                this.killTimer();
                this.current = arg1.target.i;
                this.selectMovie();
                return;
            public function killTimer():void
                this.timerGoing = false;
                if (this.timer)
                    this.timer.reset();
                    this.timer.addEventListener(flash.events.TimerEvent.TIMER, this.plusClick, false, 0, true);
                    this.timer = null;
                return;
            public function selectMovie():void
                if (this.timerGoing)
                    this.timer = new flash.utils.Timer(uint(this.xmlData.ad[com.danehansen.MyMath.modulo(this.current, this.xmlData.ad.length())].@delay), 1);
                    this.timer.start();
                    this.timer.addEventListener(flash.events.TimerEvent.TIMER, this.plusClick, false, 0, true);
                while (this.holder_mc.numChildren > 0)
                    this.holder_mc.removeChild(this.holder_mc.getChildAt(0));
                var loc1:*=new flash.display.Loader();
                loc1.load(new flash.net.URLRequest(this.xmlData.ad[com.danehansen.MyMath.modulo(this.current, this.xmlData.ad.length())].@loc));
                this.holder_mc.addChild(loc1);
                var loc2:*=0;
                while (loc2 < this.BTNS.length)
                    this.BTNS[loc2].deselect();
                    ++loc2;
                this.BTNS[com.danehansen.MyMath.modulo(this.current, this.xmlData.ad.length())].select();
                var loc3:*=this.BTNS[com.danehansen.MyMath.modulo(this.current, this.xmlData.ad.length())].x + this.BTNS[com.danehansen.MyMath.modulo(this.current, this.xmlData.ad.length())].width / 2 + this.btnHolder_mc.x;
                trace("addLength:" + this.xmlData.ad.length());
                trace(loc3, com.danehansen.MyMath.modulo(this.current, this.xmlData.ad.length()));
                com.greensock.TweenLite.to(this.indicator_mc, 0.3, {"x":loc3, "ease":com.greensock.easing.Cubic.easeOut});
                loc1.contentLoaderInfo.addEventListener(flash.events.Event.COMPLETE, this.adLoaded, false, 0, true);
                return;
            public function adLoaded(arg1:flash.events.Event):void
                var evt:flash.events.Event;
                var loc1:*;
                evt = arg1;
                try
                    evt.target.content.xmlData = this.xmlData.ad[com.danehansen.MyMath.modulo(this.current, this.xmlData.ad.length())];
                catch (er:Error)
                return;
            public function minusClick(arg1:flash.events.MouseEvent):void
                this.killTimer();
                var loc1:*;
                var loc2:*=((loc1 = this).current - 1);
                loc1.current = loc2;
                this.selectMovie();
                return;
            public function plusClick(arg1:flash.events.Event):void
                if (arg1.type != "timer")
                    this.killTimer();
                var loc1:*;
                var loc2:*=((loc1 = this).current + 1);
                loc1.current = loc2;
                this.selectMovie();
                trace("next");
                return;
            public function ENDED(arg1:flash.events.Event):void
                if (arg1.type != "timer")
                    this.killTimer();
                var loc1:*;
                var loc2:*=((loc1 = this).current + 1);
                loc1.current = loc2;
                this.selectMovie();
                trace("next");
                return;
            public function STARTED(arg1:flash.events.Event):void
                this.killTimer();
                return;
            function frame1():*
                this.timerGoing = true;
                addEventListener("endNow", this.ENDED, false, 0, true);
                addEventListener("startNow", this.STARTED, false, 0, true);
                this.init();
                return;
            public const XML_LOC:String=stage.loaderInfo.parameters.xmlLoc ? stage.loaderInfo.parameters.xmlLoc : "home_ads.xml";
            public const LABELS:__AS3__.vec.Vector.<String>=new Vector.<String>(6);
            public const BTNS:__AS3__.vec.Vector.<Btn>=new Vector.<Btn>();
            public const TRANSITION_TIME:Number=0.2;
            public var contentMask:flash.display.MovieClip;
            public var btnHolder_mc:flash.display.MovieClip;
            public var holder_mc:flash.display.MovieClip;
            public var indicator_mc:flash.display.MovieClip;
            public var prev_mc:flash.display.MovieClip;
            public var next_mc:flash.display.MovieClip;
            public var current:int;
            public var xmlData:XML;
            public var timer:flash.utils.Timer;
            public var timerGoing:Boolean;

  • Why iphone send me error 1009 i live in iran yeah i know but app store works for me until today that send me error 1009 please help me

    Why my iphone send me error 1009 , i know i live in iran and ... But appstore doesn't send me error until today that  i face with this error

    The 1009 error is normally associated with a blocked country. There are a list of countries that Apple is not allowed to sell their software to due to US restrictions. Iran and Syria come to mind but I believe there are about a dozen.

  • Adobe Air + Box2D.swc = TypeError: Error #1009 // New way to handle .swc files in Flash for iOS Apps?

    Hi,
    I need your help please - I have to update one of my iOS Apps. In this App I use Box2d for a simple maze game (it's an app for kids). When I publish & test this game on my Mac it works fine. I can drag my Hero (fish) through this Maze and all collision detections, gravity etc. work perfect.
    When I test it on my iPad it doesn't work. The device debugger shows this error message:
    TypeError: Error #1009: Cannot access a property or method of a null object reference.
      at global$init()
      at global$init()
      at Box2DAS.Common::b2Base$/initialize()[/Users/jan/Documents/_Projekte/Spielplatz/Universal_ Retina/src/com/Box2DAS/Common/b2Base.as:31]
      at wck::WCK/create()[/Users/jan/Documents/_Projekte/Spielplatz/Universal_Retina/src/com/wck/ WCK.as:26]
      at misc::Entity/ensureCreated()[/Users/jan/Documents/_Projekte/Spielplatz/Universal_Retina/s rc/com/misc/Entity.as:50]
      at misc::Entity/handleAddedToStage()[/Users/jan/Documents/_Projekte/Spielplatz/Universal_Ret ina/src/com/misc/Entity.as:100]
      at misc::Entity/handleAddedToStage()
    Line 31: loader = new CLibInit();
    I guess "CLibInit" should come from the .swc file.
    The thing is:
    I didn't change anything in this maze game - it seems this has to do something with the new Flash and/or Adobe Air version. Box2D.swc file is included:
    It always worked like this - and it works when testing it on my Mac - but it is no longer working on my current system.
    So I started my Mac from an older system (10.9.5 on an external HD) and published the App from Flash CS6 and Adobe Air 13.0 - then it suddenly worked on my iPad as before. I was able to tap an the fish and drag it arround.
    The same project / app published from my current OS X 10.10 + Flash CC 2014 + Adobe Air 15.0.0.302 is not working. I always receive this Error Message - I can not drag the fish - nothing happens. And I have no idea why this happens and what else I could do. I searched the whole day for a solution but didn't find anything.
    So did anything change by the way Flash and/or Air handles .swc files? Is there an other way to include: import cmodule.Box2D.* / CLibInit ?
    Please - if anyone has a clue - please let me know!!
    Best regards
    Jan

    Update:
    There is also an Android Version of this App. I just published and tested a new version of it on my kindle fire & Samsung Galaxy Tab 2. On both Tablets the maze works perfect. I'm able to drag the fish around etc.
    Then I published this Android Version for iOS and tested it on my iPad. Again I'm getting the Error message:
    TypeError: Error #1009: Cannot access a property or method of a null object reference. 
      at global$init() 
      at global$init() 
      at Box2DAS.Common::b2Base$/initialize()[/Users/jan/Documents/_Projekte/Spielplatz/Universal_ Retina/src/com/Box2DAS/Common/b2Base.as:31] 
      at wck::WCK/create()[/Users/jan/Documents/_Projekte/Spielplatz/Universal_Retina/src/com/wck/ WCK.as:26] 
      at misc::Entity/ensureCreated()[/Users/jan/Documents/_Projekte/Spielplatz/Universal_Retina/s rc/com/misc/Entity.as:50] 
      at misc::Entity/handleAddedToStage()[/Users/jan/Documents/_Projekte/Spielplatz/Universal_Ret ina/src/com/misc/Entity.as:100] 
      at misc::Entity/handleAddedToStage
    ...and the fish is stuck - I can't drag it - nothing happens. So this error only occurs when I publish the App for iOS - as an .ipa. Did anything change in the way Air handles .swc files?
    I'm totally confused
    If anybody has an idea what I could try - PLEASE LET ME KNOW!!

Maybe you are looking for