Error 1009 / Using swf in Flex
Hi all.
I am creating a small Flex Application which will include a swf.
The application consists of two panels, with the left being a Flash app. As the user moves the mouse over the Flash, it should trigger different messages on the right panel.
A screenshot is attached to get an idea of what I'm aiming for.
This is the error I'm getting:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at flash_component_fla::MainTimeline/frame1()
Additionally, I'm struggling with two things:
How do I get the output panel to display in the Rockwell font
How do I get the Flash part to send the mouse position to the Flex?
So this is what I have:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute"
height="610" width="750"
creationComplete="showCursor()" backgroundColor="white" cornerRadius="10" borderStyle="solid">
<mx:Style>
.boxClass {
fontFamily: Rockwell, Trebuchet MS, Helvetica, "_sans";
color: Red;
fontSize: 12;
fontWeight: bold;
</mx:Style>
<mx:Script>
<![CDATA[
[Bindable] public var clickText:XMLList;
private var panelText:XML =
<textDetails>
<bodyPart>
<partName>throat</partName>
<partNo>You cannot donate when you have a sore throat or a throat infection</partNo>
<partYes>Once the sore throat has cleared, or a week after any antibiotics have finished, you can donate.</partYes>
</bodyPart>
<bodyPart>
<partName>pregnancy</partName>
<partNo>You cannot donate wwhile you are pregnant</partNo>
<partYes>You can donate when the expected baby iis nine months old</partYes>
</bodyPart>
<bodyPart>
<partName>hayfever</partName>
<partNo>Only restricted iif you are feeling unwell</partNo>
<partYes>You can donate iif you are feeling well, even iif you are taking medication</partYes>
</bodyPart>
<bodyPart>
<partName>dentist</partName>
<partNo>Wait seven days after complicated dental work, such aas tooth extractions</partNo>
<partYes>You can donate after simple inspections, or after 24hrs after fillings.</partYes>
</bodyPart>
<bodyPart>
<partName>asthma</partName>
<partNo>If you having the effects of the asthma</partNo>
<partYes>You can donate iif you are feeling well, even iif you uuse a preventative inhaler</partYes>
</bodyPart>
<bodyPart>
<partName>Surgery</partName>
<partNo>Major Surgery: Please call the helpline</partNo>
<partYes>Minor Surgery: As long aas there were no complications and the donor has recovered.</partYes>
</bodyPart>
</textDetails>
import mx.managers.CursorManagerPriority;
import mx.managers.CursorManager;
import flash.events.Event;
private function functions():void {
throat.addEventListener(MouseEvent.CLICK, changeText);
private function changeText(event:Event):void {
clickText = panelText.bodyPart[0].partYes;
output.text= clickText;
[Embed("nbs1.gif")]
private var customCursor:Class;
private function showCursor():void
CursorManager.setCursor(
customCursor,
CursorManagerPriority.HIGH,
-1,
-1);
]]>
</mx:Script>
<mx:Panel x="481" y="69" width="250" height="516" layout="absolute" id="rt">
<mx:Text x="10" y="10" text="Other Considerations..."/>
<mx:Accordion x="8" y="36" width="212" height="277">
<mx:Canvas label="Blood Transfusions" width="100%" height="100%" dropShadowEnabled="true" dropShadowColor="#F50B0B">
<mx:Text x="10" y="10" width="190">
<mx:htmlText>If you have recieved a blood transfusion since the beginning of 1980, you cannot currently donate.</mx:htmlText>
</mx:Text>
</mx:Canvas>
<mx:Canvas label="Travel" width="100%" height="100%">
<mx:Text x="10" y="10" width="190">
<mx:htmlText>Travellers to malarial areas and countries with West Nile Virus should contact the helpline for more details.</mx:htmlText>
</mx:Text>
</mx:Canvas>
<mx:Canvas label="Weight" width="100%" height="100%">
<mx:Text x="10" y="10" width="190">
<mx:htmlText>You need to weigh 50kg, or 7st 12lb to donate.</mx:htmlText>
</mx:Text>
</mx:Canvas>
<mx:Canvas label="Tattoos and piercings" width="100%" height="100%">
<mx:Text x="10" y="10" width="190">
<mx:htmlText>Any new piercings or tattoos, or acupuncture? You now have to wait just four months before being eligible to donate.</mx:htmlText>
</mx:Text>
</mx:Canvas>
<mx:Canvas label="Age Limits" width="100%" height="100%">
<mx:Text x="10" y="10" width="190">
<mx:htmlText>
Under 16: Too young. Sorry!
16 - 17: You can register, but not donate 17 - 65: Please register! 66 - 70: If you have ever donated, you can donate 70+: Only if you have donated in the last two years.
</mx:htmlText>
</mx:Text>
</mx:Canvas>
<mx:Canvas label="Antibiotics" width="100%" height="100%">
<mx:Text x="10" y="10" width="190">
<mx:htmlText>
You can donate seven days after the antibiotics have finished, as long as the infection has cleared.
</mx:htmlText>
</mx:Text>
</mx:Canvas>
<mx:Canvas label="Common Cold" width="100%" height="100%">
<mx:Text x="10" y="10" width="190">
<mx:htmlText>
You can donate when the cold has cleared and you are feeling well.
</mx:htmlText>
</mx:Text>
</mx:Canvas>
</mx:Accordion>
<mx:TextArea
id="output"
x="10" y="321"
text="Move the cursor over the bodies to find out more about how your health affects blood donation!"
width="210" color="#F21212" styleName="boxClass" height="68"/>
</mx:Panel>
<mx:Image x="667" y="35" source="NHS.jpg" width="65" height="26"/>
<mx:Image x="10" y="22" source="headline.gif"/>
<mx:SWFLoader x="10" y="69" source="flash_component.swf" id="throat"/>
</mx:Application>
Hmm, thanks Flex HarUI... IU I kinda think the boffins at Adobe are less likely than me to have the problems.
I'm going to attach the swf and it's associated .fla if that is any more help.
For the record this is the Error Message:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at flash_component_fla::MainTimeline/frame1()
Any help would be hugely appreciated...
Similar Messages
-
Error in compiling swf for Flex 2 application
Hello experts!
After applying SPS 7 for EHP1 7.0 I am receiving the following error when deploying my model.
Error in compiling swf for Flex 2 application. The log is appended below.
I realized the error only occurs when I use value help.
Can anybody advise please.
Thanks,
Ibrahim
Error in compiling Flex application: /usr/sap/QJB/JC01/j2ee/cluster/server0/GUIMachine_Business_Packages/[xxx]MyModels.QM.Tab_test/FLEX_COMPILATION_FOLDER/AAD3KX_P.mxml(17): col: 145 Error: Element type "vc:LabeledDropDown" must be followed by either attribute specifications, ">" or "/>".
<vc:LabeledDropDown comboHeight="16" width="200" labelField="text" selectedIndex="{VC.getEnumIndex(AXCWV1, AAA3L21.Current.SELOP_TYPE || "BT", 'value')}" valueProperty="SELOP_TYPE" valueObject="{(AAA3L21.Current)}" id="ACA3L21_DropDown1" dataProvider="" comboComponent_y="40" prompt="" label="{(Languser1.BhlfcdeBHckjkGcInkHE)}" comboY="40" visible="{DE.NOT(false)}" creationComplete="AXCWV1.addEventListener(InfosetEvent.DATA_REFILLED, selectDefaultACA3L21_DropDown1)" component_x="88" x="8"/>
Edited by: Ibrahim Ibrahim on Apr 15, 2011 1:19 PMWe have solved this by applying note: 1510453 - Certain default values in list-based controls causes error
-
Error while using parsleyframework in flex
Hi,
i am getting below error whilr running flex application in parsley framework .
Error Details:
Illegal override of ModuleInfoProxy in FlexModuleSupport.as$348.ModuleInfoProxy.
param count mismatch
param count mismatch,birt params=2 optional=2 mx.modules::IModuleInfo/mx.modules:IModuleInfo::load()
Please help meHmm, thanks Flex HarUI... IU I kinda think the boffins at Adobe are less likely than me to have the problems.
I'm going to attach the swf and it's associated .fla if that is any more help.
For the record this is the Error Message:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at flash_component_fla::MainTimeline/frame1()
Any help would be hugely appreciated... -
Runtime Error 1009 After Converting from Flex 3.6 to 4.5.1
I am in the process of converting my application from SDK 3.6 to 4.5.1. The process is going smoothly thanks to the many resources out there including Greg Lafrance's series http://www.adobe.com/devnet/flex/articles/migrating-flex-apps-part1.html
I am now getting an error while the application is loading in the browser. The error text is:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at main/initApp()...
The error occurs in the AS code where I am attempting to get the URL from the player using the mx.utils.URLUtil library. In particular, I am setting a global variable in my app to the URL of the visitor. The specific code for this is:
this.stServerName=URLUtil.getServerName(mainApp.url);
Is URLUtil still in use in Flex 4.5.1? If not, is there another way to get the server name from the host?
Thanks!
LeeURLUtil still exists. I would verify what is null.
-
TypeError: Error #1009 (loaded SWF)
I'm pulling out my hair on this one!
I'm just starting a site (full-Flash site) using CS3 and AS3.
I'm pretty much accustom to the new AS3 changes. I built a rough
structure to make sure the way I wanted to set the site up would
work (loading in external SWFs, etc.). The tests worked.
Now, I'm going in to make some things real, and I'm getting
this error as soon as an external SWF loads in:
TypeError: Error #1009: Cannot access a property or method of
a null object reference.
at test_fla::MainTimeline/test_fla::frame2()
I've tried narrowing it down, couldn't find the exact culprit
(had to remove every ounce of ActionScript before it started to
function again). So I started to rebuild that movie entirely --
cleared out the Library and deleted every layer. Didn't work.
Couldn't even add a stop(); action in Frame 1.
Then I started completely fresh File > New, rebuilt again.
I tested after every single change. I finally built it up to the
point where I first tested the original, and it worked. So, then I
added a couple more things tested again, and got the error again.
Ahh, so I removed EXACTLY what I had just added. Tested again. SAME
ERROR -- now it won't go away no matter what I remove!
Crazier yet is that I can still load in my other test SWF
files and they have actions in them, and they're set up the exact
same way -- but they work...
The whole site is new, so every SWF is CS3/AS3. I'm not even
doing anything crazy, so I'm getting pretty frustrated trying to
build an all AS3 site and I can't even do basic stuff....
I can upload/email the FLA files in question if anyone has
time to look...
Thanks,
BrandonWell, when I test the loaded SWF within the Flash environment
(by itself), it plays just fine.
Then, I try to play the root containing movie (both within
Flash and on the web server) and as soon as that section loads, is
when the error occurs.
I've tried tracing everything. even down to putting trace()
actions between every layer. Can't determine what causes it...
One thing I noticed (but I assume is a naming convention that
Flash uses), is in the error above you see "test_fla", well, lets
say I have these files:
test-container.fla
test-home.fla
I don't have a test_fla, but the error code refers to it
anyway... -
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 as3 code to install an Air application from an embedded swf.
Hi, I am getting error #1009 in my code when i try to install the application. I am new to action script and below is the code for my installer.
var airSWF:Object; // This is the reference to the main class of air.swf
var airSWFLoader:Loader = new Loader(); // Used to load the SWF
var loaderContext:LoaderContext = new LoaderContext();
// Used to set the application domain
var paramObjAppid:Object = LoaderInfo(this.root.loaderInfo).parameters.appid;
//var paramObj:Object = LoaderInfo(this.root.loaderInfo).parameters;
loaderContext.applicationDomain = ApplicationDomain.currentDomain;
airSWFLoader.contentLoaderInfo.addEventListener(Event.INIT, onInit);
airSWFLoader.load(new URLRequest("http://airdownload.adobe.com/air/browserapi/air.swf"),
loaderContext);
function onInit(e:Event):void
airSWF = e.target.content;
var url = '';
var qty = '';
var appID = '';
var pubID = "";
var runtimeVersion = "3";
var tf:TextField = new TextField(); // create a TextField names tf for debugging
tf.autoSize = TextFieldAutoSize.LEFT;
//tf.size = 4;
tf.wordWrap = true;
tf.border = true;
addChild(tf);
try
var keyStr:String;
var valueStr:String;
var paramObj:Object = LoaderInfo(this.root.loaderInfo).parameters; //set the paramObj variable to the parameters property of the LoaderInfo object
for (keyStr in paramObj)
valueStr = String(paramObj[keyStr]);
if ( keyStr == 'qty' ) {
qty = Number(valueStr);
if ( keyStr == 'url' ) {
url = escape(valueStr);
if ( keyStr == 'appid') {
appID = valueStr;
catch (error:Error)
var arguments:Array = [qty];
launchBtn.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler_2);
function fl_MouseClickHandler_2(event:MouseEvent):void
airSWF.getApplicationVersion(appID, pubID, versionDetectCallback);
function versionDetectCallback(version:String):void
if (version == null)
trace("Not installed.");
tf.appendText('Not Installed');
try {
airSWF.installApplication(url, runtimeVersion, arguments);
catch (error:Error){
tf.appendText(error.toString());
else
trace("Version", version, "installed.");
tf.appendText("appID="+appID);
try {
airSWF.launchApplication(appID, pubID );
catch(error:Error) {
tf.appendText(error.toString());I managed to figure out what was causing the issue, I had a particular png image in my projects assets folder that seemed to be the culprit. Once I removed it the app installs just fine? Really weird?
Adam -
When i use papervision in flash builder and i am doing a test, when i render a sphere using papervision with the following code it renders me the sphere.
When i add a line sphere.pitch(2); ||
sphere.yaw(2);
sphere.roll(2);
i get the following error,
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at PvTest/onRenderTick()[D:\Android 3D\PvTest\src\PvTest.as:39]
Can anyone help me figure out the error
For additional Info, these are the imports i am doing:
import org.papervision3d.objects.primitives.Sphere;
import org.papervision3d.view.BasicView;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. -
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..... -
Error 1009 when loading swf?
Hi
I am trying to load an external swf (which references external files)
everything seems to be fine only when i publish it i get error 1009
Here is my code
var swf:MovieClip;
var loader:Loader = new Loader();
var defaultSWF:URLRequest = new URLRequest("mainVideo/preview.swf");
loader.load(defaultSWF);
addChild(loader);
The strange thing i that i followed this tutorial
http://www.youtube.com/watch?v=8hAIW0ppDww
and write the same code but i still get the error.
I read about referencing external swf with referenced files, seems to be an issue with that, am i right?
Thanks.public function videoplayer()
//set default values
addEventListener(Event.ADDED_TO_STAGE,setDefaultValues);
//read flashvars
readFlashVars();
//init video player
//set default values function
private function setDefaultValues(e:Event){
//set scale properties
stage.scaleMode=StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
//add fullscreen event to the stage
stage.addEventListener(FullScreenEvent.FULL_SCREEN, fsEvent);
stage.addEventListener(KeyboardEvent.KEY_UP, keyDownHandler);
//set video url
videoUrl = "videos/video1.flv";
//set image url
imageUrl = "image/image1.jpg";
//set video height
videoHeight = 320;
//set video width
videoWidth = 480;
//set autoplay to false;
autoplay = "false";
All_mc.videoHolder_mc.alpha = 0;
All_mc.controls_mc.playPauseBut_mc.pause_mc.visible = false;
All_mc.playPause_mc.pause_mc.visible = false;
All_mc.controls_mc.playPauseBut_mc.pause_mc.over_mc.visible = false;
All_mc.controls_mc.playPauseBut_mc.pause_mc.click_mc.visible = false;
All_mc.controls_mc.playPauseBut_mc.play_mc.over_mc.visible = false;
All_mc.controls_mc.playPauseBut_mc.play_mc.click_mc.visible = false;
All_mc.controls_mc.fullscreenBut_mc.over_mc.visible = false;
All_mc.controls_mc.fullscreenBut_mc.click_mc.visible = false;
initPlayer();
//make player visible
All_mc.alpha = 1;
//add buttons events
addButtonsEvents();
//load image
loadImage();
//load video
loadVideo(true);
MAKE SURE YOU HAVE THE video1.flv in a directory called videos and its relative to the swf.
BR
Murtuza
http://www.sowebme.com/murtaza -
I see error 1009 every time i want to use apple store.whats that ?
i see error 1009 every time i want to use apple store.whats that ?
it means you are trying to use the app store from a country that you are not in
-
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. -
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> -
Error #1009 when loading a module
Hello Forum Folks,
I'm in the process of trying to upgrade our app from 2.0 to
2.0.1. In this application we have an SWFLoader that loads up
applications as requested by the user. It worked fine with no
problems. I'm attempting to use the ModuleLoader in the same way,
but I am receiving this error:
[SWF]
/flex/PMPortal/com/sundt/addressbook/company_find_app.swf - 855,412
bytes after decompression
TypeError: Error #1009: Cannot access a property or method of
a null object reference.
at mx.managers::HistoryManager$/register()
at mx.containers::ViewStack/::addedHandler()
at flash.display::DisplayObjectContainer/addChildAt()
at mx.core::UIComponent/
http://www.adobe.com/2006/flex/mx/internal::$addChildAt()[C:\dev\flex_201_gmc\sdk\framewor ks\mx\core\UIComponent.as:4676
at
mx.core::Container/addChildAt()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\Container.as:2 278]
at
mx.core::Container/addChild()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\Container.as:221 4]
at
mx.core::Container/createComponentFromDescriptor()[C:\dev\flex_201_gmc\sdk\frameworks\mx\ core\Container.as:3721]
at
mx.core::Container/createComponentsFromDescriptors()[C:\dev\flex_201_gmc\sdk\frameworks\m x\core\Container.as:3533]
at
mx.core::Container/mx.core:Container::createChildren()[C:\dev\flex_201_gmc\sdk\frameworks \mx\core\Container.as:2618]
at
mx.core::UIComponent/initialize()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\UIComponent. as:4937]
at
mx.core::Container/initialize()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\Container.as:2 555]
at com.sundt.addressbook::find_company_criteria/initialize()
at mx.core::UIComponent/
http://www.adobe.com/2006/flex/mx/internal::childAdded()[C:\dev\flex_201_gmc\sdk\framework s\mx\core\UIComponent.as:4834
at mx.core::Container/
http://www.adobe.com/2006/flex/mx/internal::childAdded()[C:\dev\flex_201_gmc\sdk\framework s\mx\core\Container.as:3347
at
mx.core::Container/addChildAt()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\Container.as:2 280]
at
mx.containers::Form/addChildAt()[C:\dev\flex_201_gmc\sdk\frameworks\mx\containers\Form.as :179]
at
mx.core::Container/addChild()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\Container.as:221 4]
at
mx.containers::Form/addChild()[C:\dev\flex_201_gmc\sdk\frameworks\mx\containers\Form.as:1 68]
at
mx.core::Container/createComponentFromDescriptor()[C:\dev\flex_201_gmc\sdk\frameworks\mx\ core\Container.as:3721]
at
mx.core::Container/createComponentsFromDescriptors()[C:\dev\flex_201_gmc\sdk\frameworks\m x\core\Container.as:3533]
at
mx.core::Container/mx.core:Container::createChildren()[C:\dev\flex_201_gmc\sdk\frameworks \mx\core\Container.as:2618]
at
mx.core::UIComponent/initialize()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\UIComponent. as:4937]
at
mx.core::Container/initialize()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\Container.as:2 555]
at mx.core::UIComponent/
http://www.adobe.com/2006/flex/mx/internal::childAdded()[C:\dev\flex_201_gmc\sdk\framework s\mx\core\UIComponent.as:4834
at mx.core::Container/
http://www.adobe.com/2006/flex/mx/internal::childAdded()[C:\dev\flex_201_gmc\sdk\framework s\mx\core\Container.as:3347
at
mx.core::Container/addChildAt()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\Container.as:2 280]
at
mx.core::Container/addChild()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\Container.as:221 4]
at
mx.core::Container/createComponentFromDescriptor()[C:\dev\flex_201_gmc\sdk\frameworks\mx\ core\Container.as:3721]
at
mx.core::Container/createComponentsFromDescriptors()[C:\dev\flex_201_gmc\sdk\frameworks\m x\core\Container.as:3533]
at
mx.containers::Panel/createComponentsFromDescriptors()[C:\dev\flex_201_gmc\sdk\frameworks \mx\containers\Panel.as:1308]
at
mx.core::Container/mx.core:Container::createChildren()[C:\dev\flex_201_gmc\sdk\frameworks \mx\core\Container.as:2618]
at
mx.containers::Panel/mx.containers:Panel::createChildren()[C:\dev\flex_201_gmc\sdk\framew orks\mx\containers\Panel.as:863]
at
mx.core::UIComponent/initialize()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\UIComponent. as:4937]
at
mx.core::Container/initialize()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\Container.as:2 555]
at mx.core::UIComponent/
http://www.adobe.com/2006/flex/mx/internal::childAdded()[C:\dev\flex_201_gmc\sdk\framework s\mx\core\UIComponent.as:4834
at mx.core::Container/
http://www.adobe.com/2006/flex/mx/internal::childAdded()[C:\dev\flex_201_gmc\sdk\framework s\mx\core\Container.as:3347
at
mx.core::Container/addChildAt()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\Container.as:2 280]
at
mx.core::Container/addChild()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\Container.as:221 4]
at
mx.core::Container/createComponentFromDescriptor()[C:\dev\flex_201_gmc\sdk\frameworks\mx\ core\Container.as:3721]
at
mx.core::Container/createComponentsFromDescriptors()[C:\dev\flex_201_gmc\sdk\frameworks\m x\core\Container.as:3533]
at
mx.core::Container/mx.core:Container::createChildren()[C:\dev\flex_201_gmc\sdk\frameworks \mx\core\Container.as:2618]
at
mx.core::UIComponent/initialize()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\UIComponent. as:4937]
at
mx.core::Container/initialize()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\Container.as:2 555]
at mx.core::UIComponent/
http://www.adobe.com/2006/flex/mx/internal::childAdded()[C:\dev\flex_201_gmc\sdk\framework s\mx\core\UIComponent.as:4834
at mx.core::Container/
http://www.adobe.com/2006/flex/mx/internal::childAdded()[C:\dev\flex_201_gmc\sdk\framework s\mx\core\Container.as:3347
at
mx.core::Container/addChildAt()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\Container.as:2 280]
at
mx.core::Container/addChild()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\Container.as:221 4]
at
mx.core::Container/createComponentFromDescriptor()[C:\dev\flex_201_gmc\sdk\frameworks\mx\ core\Container.as:3721]
at
mx.core::Container/createComponentsFromDescriptors()[C:\dev\flex_201_gmc\sdk\frameworks\m x\core\Container.as:3533]
at
mx.core::Container/mx.core:Container::createChildren()[C:\dev\flex_201_gmc\sdk\frameworks \mx\core\Container.as:2618]
at
mx.core::UIComponent/initialize()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\UIComponent. as:4937]
at
mx.core::Container/initialize()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\Container.as:2 555]
at com.sundt.addressbook::company_find_app/initialize()
at mx.core::UIComponent/
http://www.adobe.com/2006/flex/mx/internal::childAdded()[C:\dev\flex_201_gmc\sdk\framework s\mx\core\UIComponent.as:4834
at mx.core::Container/
http://www.adobe.com/2006/flex/mx/internal::childAdded()[C:\dev\flex_201_gmc\sdk\framework s\mx\core\Container.as:3347
at
mx.core::Container/addChildAt()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\Container.as:2 280]
at
mx.core::Container/addChild()[C:\dev\flex_201_gmc\sdk\frameworks\mx\core\Container.as:221 4]
at
mx.modules::ModuleLoader/mx.modules:ModuleLoader::moduleReadyHandler()[C:\dev\flex_201_gm c\sdk\frameworks\mx\modules\ModuleLoader.as:339]
at
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at
ModuleManager.as$117::ModuleInfoProxy/ModuleManager.as$117:ModuleInfoProxy::moduleEventHa ndler()[C:\dev\flex_201_gmc\sdk\frameworks\mx\modules\ModuleManager.as:1025]
at
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at
ModuleManager.as$117::ModuleInfo/readyHandler()[C:\dev\flex_201_gmc\sdk\frameworks\mx\mod ules\ModuleManager.as:704]
I'm not sure what is null, as I don't have the source code
for the HistoryManager. It seems to be generating an error while
attempting to initialize a component that is part of the module
that it is currently loading. The strange part about this is that I
can load the module a once and then it will error, as show below:
[SWF] /flex/PMPortal/pmportal-debug.swf - 1,033,911 bytes
after decompression
[SWF]
/flex/PMPortal/com/sundt/addressbook/company_find_app.swf - 855,412
bytes after decompression
[SWF] /flex/PMPortal/blank_app.swf - 484,084 bytes after
decompression
[SWF] /flex/PMPortal/blank_app.swf - 484,084 bytes after
decompression
[SWF]
/flex/PMPortal/com/sundt/addressbook/contact_find_app.swf - 678,199
bytes after decompression
[SWF]
/flex/PMPortal/com/sundt/addressbook/personalCompanies/personal_companies_wizard_app.swf
- 809,691 bytes after decompression
[SWF]
/flex/PMPortal/com/sundt/addressbook/company_find_app.swf - 855,412
bytes after decompression
TypeError: Error #1009: Cannot access a property or method of
a null object reference.
at mx.managers::HistoryManager$/register()
There are also times that it will error on loading another
module just once.
Now, I am loading all my modules through the same
ModuleLoader without unloading them. I assume that this is correct
way to do this.
If I comment out the offending component, everything works
fine. The components worked fine before when I had them in
applications.
Not sure where to go from here... any ideas would be great.
Thanks in advance.
--Andyquote:
Originally posted by:
josh1093
I am getting the same error loading modules. For me I found
that changing the layout properties of the container that I am
loading the module in made the problem appear and go away. I'm
loading a module as an itemrenderer in a TileList. If I set the
columnWidth and rowHeight properties of the list then I have
problems. If I don't set them both, then I get the
"ModuleManager.as:671" null pointer problem. I'm guessing that by
setting the size ahead of time for the itemRenderer flex doesn't
need to query the module until later which gives it time to load.
Seems like a race condition to me. This is yet another bug in flex.
My application populates a number of VBox ( the number of
boxes are based on the xml data). Each VBox loads the module with
different data set. The module only contain advancedatagrid. The
VBox's size are preset with percentwidth and percentheight prior
calling a module loader. I also tried to specified the size in
pixels. But, no luck.
Once a while, I got the below messages at the console window
running in debug mode. Is the unload swf message normal? I have no
intention to unload the module in my code. If the module shouldn't
be unload, then obviously there is a problem.
[SWF] /SARA/CellDashboard.swf - 1,564,059 bytes after
decompression
[SWF] /SARA/modules/TrendChart.swf - 1,576,416 bytes after
decompression
[SWF] /SARA/modules/StdDataGrid.swf - 1,043,055 bytes after
decompression
[SWF] /SARA/modules/StdDataGrid.swf - 1,043,055 bytes after
decompression
[SWF] /SARA/modules/AdvDataGrid.swf - 1,259,638 bytes after
decompression
[SWF] /SARA/modules/AdvDataGrid.swf - 1,259,638 bytes after
decompression
[Unload SWF] /SARA/modules/AdvDataGrid.swf -
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;
Maybe you are looking for
-
How to change VO's dynamically for a item for each row in advanced table?
Hi All, We had a requirement to filter the employees based on the search criteria table. I am using advanced table for developing search criteria. In that table I am having three columns. Operator (messagechoice), Criteria Type (messagechoice), and C
-
Environment....
Hi all, I'm bored so I just thought i'd throw this into the mix for fun! Having been a Cubase/Nuendo user up until earlier this year and plunging for a Mac Pro and LP7, I for one am glad to see the environment has been shifted toward the back of the
-
THANK YOU Don Archibald and a brody
Now that I know how to post a message i will thank Don Archibald for teaching me how to do so. I would also like to thank a brody for instructing me on how to find the solution/download so that my imac lets me use 1.3.5 usb mass storage.Apple Discuss
-
Illustrator file open - setting location
Hi, When doing a file open can we set Illustrator so that it points the same location each time ? The user uses a specific folder and wants to open to this folder everytime. any ideas ? Thanks,
-
Regarding re-installation of operating system vista to my laptop
i want to re install windows vista but the drive in which i want to install not having enough space. and one more major problem i have i. e., i need lenovo 3000 G400/G410 Drivers v1.1 vs. please solve my problem as soon as possible. It's urgent bec