Null object reference error in Axis Renderer in Case of Stacked Column Chart
We are trying to display a Flex Column chart (when stacked ) with single value in DataProvider but we used to get following error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at mx.charts::AxisRenderer/calcStaggeredSpacing()[C:\Work\flex\dmv_automation\projects\datav isualisation\src\mx\charts\AxisRenderer.as:2195]
at mx.charts::AxisRenderer/calcRotationAndSpacing()[C:\Work\flex\dmv_automation\projects\dat avisualisation\src\mx\charts\AxisRenderer.as:1586]
at mx.charts::AxisRenderer/adjustGutters()[C:\Work\flex\dmv_automation\projects\datavisualis ation\src\mx\charts\AxisRenderer.as:1326]
at mx.charts::AxisRenderer/set gutters()[C:\Work\flex\dmv_automation\projects\datavisualisation\src\mx\charts\AxisRender er.as:798]
at mx.charts.chartClasses::CartesianChart/updateAxisLayout()[C:\Work\flex\dmv_automation\pro jects\datavisualisation\src\mx\charts\chartClasses\CartesianChart.as:2028]
at mx.charts.chartClasses::CartesianChart/updateDisplayList()[C:\Work\flex\dmv_automation\pr ojects\datavisualisation\src\mx\charts\chartClasses\CartesianChart.as:1355]
at mx.core::UIComponent/validateDisplayList()[C:\autobuild\galaga\frameworks\projects\framew ork\src\mx\core\UIComponent.as:6351]
at mx.managers::LayoutManager/validateDisplayList()[C:\autobuild\galaga\frameworks\projects\ framework\src\mx\managers\LayoutManager.as:622]
at mx.managers::LayoutManager/doPhasedInstantiation()[C:\autobuild\galaga\frameworks\project s\framework\src\mx\managers\LayoutManager.as:695]
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.core::UIComponent/callLaterDispatcher2()[C:\autobuild\galaga\frameworks\projects\frame work\src\mx\core\UIComponent.as:8733]
at mx.core::UIComponent/callLaterDispatcher()[C:\autobuild\galaga\frameworks\projects\framew ork\src\mx\core\UIComponent.as:8673]
at flash.utils::Timer/_timerDispatch()
at flash.utils::Timer/tick()
We have invested so much effort and done lots of googling and also followed the work around given on https://bugs.adobe.com/jira/browse/FLEXDMV-2275 but till now, we didn't get any solution.
I solved the issue by getting rid of the creationCompleteHandler event handlers for the KPI charts. But, since I am just days into flex development, I would be indebted if someone could explain to me why that was creating problems.
Similar Messages
-
The itemCreationPolicy works fine with spark components and other mx component until we hit by mx panel.
Looks like an error is thrown from StyleProtoChain.
The interesting thing is the null object reference error both occurs in Flex 4.0 and Flex 4.1, but caused by different objects.
Is there a workaround to use itemCreationPolicy on mx panel?
Thank you.Yes, there are all kinds of problems when you remove something from the screen that had focus (for instance, at that point you can't capture keyboard events either).
My code is sprinkled with so many things to make sure something is in focus, I tend to forget that I've done it.
In your code that changes the currentState, add
this.setFocus()
HTH;
Amy -
Flex 4.5: null object reference error on focus handling
The spark list in the following listing is only included in MyState1. If a CheckBox is checked, the MyState2 is set and therefore the spark list is removed from stage.
If I run the application with debugger attached and i check a CheckBox and then focus out and focus in the browser's window there is an error:
TypeError: Error #1009: Cannot access a property or method of a null object reference
at spark.components::Scroller/focusInHandler()[E:\dev\4.5.1\frameworks\projects\spark\src\sp ark\components\Scroller.as:1273]
at flash.display::Stage/set focus()
at mx.core::UIComponent/setFocus()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\core\UI Component.as:9895]
at mx.managers::FocusManager/activateHandler()[E:\dev\4.5.1\frameworks\projects\framework\sr c\mx\managers\FocusManager.as:689]
This is the code of the 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"
initialize="application1_initializeHandler(event);">
<fx:Script>
<![CDATA[
protected function application1_initializeHandler(event:Event):void
addEventListener("myComboBoxChanged", testHandler);
private function testHandler(e:Event):void
currentState = "MyState2";
]]>
</fx:Script>
<s:states>
<s:State name="MyState1"/>
<s:State name="MyState2"/>
</s:states>
<s:List includeIn="MyState1">
<s:dataProvider>
<s:ArrayList>
<fx:String>A</fx:String>
<fx:String>B</fx:String>
<fx:String>C</fx:String>
</s:ArrayList>
</s:dataProvider>
<s:itemRenderer>
<fx:Component>
<s:ItemRenderer>
<s:CheckBox label="CheckBox {data}" change="dispatchEvent(new Event('myComboBoxChanged', true));" />
</s:ItemRenderer>
</fx:Component>
</s:itemRenderer>
</s:List>
</s:Application>Yes, there are all kinds of problems when you remove something from the screen that had focus (for instance, at that point you can't capture keyboard events either).
My code is sprinkled with so many things to make sure something is in focus, I tend to forget that I've done it.
In your code that changes the currentState, add
this.setFocus()
HTH;
Amy -
Web-UI error message "Access via 'NULL' object reference not possible"
I need some help, I'm not a Basis person but I need to get this connection problem resolve.
This problem is in our DEV ICWeb system. After logging in to Web-UI, I got a error message "Access via 'NULL' object reference not possible". We have 3 clients (100, 220, & 310) in DEV and all 3 clients are giving me the same error message.
From the help.sap.com, I found this topic http://help.sap.com/saphelp_nwes70/helpdata/en/84/43f0d786304e19a652a8f80909a8ec/content.htm
but in the document it asked to go to SM59 to check the ESH_APPL_WS_TEMPLATEENGINE destination. But we don't have that destination setup in all our systems.
Here is the complete error message:
Error when processing your request
What has happened?
The URL http://crm-dev.staff.copa:8000/sap/bc/bsp/sap/crm_ui_frame/BSPWDApplication.do was not called due to an error.
Note
■The following error text was processed in the system CD1 : Access via 'NULL' object reference not possible.
■The error occurred on the application server CRM-DEV_CD1_00 and in the work process 0 .
■The termination type was: RABAX_STATE
■The ABAP call stack was:
Method: GET_DATA_LOSS_HANDLER of program CL_CRM_UI_CORE_APPL_CONTROLLERCP
Method: GET_DATA_LOSS_HANDLER of program CL_CRM_UI_CORE_APPL_CONTROLLERCP
Method: EH_TRIGGER_NAVIGATION of program CL_CRM_UI_CORE_APPL_CONTROLLERCP
Method: SET_WORKAREA_CONTENT of program CL_CRM_UI_CORE_APPL_CONTROLLERCP
Method: PROCESS_NAV_QUEUE of program CL_BSP_WD_VIEW_MANAGER========CP
Method: DO_INIT of program CL_CRM_UI_FRAME_APP_CONTROLLERCP
Method: DO_INIT of program CL_BSP_CTRL_ADAPTER===========CP
Method: GET_PAGE_CONTEXT_CURRENT of program CL_BSP_CONTEXT================CP
Method: ON_REQUEST_ENTER of program CL_BSP_RUNTIME================CP
Method: ON_REQUEST of program CL_BSP_RUNTIME================CP
What can I do?
■If the termination type was RABAX_STATE, then you can find more information on the cause of the termination in the system CD1 in transaction ST22.
■If the termination type was ABORT_MESSAGE_STATE, then you can find more information on the cause of the termination on the application server CRM-DEV_CD1_00 in transaction SM21.Hi Michael,
Refer to the link below and check the procedure.
http://help.sap.com/saphelp_nwes70/helpdata/en/84/43f0d786304e19a652a8f80909a8ec/content.htm
Regards,
Arjun -
Hi all ,
Im getting the below error , actually recently i created my own custom table zstudent, later i wrote select query to fetch data from the same and dump at internal table and then bind this to the table node.
But im getting below error, even i removed the select query still same error is occuring.
Error when processing your request
What has happened?
The URL http://********00.*****b.com:8000/sap/bc/webdynpro/sap/zdemo_student/ was not called due to an error.
Note
The following error text was processed in the system IDS : Access via 'NULL' object reference not possible.
The error occurred on the application server axsids00_IDS_00 and in the work process 0 .
The termination type was: RABAX_STATE
The ABAP call stack was:
Method: WDDOINIT of program /1BCWDY/YUSM2Q74A826Y0JY1I4V==CP
Method: IF_WDR_COMPONENT_DELEGATE~WD_DO_INIT of program /1BCWDY/YUSM2Q74A826Y0JY1I4V==CP
Method: DO_INIT of program CL_WDR_DELEGATING_COMPONENT===CP
Method: INIT_CONTROLLER of program CL_WDR_CONTROLLER=============CP
Method: INIT_CONTROLLER of program CL_WDR_COMPONENT==============CP
Method: INIT of program CL_WDR_CONTROLLER=============CP
Method: INIT of program CL_WDR_CLIENT_COMPONENT=======CP
Method: INIT of program CL_WDR_CLIENT_APPLICATION=====CP
Method: IF_WDR_RUNTIME~CREATE of program CL_WDR_MAIN_TASK==============CP
Method: HANDLE_REQUEST of program CL_WDR_CLIENT_ABSTRACT_HTTP===CPThanks Rama,
Acutally i accidentally commented the lo_nd_student = wd_context ....etc
this line was commented .
i have one small requirement to fetch data from local customised table and fill the same to internal table and bind that to table node.
my table node is student having attributes as name , city and number , all are of type strings.
now i created one custom table zstudent having ID - char of length 10,
name of type string
city of type string
num of type string
i have inserted records
but when i use select query to fill data from this zstudent to my internal table of type lt_student type wd_this->elements_student ,
im getting same above error. -
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}}); -
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 DasHere 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; -
Access via 'NULL' object reference not possible Error in WD application execution
Experts,
I am getting following error for web dynpro application intermittently, please find following error log:
What happened?
Error in the ABAP Application Program
The current ABAP program "CL_SALV_WD_C_TABLE_V_TABLE====CP" had to be
terminated because it has
come across a statement that unfortunately cannot be executed.
Error analysis
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_SY_REF_IS_INITIAL', was not
caught in
procedure "IF_SALV_WD_COMP_TABLE_DATA_MAP~MAP_TO_RESULT_CHANGES" "(METHOD)",
nor was it propagated by a RAISING clause.
Since the caller of the procedure could not have anticipated that the
exception would occur, the current program is terminated.
The reason for the exception is:
You attempted to use a 'NULL' object reference (points to 'nothing')
access a component.
An object reference must point to an object (an instance of a class)
before it can be used to access components.
Either the reference was never set or it was set to 'NULL' using the
CLEAR statement.
Information on where terminated
Termination occurred in the ABAP program "CL_SALV_WD_C_TABLE_V_TABLE====CP" -
in "IF_SALV_WD_COMP_TABLE_DATA_MAP~MAP_TO_RESULT_CHANGES".
The main program was "SAPMHTTP ".
In the source code you have the termination point in line 168
of the (Include) program "CL_SALV_WD_C_TABLE_V_TABLE====CM080".
The termination is caused because exception "CX_SY_REF_IS_INITIAL" occurred in
procedure "IF_SALV_WD_COMP_TABLE_DATA_MAP~MAP_TO_RESULT_CHANGES" "(METHOD)",
but it was neither handled locally nor declared
in the RAISING clause of its signature.
The procedure is in program "CL_SALV_WD_C_TABLE_V_TABLE====CP "; its source
code begins in line
1 of the (Include program "CL_SALV_WD_C_TABLE_V_TABLE====CM080 ".
Line SourceCde
138
139 "Set new value to result data
140 if ls_changelist-r_old_value is not bound.
141 "insert new table line
142 lr_component->r_result_data->if_salv_bs_r_data_table_edit~insert_table_line(
143 index = l_result_data_index ).
144 else.
145 "Modify existing table line
146 lr_component->r_result_data->if_salv_bs_r_data_table_edit~set_table_line(
147 index = l_result_data_index
148 data_line = <ls_table> ).
149 endif.
150 else.
151 "A single attribute value has to be updated
152
153 "Get context element from output data node
154 data lr_element type ref to if_wd_context_element.
155
156 "Retrieve the element to update from the data output node
157 if l_mass_edit_row_inserted = abap_true.
158 "The Element only exists virtually due to the mass edit mode.
159 lr_element = lr_node->get_element( l_mass_edit_virtual_index ).
160 l_mass_edit_row_inserted = abap_false.
161 else.
162 "The element already exists in the data output node.
163 lr_element = lr_node->get_element( ls_changelist-index ).
164 endif.
165
166 "Determine if the cell to be updated is set to null (Nullable)
167 data l_is_null type abap_bool.
>>>>> l_is_null = lr_element->is_attribute_null( ls_changelist-attribute ).
169
170 "Update result data with change
171 if <l_value> is assigned.
172 "update ResultData with cell value
173 lr_component->r_result_data->if_salv_bs_r_data_table_edit~set_table_cell(
174 index = l_result_data_index
175 attribute = ls_changelist-attribute
176 data_cell = <l_value>
177 is_null = l_is_null ).
178 else.
179 "Update result data without any updated cell value
180 lr_component->r_result_data->if_salv_bs_r_data_table_edit~set_table_cell(
181 index = l_result_data_index
182 attribute = ls_changelist-attribute
183 is_null = l_is_null ).
184 endif.
Please help us on what could be the reason behind this?
Thanks,
MadanHi Madan,
It seems that, there are user settings saved and the attribute in the layout settings is not available with current changes.
try to delete the user settings if any.
Please find my answer in the below link
Reset user settings in WDA
Hope this helps you.
Regards,
Rama -
Runtime error in WebDynpro - Access via 'NULL' object reference not possibl
Hi,
Structure of the CONTEXT in the VIEW::
WDSCREEN1
--> IMPORTING
--> S_KUNNR <- its a select option
--> EXPORTING
--> T_REPORT <- Which is table to hold the output data (with 4 fields)
In the context area i have root node (WDSCREEN1) and Sub nodes are IMPORTING and EXPORTING and child nodes as shown above. When i am referring them everything is fine except T_REPORT.
* Declaration
DATA: node TYPE REF TO if_wd_context_node,
node_exporting TYPE REF TO if_wd_context_node,
node_importing TYPE REF TO if_wd_context_node,
node_report TYPE REF TO if_wd_context_node,
node = wd_context->get_child_node( wd_this->wdctx_wdscreeb1 ).
node_exporting = node->get_child_node( wd_this->wdctx_exporting ).
node_importing = node->get_child_node( wd_this->wdctx_importing ).
* Bind the data to the context
node_report = node_exporting->get_child_node( name = 'T_REPORT` ).
node_report->bind_elements( lt_report ).
Its giving run time error 'Access via 'NULL' object reference not possible. ' when it comes to ' node_report->bind_elements( lt_report ).' I checked the content while debugging and found that it was initial. Not sure why Node_report is initial. all others have data.
node ->
node_exporting ->
node_importing ->
node_report ->http://wiki.sdn.sap.com/wiki/display/EP/PointersforTroubleshootingPortalRuntime+Errors
Hope this helps.
-Veer -
Error : Access not possible using "null" objects reference
Hello.
i am working with a zbapi.
i called a external email program in this bapi,everything is working fine over here.
In webdynpro java they mapped my bapi and starting working from there.
every functionality is working fine but regarding this email stuff it is showing an error as access not possible using null objects reference.
where could be the possible error.
is it in webdynpro or in abap side.Raghu,
You are right. When it comes from the WD Java, may be you are not passing any value at all. You can trace it by these ways.
1. Check it using SE37, make sure everyhting is fine.
2. Print all the values that you are passing to the RFC in the execute RFC method().
3. using ST05 transaction in R/3, enable RFC and SQL trace, check what is passing in between web dynpro and R/3.
Moreover paste your error message here.
Thanks,
Raj. -
Hi,
I'm having a lot of trouble getting a preloader to work on my Flash website. I'm new to actionscript, the site works fine but when I place the preloader in frame 1, I get.
Error#1009: Cannot access a property or method of a null object reference.
Then it lists three areas. The buttons on the site don't work anymore.
I've followed the Lynda com tutorials so don't know what is causing this error.
Included is the word.doc with the error code, preloader code, the main flash frame 2 code and the debug information.
Any help would be great.
Thanks!You need to make sure 'cards' is named properly and is present when that line of code executes. If it is somewhere down a timeline, it is not present.
As far as your preloader code goes, what is infoLoader. I have to assume it's some form of component since you don't have any code to instantiate it. -
Can anyone throw any light on this obscure Flex error?...
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at mx.controls::AdvancedDataGrid/findHeaderRenderer()[...path...\projects\datavisualisation\ src\mx\controls\AdvancedDataGrid.as:1350]
at mx.controls::AdvancedDataGrid/mouseEventToItemRenderer()[...path...\projects\datavisualis ation\src\mx\controls\AdvancedDataGrid.as:1315]
at mx.controls.listClasses::AdvancedListBase/mouseMoveHandler()[...path...\projects\datavisu alisation\src\mx\controls\listClasses\AdvancedListBase.as:8091]
I found a related bug reported on Jira: https://bugs.adobe.com/jira/browse/FLEXDMV-1631
But in our case, we have no zoom effect. It may be timing related, as there is a lot of computation going on when this page, and the ADG is first initialised.
Please?... Any suggestions or workarounds? We don't want this falling over in the hands of our customers.
<rant> And people wonder why I hate Flex!? These obscure instabilities never happen when I develop Pure ActionScript. The Flash platform is wonderfully stable. But as soon as you bring Flex into play, things take longer to develop, it's a struggle to extend or change the behaviour of the bloated components, and everything falls apart as these bugs begin to surface.</rant>facing the same problem... sdk 4.1. no solution for about 2 years ????
-
I am getting a runtime error when I click a button that fires
the addPerson function.
TypeError: Error #1009: Cannot access a property or method of
a null object reference.
at main/addPerson()[C:\Documents and Settings\edunn\My
Documents\Flex Builder 3\workspace2\Test-1\src\main.mxml:178]
at main/___main_Button4_click()[C:\Documents and
Settings\edunn\My Documents\Flex Builder
3\workspace2\Test-1\src\main.mxml:228]
I am new to Action Script - and object programming - so
understand...
I do not understand what I have done wrong here...
I have a result list coming from an external web service that
populates in a datagrid. I'd like to be able to update that
datagrid and then push back to the web service the new array.
Any ideas?????
import mx.rpc.events.ResultEvent;
import mx.rpc.events.FaultEvent;
import mx.collections.ArrayCollection;
import generated.webservices.FxAppiaUserFeaturesService;
import generated.webservices.UserSimRingConfig;
import generated.webservices.SimRingType;
public var plist:ArrayCollection
//Updated Function to populate the data from WS
public function
retrieveUserSimRingConfig(e:ResultEvent):void {
var UsrSimRngCfgNumList:Array = new
UserSimRingConfig().simRingNumberList;
var plist:ArrayCollection = e.result.simRingNumberList;
dgSimPhoneList.dataProvider = plist;
if (e.result.active) {
chboxSimultaneousRingPhones.selected=true;
} else {
chboxSimultaneousRingPhones.selected=false;
if (e.result.simRingType == "NO_RING_WHILE_ONCALL") {
chboxSimultaneousRing.selected=true;
} else {
chboxSimultaneousRing.selected = false;
// Add a person to the ArrayCollection.
public function addPerson():void {
plist.addItem({simRingNumberList:txtPhoneNumber1.text});
I posted this in the General Section first by
mistake...can u explain abt this line
var plist:ArrayCollection = e .
result.simRingNumberList; -
Hello
I'm trying to load a swf called "polaroids.swf" into my main swf called "09replacesSWF.swf". I keep getting the error when I test the movie. I'm completely lost and have been at this for hours. If I just test polaroids.fla the movie works fine but if I try to load it into 09replacesSWF.swf, I get the error. I need some help PLEASE!!!!!
I tried to debug the movie and flash says......."Cannot display source code at this location".
....... TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Polaroids$iinit()
Here is my AS code
package {
import flash.display.*;
import flash.filters.*;
import flash.utils.*;
import flash.net.*;
import flash.events.*;
import flash.filters.DropShadowFilter;
import caurina.transitions.*;
public class Polaroids extends MovieClip {
//Variables
public var stageContainer:MovieClip;
private var _scaleTempo:Number;
private var _thumbStr:Number;
private var _stageHeight:Number;
private var _stageWidth:Number;
private var _count:Number;
private var _initBGHeight:Number;
private var _initBGWidth:Number;
//Arrays
private var _backgroundImageArr:Array;
private var _imageURLArr:Array;
private var _imageCaptionArr:Array;
private var _imagesArr:Array;
//Bitmaps
private var _image:Bitmap;
private var _backgroundImage:Bitmap;
private var _bitmap:BitmapData;
private var _backgroundBitmap:BitmapData;
//XML
private var _xmlLoader:URLLoader;
private var _imageXML:XML;
//Holders
private var _imageContainer:ImageContainer;
private var _backgroundImageHolder:MovieClip;
//Image States
private var _activeImage = null;
private var _previousActiveImage = null;
//Loaders
private var backgroundImageLoader:Loader;
public function Polaroids() {
//sets up initial variable values
_count = 0;
_backgroundImageArr=new Array;
_imageURLArr=new Array;
_imageCaptionArr=new Array;
_imagesArr=new Array;
_scaleTempo=9;
_thumbStr = .3;
backgroundImageLoader = new Loader();
_stageHeight=stage.stageHeight;
_stageWidth=stage.stageWidth;
_backgroundImageHolder = new MovieClip();
stageContainer = new MovieClip();
addChild(stageContainer);
init();
//Add Stage Listener
private function addedToStage(e:Event):void {
stage.addEventListener(Event.RESIZE, onResize);
Initialise
private function init():void {
//Setup stage
stage.align = StageAlign.TOP_LEFT;
stage.scaleMode = StageScaleMode.NO_SCALE;
//Load XML
var _xmlLoader:URLLoader=new URLLoader;
_xmlLoader.load(new URLRequest("photos.xml"));
_xmlLoader.addEventListener(Event.COMPLETE,processXML);
this.addEventListener(Event.ADDED_TO_STAGE, addedToStage);
Process XML
private function processXML(e:Event):void {
_imageXML=new XML(e.target.data);
_backgroundImageArr[0] = _imageXML.@backgroundImage;
for (var i:int=0; i < _imageXML.*.length(); i++) {
_imageURLArr[i]=_imageXML.image[i].@url;
_imageCaptionArr[i]=_imageXML.image[i].@caption;
loadImages();
loadBackgroundImage();
Load Background Image
private function loadBackgroundImage():void {
backgroundImageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,addBack ground);
backgroundImageLoader.load(new URLRequest(_backgroundImageArr[0]));
Add background image to stage
private function addBackground(e:Event):void {
_backgroundImage=Bitmap(e.target.content);
_backgroundBitmap=_image.bitmapData;
_backgroundImage.smoothing = true;
_backgroundImageHolder.addChild(_backgroundImage);
_initBGHeight = backgroundImageLoader.contentLoaderInfo.height;
_initBGWidth = backgroundImageLoader.contentLoaderInfo.width;
if ((_initBGWidth/_initBGHeight) > (stage.stageWidth/stage.stageHeight)) {
_backgroundImageHolder.height = stage.stageHeight;
_backgroundImageHolder.width = _backgroundImageHolder.height * _initBGWidth / _initBGHeight;
} else {
_backgroundImageHolder.width = stage.stageWidth;
_backgroundImageHolder.height= _backgroundImageHolder.width * _initBGHeight / _initBGWidth;
Load Images
private function loadImages():void {
for (var i:int=0; i < _imageURLArr.length; i++) {
var imageLoader:Loader=new Loader;
imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,addImage);
imageLoader.load(new URLRequest(_imageURLArr[i]));
Add images to MovieClip on Stage
private function addImage(e:Event):void {
_image=Bitmap(e.target.content);
_bitmap=_image.bitmapData;
_image.smoothing = true;
_imageContainer = new ImageContainer();
_imageContainer.falseBtn.buttonMode = true;
_imageContainer.falseBtn.doubleClickEnabled = true;
_imageContainer.imageHolder.addChild(_image);//Add Bitmap to a MoviClip _imageContainer
_image.x = _imageContainer.width/2 - (_image.width/2 + 15);
_image.y = _imageContainer.height/2 - (_image.height/2 + 80) ;
_imageContainer.imageCaption.text = _imageCaptionArr[_count];
_imageContainer.scaleX = _thumbStr;
_imageContainer.scaleY = _thumbStr;
_imageContainer.rotation = 30 - 60 * Math.random();
if (Math.round(Math.random() * 1) == 1) {
_imageContainer.y=stage.stageHeight * Math.random() + _imageContainer.height * 2;
if (Math.round(Math.random() * 1) == 1) {
_imageContainer.x=stage.stageWidth + _imageContainer.width * 2;
} else {
_imageContainer.x=- _imageContainer.width * 2;
} else {
_imageContainer.x=stage.stageWidth * Math.random() + _imageContainer.width * 2;
if (Math.round(Math.random() * 1) == 1) {
_imageContainer.y=stage.stageHeight + _imageContainer.height * 2;
} else {
_imageContainer.y=- _imageContainer.height * 2;
//Setup Attributes
_imageContainer.newX = Math.round((_imageContainer.width/2) + (stage.stageWidth-_imageContainer.width)*Math.random());
_imageContainer.newY = Math.round((_imageContainer.height/2) + (stage.stageHeight-_imageContainer.height)*Math.random());
_imageContainer.oldRotation = _imageContainer.rotation;
_imageContainer.oldX = _imageContainer.newX;
_imageContainer.oldY = _imageContainer.newY;
_imageContainer.startX = _imageContainer.x;
_imageContainer.startY = _imageContainer.y;
_imageContainer.oldHeight = _imageContainer.scaleY;
_imageContainer.oldWidth = _imageContainer.scaleX;
_imageContainer.id = _count;
_imageContainer.addEventListener(Event.ENTER_FRAME, animateImage);
_imageContainer.addEventListener(MouseEvent.MOUSE_DOWN,dragImage);
_imageContainer.addEventListener(MouseEvent.MOUSE_UP,dropImage);
_imageContainer.addEventListener(MouseEvent.MOUSE_OUT, dropImage);
_imageContainer.falseBtn.addEventListener(MouseEvent.DOUBLE_CLICK, setup_activeImage);
_imagesArr.push(_imageContainer);//Add image reference to an Array
_imageContainer.filters = [new DropShadowFilter(0,0,0,.9,8,8,1,1,false,false)];
//Button Listeners
_imageContainer.nextBtn.visible = false;
_imageContainer.previousBtn.visible = false;
_imageContainer.nextBtn.buttonMode = true;
_imageContainer.previousBtn.buttonMode = true;
_imageContainer.nextBtn.addEventListener(MouseEvent.MOUSE_DOWN, nextImage);
_imageContainer.previousBtn.addEventListener(MouseEvent.MOUSE_DOWN, previousImage);
//Add Container to Stage
addChild(_imageContainer);
stageContainer.addChild(_imageContainer);
_count++;
Animate Images onto Stage
private function animateImage(e:Event):void {
e.target.y += (e.target.newY - e.target.y) / _scaleTempo;
e.target.x += (e.target.newX - e.target.x) / _scaleTempo;
if (Math.round(e.target.y) == e.target.newY) {
e.target.removeEventListener(Event.ENTER_FRAME, animateImage);
Drag & Drop Images
private function dragImage(e:MouseEvent) {
if (e.currentTarget != _activeImage) {
e.currentTarget.startDrag();
if (_activeImage == null) {
stageContainer.setChildIndex(DisplayObject(e.currentTarget), stageContainer.numChildren-1);
} else {
stageContainer.setChildIndex(DisplayObject(e.currentTarget), stageContainer.numChildren-2);
private function dropImage(e:MouseEvent) {
if (e.currentTarget != _activeImage) {
e.currentTarget.stopDrag();
e.currentTarget.oldX = e.currentTarget.x;
e.currentTarget.oldY = e.currentTarget.y;
onResize Handler
private function onResize(e:Event):void {
for (var i:int = 0; i<_imagesArr.length; i++) {
if (_imagesArr[i] != _activeImage) {
_imagesArr[i].x = Math.round(stage.stageWidth * (_imagesArr[i].x/_stageWidth));
_imagesArr[i].y = Math.round(stage.stageHeight * (_imagesArr[i].y/_stageHeight));
} else {
_activeImage.x = stage.stageWidth/2;
_activeImage.y = stage.stageHeight/2;
_imagesArr[i].oldX = Math.round(stage.stageWidth * (_imagesArr[i].oldX/_stageWidth));
_imagesArr[i].oldY = Math.round(stage.stageHeight * (_imagesArr[i].oldY/_stageHeight));
_imagesArr[i].newX = Math.round(stage.stageWidth * (_imagesArr[i].newX/_stageWidth));
_imagesArr[i].newY = Math.round(stage.stageHeight * (_imagesArr[i].newY/_stageHeight));
_imagesArr[i].startX = Math.round(stage.stageWidth * (_imagesArr[i].startX/_stageWidth));
_imagesArr[i].startY = Math.round(stage.stageHeight * (_imagesArr[i].startY/_stageHeight));
//Background Resizer
if ((_initBGWidth/_initBGHeight) > (stage.stageWidth/stage.stageHeight)) {
_backgroundImageHolder.height = stage.stageHeight;
_backgroundImageHolder.width = _backgroundImageHolder.height * _initBGWidth / _initBGHeight;
} else {
_backgroundImageHolder.width = stage.stageWidth;
_backgroundImageHolder.height= _backgroundImageHolder.width * _initBGHeight / _initBGWidth;
_stageWidth = stage.stageWidth;
_stageHeight = stage.stageHeight;
Handle Selected Image
private function zoomImage():void {
stageContainer.setChildIndex(_activeImage, stageContainer.numChildren-1);
Tweener.addTween(_activeImage,{scaleX: 1, scaleY: 1, rotation: 0, x: _stageWidth/2 , y: _stageHeight/2, time: 1});
_activeImage.nextBtn.visible = true;
_activeImage.previousBtn.visible = true;
private function returnImage():void {
stageContainer.setChildIndex(_previousActiveImage, stageContainer.numChildren-2);
Tweener.addTween(_previousActiveImage,{scaleX: .3, scaleY: .3, rotation: _previousActiveImage.oldRotation, x: _previousActiveImage.oldX , y: _previousActiveImage.oldY, time: 1});
_previousActiveImage.nextBtn.visible = false;
_previousActiveImage.previousBtn.visible = false;
private function setup_activeImage(e:Event):void {
if ((_activeImage == null) && (_previousActiveImage == null)) {
_activeImage = e.currentTarget.parent;
zoomImage();
} else if (e.currentTarget.parent != _activeImage) {
_previousActiveImage = _activeImage;
_activeImage = e.currentTarget.parent;
zoomImage();
returnImage();
} else {
Tweener.addTween(_activeImage,{scaleX: .3, scaleY: .3, rotation: _activeImage.oldRotation, x: _activeImage.oldX , y: _activeImage.oldY, time: 1});
_activeImage.nextBtn.visible = false;
_activeImage.previousBtn.visible = false;
_activeImage = null;
_previousActiveImage = null;
Button Handlers
private function nextImage(e:MouseEvent):void {
var imageID = int(e.currentTarget.parent.id);
if (imageID < _imagesArr.length - 1) {
_previousActiveImage = e.currentTarget.parent;
_activeImage = _imagesArr[imageID+1];
zoomImage();
returnImage();
} else {
_previousActiveImage = e.currentTarget.parent;
_activeImage = _imagesArr[0];
zoomImage();
returnImage();
private function previousImage(e:MouseEvent):void {
var imageID = int(e.currentTarget.parent.id);
if (imageID != 0) {
_previousActiveImage = e.currentTarget.parent;
_activeImage = _imagesArr[imageID-1];
zoomImage();
returnImage();
} else {
_previousActiveImage = e.currentTarget.parent;
_activeImage = _imagesArr[_imagesArr.length-1];
zoomImage();
returnImage();
}Raymond,
The error is at line 55....when I debug
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Polaroids$iinit()[/Volumes/Herman's Passport/Music Rocka/RockaGallery/Polaroids.as:55]
So i'm looking in the code..... -
hello,
I am trying to load a menu as an external file .... and getting this : TypeError: Error #1009: Cannot access a property or method of a null object reference.
at com::menu()
here is my code:
if(!menuLoader){
var menuRequest:URLRequest = new URLRequest("menu.swf");
var menuLoader:Loader = new Loader();
menuLoader.load(menuRequest);
container.addChild(menuLoader);
menuLoader.x = 700;
menuLoader.y = 50;
can anyone give me a helping hand?
thanks in advance.use:
here is my code:
if(menuLoader!=null){
var menuRequest:URLRequest = new URLRequest("menu.swf");
var menuLoader:Loader = new Loader();
menuLoader.load(menuRequest);
container.addChild(menuLoader);
menuLoader.x = 700;
menuLoader.y = 50;
Maybe you are looking for
-
Imported image's position moves when updated in Indesign CS6. Why??
After modifying an imported image from illustrator, the imported image's position moves within the frame of Indesign CS6 when the link is updated.
-
JLabel doesn't show up in the Applet
Hi, all, Could you please help me to see my code and tell me why the JLabel component doesn't show up in my applet? Thank you. It seems the applet's paint() overlaps the JLabel. I would like to create a JLabel on my applet, so that I can update the t
-
Here is a script that works in Adobe Acrobat Pro 9 but not in Adobe Designer... How do i change the code to work in designer? Thanks! var f1 = getField("text1"); var sDescription = "Acrobat; "; if (event.target.value != "Off") { f1.value += sDescript
-
Syncing App IDs across servers -- Best Practice?
This is prompted by a comment chrisstephens made in the thread at non-existent applications in non-existent workspaces reserving app id's Our developers are convinced that the application id's between our dev + staging + production environments need
-
Incorrect Web Display of Images
Images I have uploaded do not display the same Photosop as viewed in a browser (viewed in Safari, or Firefox on Apple Cinema display OS10.4.11) . The web images appear de-saturated and a bit washed out. (I use Adobe RGB 1998) I'm a print imaging spec