TypeError: Error #1006 (SET_OPEN)
Hi,
When creating a segementation model I suddenly (without beeing aware of any changes) get the error message TypeError: Error #1006 (SET_OPEN).
Have anybody seen this before?
regards Camilla
Hi Camilia,
I am also facing similar type of error. Is it related to Internet Settings. Would you please help me in resolving it.
Thanks for your help.
Thanks,
Rahul
Similar Messages
-
TypeError: Error #1006 - Removing MovieClip from the stage
I have a movie clip that is called to the stage and once the movieclip is finished it calls a function that removes it from the stage. The code works but I get an error message about 4 seconds after the movie clip ends.
Here’s the error message:
TypeError: Error #1006: exitWordMicroscopic is not a function.
at ASvocabulary_microscopic/frame110()[ASvocabulary_microscopic::frame110:1]
Here’s the stage code:
//************************Removes the movieclip from the stage and enables the button.*************************
function exitWordMicroscopic():void
bnt_vocab_microscopic.mouseEnabled = true;
removeChild(word_Microscopic);
//******************************Stage buttons**************************************
stage.addEventListener(MouseEvent.MOUSE_DOWN, goButtonsHomeRead_1);
function goButtonsHomeRead_1(event:MouseEvent):void
//Vocabulary buttons
if (event.target == bnt_vocab_microscopic)
bnt_vocab_microscopic.mouseEnabled = false;
SoundMixer.stopAll();
addChild(word_Microscopic);
word_Microscopic.x = 47;
word_Microscopic.y = 120;
Here’s the code inside the movie clip. This is what the error message is referring to:
//****************** Calls function to remove itself from the stage****************************
Object(parent).exitWordMicroscopic();
What am I doing wrong?Here' how the code looks now:
Objective: To remove the current movieclip while it's playing so that it does not show on the next (or previous) frame.
Here’s the stage code:
var word_Microscopic:ASvocabulary_microscopic = new ASvocabulary_microscopic();
//Removes the movieclip from the stage and enables the button.
function exitWordMicroscopic():void
bnt_vocab_microscopic.mouseEnabled = true;
removeChild(word_Microscopic);
//******************************Stage buttons**************************************
stage.addEventListener(MouseEvent.MOUSE_DOWN, goButtonsHomeRead_1);
function goButtonsHomeRead_1(event:MouseEvent):void
//Vocabulary buttons
if (event.target == bnt_vocab_microscopic)
SoundMixer.stopAll();
bnt_vocab_microscopic.mouseEnabled = false;
addChild(word_Microscopic);
word_Microscopic.x = 47;
word_Microscopic.y = 120;
word_Microscopic.play();
//This button takes the user to the Main Screen
if (event.target == bnt_ReadGoHome_1)
// exitWordMicroscopic(); [If I use this function I get this error ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller.]
SoundMixer.stopAll();
gotoAndPlay("1","Main");
stage.removeEventListener(MouseEvent.MOUSE_DOWN, goButtonsHomeRead_1);
//This takes the user to the next frame.
if (event.target == GoNext_1)
SoundMixer.stopAll();
gotoAndPlay("2");
stage.removeEventListener(MouseEvent.MOUSE_DOWN, goButtonsHomeRead_1);
Here’s the code inside the movie clip.
//****************** Calls function to remove itself from the stage****************************
Object(parent).exitWordMicroscopic(); -
More "TypeError: Error #1006: value is not a function." trouble
var pntClk:int = -1;
for(var t:int=0;t<tab1PointsArray.length;t++) {
tab1PointsArray[t].addEventListener(MouseEvent.CLICK, tab1PointClicked); <Problem code i think. Error points to line 117
trace("Event listener added to " + tab1PointsArray[t].name);
function tab1PointClicked (event:MouseEvent):void {
for(var T:int=0;T< tab1PointsArray.length;T++) {
if (event.currentTarget == tab1PointsArray[T]) {
pntClk = T;
openInfoTab();
trace("Point Clicked: " + tab1PointsArray[T].name);
I wrote some previous code that worked and i copy pasted over to this project and it doesn't work.
The weird part to me is that it still runs the first set of trace statements (there are 8 objects in that array). But, it won't run the second set...
for(var l:int=0;l<Tab2PointsArray.length;l++) {
Tab2PointsArray[l].addEventListener(MouseEvent.CLICK, tab2PointClicked);
trace("Event listener added to " + Tab2PointsArray[l].name);
function tab2PointClicked (event:MouseEvent):void {
for(var t:int=0;t< Tab2PointsArray.length;t++) {
if (event.currentTarget == Tab2PointsArray[t]) {
pntClk = t;
openInfoTab();
trace("Point Clicked: " + Tab2PointsArray[t].name);
if you need more code or info to help me figure this out let me know
I don't know actionscript that well so bare withThe output window:
Event listener added to PointHitch
Event listener added to PointPTO
Event listener added to PointSafety
Event listener added to PointGearBox
Event listener added to PointBlade
Event listener added to PointTeeth
Event listener added to PointGrapple
TypeError: Error #1006: value is not a function.
at TractorSawFlash_fla::MainTimeline/frame1()[TractorSawFlash_fla.MainTimeline::frame1:115]
I think the first set of listeners is added then the error happens and the second set of listeners doesn't get added.
Here is more code.
import fl.transitions.Tween;
import fl.transitions.easing.*;
import flash.events.MouseEvent;
var infoTabIsOpen:Boolean = false;
//TAB CODE
var TractorSawTabToggle:Boolean = false;
var TabButtonArray:Array = new Array(TabTR3200.TR3200BTN, TabTR3200LT.TR3200BTNLT);
for (var i:int=0; i<TabButtonArray.length; i++)
TabButtonArray[i].id = i;
TabButtonArray[i].addEventListener(MouseEvent.CLICK, onClick);
TabTR3200.TR3200BTN.mouseEnabled = false;
TabTR3200.TR3200BTN.buttonMode = false;
function onClick(event:MouseEvent):void{
if (TractorSawTabToggle == true) {
TractorSawTabToggle = false;
swapChildren(this.TabTR3200,this.TabTR3200LT);
TabTR3200LT.TR3200BTNLT.mouseEnabled = true;
TabTR3200LT.TR3200BTNLT.buttonMode = true;
TabTR3200.TR3200BTN.mouseEnabled = false;
TabTR3200.TR3200BTN.buttonMode = false;
else {
TractorSawTabToggle = true;
swapChildren(this.TabTR3200,this.TabTR3200LT);
TabTR3200LT.TR3200BTNLT.mouseEnabled = false;
TabTR3200LT.TR3200BTNLT.buttonMode = false;
TabTR3200.TR3200BTN.mouseEnabled = true;
TabTR3200.TR3200BTN.buttonMode = true;
//END TAB CODE
//MovieTab
MovieButton.addEventListener(MouseEvent.CLICK, clickedMainMovie);
MovieTab.Exit_BTN.addEventListener(MouseEvent.MOUSE_DOWN, outMainMovieTrigger);
function clickedMainMovie(event:MouseEvent):void {
var TabMainMovieDown:Tween = new Tween(MovieTab, "y", Strong.easeOut, -600, 0, 1, true);
var TabMainMovieAlphaIn:Tween = new Tween(MovieTab, "alpha", Strong.easeOut, 0, 1, 1, true);
if (infoTabIsOpen == true) {
closeInfoTab();
function outMainMovieTrigger(event:MouseEvent):void {
outMainMovie();
function outMainMovie():void {
trace("Three Sixty MOUSE_OUT");
var TabMainMovieUp:Tween = new Tween(MovieTab, "y", Strong.easeOut, 0, -600, 1, true);
var TabMainMovieAlphaOut:Tween = new Tween(MovieTab, "alpha", Strong.easeOut, 1, 0, 1, true);
MovieTab.FLVPlayback.stop();
//END MovieTab
//INFO TAB ARRAYS AND FUNCTIONS
var placeHolder:String = "null";
var tab1PointsArray:Array = new Array(this.TabTR3200.PointHitch, //0
this.TabTR3200.PointPTO, //1
this.TabTR3200.PointSafety, //2
this.TabTR3200.PointGearBox, //3
this.TabTR3200.PointBlade, //4
this.TabTR3200.PointTeeth, //5
this.TabTR3200.PointGrapple, //6
placeHolder); //7
var Tab2PointsArray:Array = new Array(this.TabTR3200LT.PointHitch, //0
this.TabTR3200LT.PointPTO, //1
this.TabTR3200LT.PointSafety, //2
this.TabTR3200LT.PointGearBox, //3
this.TabTR3200LT.PointBlade, //4
this.TabTR3200LT.PointTeeth, //5
placeHolder, //6
this.TabTR3200LT.PointPushingBar);//7
var pictureArray:Array = new Array(placeHolder,
placeHolder,
placeHolder,
placeHolder,
placeHolder,
placeHolder,
placeHolder,
placeHolder);
var textArray:Array = new Array(InfoTab.txtHitch, //0
InfoTab.txtPTO, //1
InfoTab.txtSafety, //2
InfoTab.txtGearbox, //3
InfoTab.txtBlade, //4
InfoTab.txtTeeth, //5
InfoTab.txtGrapple, //6
InfoTab.txtPushingBar); //7
//Point Clicked Code
var pntClk:int = -1;
for(var t:int=0;t<tab1PointsArray.length;t++) {
tab1PointsArray[t].addEventListener(MouseEvent.CLICK, tab1PointClicked); <LINE 115 were it says the error is happening
trace("Event listener added to " + tab1PointsArray[t].name);
function tab1PointClicked (event:MouseEvent):void {
for(var T:int=0;T< tab1PointsArray.length;T++) {
if (event.currentTarget == tab1PointsArray[T]) {
pntClk = T;
openInfoTab();
trace("Point Clicked: " + tab1PointsArray[T].name);
for(var l:int=0;l<Tab2PointsArray.length;l++) {
Tab2PointsArray[l].addEventListener(MouseEvent.CLICK, tab2PointClicked);
trace("Event listener added to " + Tab2PointsArray[l].name);
function tab2PointClicked (event:MouseEvent):void {
for(var t:int=0;t< Tab2PointsArray.length;t++) {
if (event.currentTarget == Tab2PointsArray[t]) {
pntClk = t;
openInfoTab();
trace("Point Clicked: " + Tab2PointsArray[t].name);
//Info Tab
var ImageLoader:Loader;
ImageLoader = new Loader();
// make text invisible
function makeTextInvisible():void {
for (var txt:int=0; txt<textArray.length; txt++) {
textArray[txt].visible = false;
InfoTab.Exit_BTN.buttonMode = true;
InfoTab.Exit_BTN.addEventListener(MouseEvent.CLICK, closeInfoTrigger);
function closeInfoTrigger(e:MouseEvent):void {
trace("close feature triggered");
closeInfoTab();
//OPEN INFO TAB
function openInfoTab():void {
//EnableExitButton
var EnableExitButton:Timer = new Timer(333, 1);
InfoTab.mouseEnabled = true;
InfoTab.mouseChildren = true;
var tabIn:Tween = new Tween(InfoTab, "y", Regular.easeOut, 600, 60, 10, false);
var tabAlphaIn:Tween = new Tween(InfoTab, "alpha", Regular.easeOut, 0, 1, 10, false);
//pictureSetter
if (pictureArray[pntClk] != "null") {
ImageLoader.load(new URLRequest(pictureArray[pntClk]));
this.InfoTab.ImageHolder_MC.addChild(ImageLoader);
textArray[pntClk].visible = true;
infoTabIsOpen = true;
//end open info tab
//CLOSE INFO TAB
function closeInfoTab():void{
//deactivating setters
InfoTab.mouseEnabled = false;
InfoTab.mouseChildren = false;
trace("feature tab deactivated");
//unload picture
if (pictureArray[pntClk] != "null") {
ImageLoader.unload();
this.InfoTab.ImageHolder_MC.removeChild(ImageLoader);
ImageLoader = null;
//tab action variables
var tabAlphaOut:Tween = new Tween(InfoTab, "alpha", Regular.easeIn, 1, 0, 8, false);
var tabOut:Tween = new Tween(InfoTab, "y", Regular.easeIn, 60, 600, 8, false);
infoTabIsOpen = false;
//exit timer
var exitTimer:Timer = new Timer(200, 1);
exitTimer.addEventListener(TimerEvent.TIMER, exitHandler);
exitTimer.start();
function exitHandler(event:TimerEvent):void
trace("exit handler fired");
makeTextInvisible();
//end exit timer
pntClk = -1;
//end closeFeatureTab -
TypeError: Error #1006: getInstance is not a function.
I having some problems implementing Flex for the first time.
At the moment I'm getting
TypeError: Error #1006: getInstance is not a function.
I suspect that I'm missing a library or something in the
compile but I don't know how to resolve it.
When I Run the Application in Flex Builder I get an error
that the file isn't in the project and that some of the features
are disabled. This would be consistent with an incomplete compile
but the file is in a project. I even recreated a new project but I
get the same errors.
What am I missing?More detail on the error:
TypeError: Error #1006: getInstance is not a function.
at mx.core::Singleton$/getInstance()
at mx.styles::StyleManager$cinit()
at global$init()
at mx.containers::Form$cinit()
at global$init()
at global$init()
In debug it was stopping here in Singleton.as
public static function getInstance(name:String):Object
var clazz:Class = classMap[name];
return Object(clazz).getInstance();
I changed the container from mx:Form to mx:Application so now
it seems to be working, but I'm not sure why mx:Form was giving me
this issue. -
TypeError: Error #1006: when rearranging array of objects
I have an array of objects, which I call in a loop thus:
myObjectArray[index].method()
However, when I splice one object from the array and put it
at the front via unshift, it no longer understands the method call
and spouts a Type Error#1006 :value is not a function:
Looks like a bug to me. Or am I missing something?Thanks for the quick reply
tried this but got Coercion failed message:
var arrayObj:*;
arrayObj=altArray.splice(altToTop,1);
AlternativeGUI(arrayObj); //coercion failed
var newlength:int=altArray.unshift(arrayObj);
All objects held by altArray are subclasses of AlternativeGUI
However, even simpler to avoid that untyped arrayObj returned
by the splice:
altArray.unshift(altArray[altToTop]);
altArray.splice(altToTop+1,1);
now it works! -
TypeError: Error #1006: getDataHigh no es una función
Hi my code is telling me that getDataHigh is not a function when it is.
I am using this on a container mc
e.target.loader.content.getData(this.currentLibraryName, this.definitionsArray); // this info is passed to the getData in the game
e.target.loader.content.getDataHigh(this.level, this.lesson);
Don't know if I am allowed to use e.target.loader twice with two different functions that are targeted within the two movies that are targeted.
So the game that is loaded and targeted has the function
public function getDataHigh(pNivel:uint, pLesson:uint) {
this.nivel = pNivel;
this.lesson = pLesson;
var rutaXML:URLRequest = new URLRequest("data/level" + this.nivel + "/lesson" + this.lesson + "/lessonT.xml");
var xmlLoader:URLLoader = new URLLoader(rutaXML);
xmlLoader.addEventListener(Event.COMPLETE, onCompleteXmlLoader);
this.final_mc.avatar_mc.gotoAndStop(this.avatarID + 1);
Looks good to me but then everything always does.then you're out of scope of your function when you're trying to call it. or, you need to explicitly cast your content as the correct class type:
TheClassWithgetDataHighMethod(e.target.loader.content).getDataHigh(this.level, this.lesson); -
Error #1006: value is not a function
I'm trying to port a big library to Alchemy. I've run into something that looks like an Alchemy bug. I have a class with a static member. There's a static function that uses it. Something like this:
In foo.h:
class Foo
static Bar m_pBar;
static void doSomething (int a);
In foo.cpp:
Bar Foo::m_pBar;
void Foo::doSomething (int a)
m_pBar.doSomething(a);
When I do Foo::doSomething(a), I get TypeError: Error #1006: value is not a function.
On the other hand, if I use a local variable of the same type in the static function (just to test), it works :
void Foo::doSomething (int a)
// Test
Bar pBarTest;
pBarTest.doSomething(a);
So my guess is that the static variable is not being initialized. This works fine when compiled with g++ in Linux and Mac and with Visual C++ 2008 in Windows so it looks like Alchemy is doing something wrong.
Has anyone encountered this same issue?Ignore, it was something in the called class, oops
-
Hi i'm new to actionscript. I'm trying to resize a movieclip when I click on it and I'm getting the following error:
TypeError: Error #1006: value is not a function.
at Untitled_fla::MainTimeline/resize_fn()
here is my code
import flash.events.MouseEvent;
import flash.display.MovieClip;
circle.addEventListener(MouseEvent.ROLL_OVER,size_fn,false,0,true)
circle.addEventListener(MouseEvent.ROLL_OUT,resize_fn,false,0,true)
function size_fn(e:MouseEvent):void{
circle.width(3);
circle.height(3);
function resize_fn(e:MouseEvent):void{
circle.width(1.1);
circle.height(1.1);
any idea what i'm doing wrong?
thanks in advancedChamces are the problems are where you treat width and height as functions rather than properties...
circle.width(3);
circle.height(3);
you normally assign values to the width and height properties, they are not functions...
circle.width = 3;
circle.height = 3;
though I suspect you are not intending to set them to such small values... may you are trying to scale them??? (if so use scaleX and scaleY properties instead of width and height) -
Trying to solve #Error 1006
I posted a file earlier today (upgrading from AS2 to A S3), which was solved.
I am trying to reuse the code by attaching a button the allows the viewer to move to the nextFrame and experience the Writing Effect but with new copy.
It works but I keep getting the dreaded #1006 error. I keep commenting out parts but nothing changes. When I DEBUG it seems to reference
frame 2 line 36 which is related to the sound.
TypeError: Error #1006: stop is not a function.
at Write_AS3_fla::MainTimeline/onTimerB()
at flash.utils::Timer/_timerDispatch()
at flash.utils::Timer/tick()
I appreciate the help.
This is the code, which has been modified by placing "A" or "B" to alter it.
stop();
var strA:String = " Hello There";
var timerA:Timer = new Timer(1);
timerA.addEventListener(TimerEvent.TIMER, onTimerB);
timerA.start();
var countA:Number = 0;
//creating an instance for sound
var sA:type = new type();
var schannelA:SoundChannel;
function onTimerB(event:TimerEvent):void {
if(count == 0) {
schannelA = sA.play(0,1000);
theText.text = strA.substring(0,count);
count += 2;
if(count > strA.length) {
timerA.removeEventListener(TimerEvent.TIMER, onTimerB);
schannelA = sA.stop();The solution hasn't changed... The Sound class does not have a stop() method. The SoundChannel class does, which is why you assign the play() method to a SoundChannel object variable (play() returns a SoundChannel object)...
var strA:String = " Hello There";
var timerA:Timer = new Timer(1);
timerA.addEventListener(TimerEvent.TIMER, onTimerB);
timerA.start();
var countA:Number = 0;
//creating an instance for sound
var sA:type = new type();
var schannelA:SoundChannel;
function onTimerB(event:TimerEvent):void {
if(count == 0) {
schannelA = sA.play(0,1000);
theText.text = strA.substring(0,count);
count += 2;
if(count > strA.length) {
timerA.removeEventListener(TimerEvent.TIMER, onTimerB);
schannelA.stop(); -
Not sure what to do to remedy this error. Also, is there a
tutorial or something to teach me how to decrypt errors?
TypeError: Error #1006: dispatchEvent is not a function.
at MethodInfo-2()
at MethodInfo-5()
at
flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at
flash.net::URLLoader/flash.net:URLLoader::onComplete()I couldn't get it to work. I guess I need to hit the books
hard on OOP and event handling. I am reposting another question
with the same classes that my brother (C# programmer) helped me
come up with. I am gettin fewer errors but it seems to make more
sense now.
Thanks anyway, kglad. -
TypeError: Error #1034 - Want to display a swf
Hi,
I´m new to AS3 and try to load/display swf´s on the stage. The swf´s should run and if the user clicks a button the next swf should be displayed.
That works so far if I use some swf´s that are created also with FlashPlayer 9 and AS3. But if I use a swf created by someone else I get a TypeError: Error #1034. So far, I have no idea why this happens. Maybe you can have a look at my code and give me a hint. Thanks in advance.
var configfile = "test.xml";
var xml_url:String = configfile;
var urlLoader:URLLoader = new URLLoader();
urlLoader.addEventListener(Event.COMPLETE, setClips);
var xml:XML;
var currentClip:int = 0;
var clips:Array = new Array(); btnPrevious.addEventListener(MouseEvent.CLICK, previousClip);
setChildIndex(btnPrevious,1);
btnNext.addEventListener(MouseEvent.CLICK, nextClip);
setChildIndex(btnNext,1);
function setClips(e:Event) {
this.xml = new XML(e.target.data);
this.playClip(this.currentClip);
function playClip(index:Number) {
if (!this.clips[index]) {
var request:URLRequest = new URLRequest(this.xml.item[index]);
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, this.setMovieClip);
loader.load(request);
else {
this.currentClip = index;
this.clips[this.currentClip].play();
this.addChild(this.clips[this.currentClip]);
setChildIndex(this.clips[this.currentClip],0);
this.clips[this.currentClip].addEventListener(Event.ENTER_FRAME, this.onEnterFrameCheck);
function nextClip(e:MouseEvent) {
this.clips[this.currentClip].gotoAndStop(0);
this.removeChild(this.clips[this.currentClip]);
this.currentClip = this.currentClip + 1;
if(this.currentClip == this.xml.item.length()) {
this.currentClip = 0;
this.playClip(this.currentClip);
function previousClip(e:MouseEvent) {
this.clips[this.currentClip].gotoAndStop(0);
this.removeChild(this.clips[this.currentClip]);
this.currentClip = this.currentClip - 1;
if(this.currentClip == -1) {
this.currentClip = this.xml.item.length() - 1; } this.playClip(this.currentClip);
function setMovieClip(e:Event):void { this.clips[this.currentClip] = MovieClip(e.target.loader.content);
this.addChild(this.clips[this.currentClip]);
setChildIndex(this.clips[this.currentClip],0);
this.clips[this.currentClip].addEventListener(Event.ENTER_FRAME, this.onEnterFrameCheck);
function onEnterFrameCheck(e:Event):void {
if(this.clips[this.currentClip] && this.clips[this.currentClip].currentFrame == this.clips[this.currentClip].totalFrames) {
this.clips[this.currentClip].gotoAndStop(0);
this.clips[this.currentClip].removeEventListener(Event.ENTER_FRAME, this.onEnterFrameCheck);
this.removeChild(this.clips[this.currentClip]);
if(this.currentClip >= this.xml.item.length()-1) {
this.currentClip = -1;
} this.currentClip++;
this.playClip(this.currentClip);
urlLoader.load(new URLRequest(this.xml_url));
stop();
And here The XML:
<banners>
<item>banner1.swf</item>
<item>banner2.swf</item>
<item>banner3.swf</item>
</banners>
The full Error Message (In German:)
TypeError: Error #1034: Typumwandlung fehlgeschlagen: flash.display::AVM1Movie@34d4df9 kann nicht in flash.display.MovieClip umgewandelt werden.
at teaser_fla::MainTimeline/setMovieClip()The problem will be related to trying to manipulate an AS1/AS2 file using AS3... it cannot be done. In this case, you are probably just seeing the first of a few errors where you try to manipulate an AS2 object by trying to cast it as an AS3 MovieClip object. You would run into problems later when you try controlling/reading that same file (currentFrame is not an AS1/AS2 property, but you attempt to extract it).
Per the Flash Help documentation...
"ActionScript 3.0 code can load a SWF file written in ActionScript 1.0 or 2.0, but it cannot access the SWF file's variables and functions. "
You can implement the LocalConnection class to overcome some of the issues, but if you are using other people's files, you are likely to hit a wall...
"LocalConnection objects created in ActionScript 3.0 can communicate with LocalConnection objects created in ActionScript 1.0 or 2.0.
The reverse is also true: LocalConnection objects created in ActionScript 1.0 or 2.0 can communicate with LocalConnection objects created in ActionScript 3.0. Flash Player handles this communication between LocalConnection objects of different versions automatically." -
Another TypeError: Error #1009 Problem
Hey all, I've searched the 'net and searched these forums but can't seem to figure out what I'm doing wrong. I'm creating a flash based game for school that so far has ten frames on the timeline. I have buttons on frame one, frame 5, and frame 10. I have actionscript code to control those buttons on frame 1, frame 5, and frame 10 respectively. The code is worded identically on each frame with the exception that I've changed the button names and the function names that are called when the mouse button is pressed. The code works fine on frame 1 and on frame 5, but when I click the button on frame 5 that sends me to frame 10, I get this error immediately:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at keys2BibleTest_fla::MainTimeline/frame10()
at flash.display::MovieClip/gotoAndStop()
at keys2BibleTest_fla::MainTimeline/stormBtnHandler1()
I have verified that each instance of the buttons do indeed have the name of the button being listened for in the event handlers. I can change the type from button to movieclip and it works fine. I can also remove frames 1 through 9 and the code works.
Here's the code:
Frame 1:
stop();
enterBtn.addEventListener(MouseEvent.MOUSE_DOWN, enterBtnHandler1);
function enterBtnHandler1(event:MouseEvent):void {
gotoAndStop(5, "Scene 1");
Frame 5:
import flash.events.MouseEvent;
stormBtn.addEventListener(MouseEvent.MOUSE_DOWN, stormBtnHandler1);
function stormBtnHandler1(event:MouseEvent):void {
gotoAndStop(10, "Scene 1");
chickenOutBtn.addEventListener(MouseEvent.MOUSE_DOWN, chickenOutBtnHandler1);
function chickenOutBtnHandler1(event:MouseEvent):void {
gotoAndStop(1, "Scene 1");
Frame 10:
import flash.events.MouseEvent;
creationBtn.addEventListener(MouseEvent.MOUSE_DOWN, creation);
function creation(event:MouseEvent):void {
gotoAndStop(3, "Scene 1");
lifeBtn.addEventListener(MouseEvent.MOUSE_DOWN, lifeOfChrist);
function lifeOfChrist(event:MouseEvent):void {
navigateToURL(new URLRequest("http://www.ceoutreach.org"));
I can't for the life of me figure out what's wrong. Can anyone help?
Thank you,
MikeNed,
thank you for your reply. Unfortunately, my buttons are on separate layers and separated by blank keyframes to boot. When I posted originally, the buttons were all on the same layer BUT separated by blank keyframes. After doing some research on the web, I moved the buttons to their own separate layers (one button per layer) and kept the blank keyframes as well.
Currently, my only filled keyframes are one, five, and ten. All other keyframes are blank except for my labels and actionscript code. I'm using separate layers for labels and actions, too. I attempted to attach the file with my original post but received the message that .fla files are not allowed. I don't know about your window, but mine says Max size 5.0 MB (my file is 2), All files types allowed except.... .fla is not one of those in the exception list so I expected it to go.
It's got something to do with the two buttons on frame 10.... I just went into the actionscript and bypassed frame 5, going directly to frame 10 when the Enter button is depressed, and got the same error message. There's something in the code I'm just not seeing.... when I comment out the code for the buttons, no error message. Put the code back in, error message comes back. Delete the buttons and the code and insert new ones, the error message comes back.
It's got me totally stumped.
Thank you for trying,
Mike
Edit: I forgot to mention, frame ten is the only place on the timeline where instances of these particular buttons are being used. The other frames are populated with different buttons. Also, when I change the type to movieclip, everything works. Weird, huh? -
TypeError: Error #1007:Tried to create an instance in a no constructor
Hello guys,
Im stuck with actionscript error, i really need help here the error i got:-
TypeError: Error #1007:Tried to create an instance in a no constructor.
at Away3dScene/initObjects()
at Away3dScene/init()
at flash.display::DisplayObjectContainer/addChild()
at Away3dProject()
So use Away3d, however dont know really where is the error becouse every thing seems be okay, im using adobe flash cs5.5, flash player 10.
main.as code:
package
import flash.display.Sprite;
import flash.display.StageScaleMode;
import flash.display.StageAlign;
import net.hires.utils.Stats;
public class Away3dProject extends Sprite
public function Away3dProject()
stage.scaleMode = StageScaleMode.NO_SCALE;
stage.align = StageAlign.TOP_LEFT;
var scene:Away3dScene = new Away3dScene();
addChild(scene);
var stats:Stats = new Stats();
addChild(stats);
and here Away3dscene.as:
package
import away3d.cameras.Camera3D;
import away3d.containers.Scene3D;
import away3d.containers.View3D;
import away3d.core.base.Object3D;
import away3d.core.clip.RectangleClipping;
import away3d.core.math.Number3D;
import away3d.materials.WireColorMaterial;
import away3d.overlays.LensFlare;
import away3d.primitives.Plane;
import flash.display.BlendMode;
import flash.display.Sprite;
import flash.events.Event;
public class Away3dScene extends Sprite
//[Embed(source="assets/library.swf", symbol="Halo")]
private var Halo:Class;
//[Embed(source="assets/library.swf", symbol="Flare1")]
private var Flare1:Class;
//[Embed(source="assets/library.swf", symbol="Flare2")]
private var Flare2:Class;
//[Embed(source="assets/library.swf", symbol="Flare3")]
private var Flare3:Class;
private var _scene:Scene3D;
private var _camera:Camera3D;
private var _view:View3D;
private var _flare:LensFlare;
public function Away3dScene()
this.addEventListener(Event.ADDED_TO_STAGE, init);
private function init(evt:Event):void
initScene();
initObjects();
this.addEventListener(Event.ENTER_FRAME, render);
private function initObjects():void
/*var floor:Plane = new Plane();
floor.width = floor.height = 100000;
floor.segmentsW = floor.segmentsH = 12;
floor.y = -3500;
floor.material = new WireColorMaterial(0x333333);
_scene.addChild(floor);*/
var flareSourceDummy:Object3D = new Object3D();
flareSourceDummy.x = 1000;
flareSourceDummy.y = 500;
flareSourceDummy.z = 3000;
_scene.addChild(flareSourceDummy);
_flare = new LensFlare(flareSourceDummy, _camera);
_flare.setBurnClip(_view);
_flare.setHaloAsset(new Halo());
_flare.addFlareAsset(new Flare1());
_flare.addFlareAsset(new Flare3());
_flare.addFlareAsset(new Flare1());
_flare.addFlareAsset(new Flare2());
_flare.useRotation = false;
//_flare.useAlpha = false;
//_flare.useScaling = false;
//_flare.useBurning = false;
//_flare.blendMode = BlendMode.SCREEN;
//_flare.burnMethod = LensFlare.BURN_METHOD_COLOR_TRANSFORM;
_view.addOverlay(_flare);
private function hoverCamera():void
var mX:Number = this.mouseX > 0 ? this.mouseX : 0;
var mY:Number = this.mouseY > 0 ? this.mouseY : 0;
var tarX:Number = 3*(mX - stage.stageWidth/2);
var tarY:Number = -2*(mY - stage.stageHeight/2);
var dX:Number = _camera.x - tarX;
var dY:Number = _camera.y - tarY;
_camera.x -= dX*0.25;
_camera.y -= dY*0.25;
_camera.lookAt(new Number3D(0, 0, 0));
private function initScene():void
_scene = new Scene3D();
_camera = new Camera3D({z:-1500});
_view = new View3D({scene:_scene, camera:_camera});
_view.x = stage.stageWidth/2;
_view.y = stage.stageHeight/2;
_view.clipping = new RectangleClipping({minX:-stage.stageWidth/2, minY:-stage.stageHeight/2, maxX:stage.stageWidth/2, maxY:stage.stageHeight/2});
_view.opaqueBackground = 0;
addChild(_view);
private function render(evt:Event):void
hoverCamera();
_view.render();
Please guys, any idea will be helpful to me.
Best,Yes, you right, now after i do what you explain appear more informations.
at Away3dScene/initObjects()[C:\Users\ahmed\Desktop\3d\Away3dScene.as:65]
at Away3dScene/init()[C:\Users\ahmed\Desktop\3d\Away3dScene.as:44]
at flash.display::DisplayObjectContainer/addChild()
at Away3dProject()[C:\Users\ahmed\Desktop\3d\Away3dProject.as:17]
error number 65 in Away3dScene is: _flare.setHaloAsset(new Halo());
error number 44 in Away3dScene is: initObjects();
error number 17 in Away3dProject.as is: addChild(scene);
and the last error is: at flash.display::DisplayObjectContainer/addChild()
But what is strange i test project at flash builder and he work fine, i just want move from flash builder to run in flash cs5.5, so i move Away3dProject.as, Away3dScene.as, and i add Away3d classes to flash cs5.5 and also add net class to flash cs5.5.
also i add all movies clips to my libriry project, please could you help me to find why i got this error with flash cs5.5.
Best, -
I am getting this back:
TypeError: Error #2007: Parameter text must be non-null.
at flash.text::TextField/set text()
at AS3_Flash_Poll_PHP_MySQL_fla::WholePoll_1/completeHandler()
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/onComplete()
PHP code:
<?php
// ---------------------------------------- Section 1 -----------------------------------------------
// IMPORTANT!!!! Connect to MySQL database here(put your connection data here)
mysql_connect("ginaty05.fatcowmysql.com","fall2010","@regina") or die (mysql_error());
mysql_select_db("poll_2010") or die (mysql_error());
// When Flash requests the totals initially we run this code
if ($_POST['myRequest'] == "load_numbers") {
// Query the totals from the database
$sql1 = mysql_query("SELECT id FROM votingPoll WHERE choice='1'");
$choice1Count = mysql_num_rows($sql1);
$sql2 = mysql_query("SELECT id FROM votingPoll WHERE choice='2'");
$choice2Count = mysql_num_rows($sql2);
$sql3 = mysql_query("SELECT id FROM votingPoll WHERE choice='3'");
$choice3Count = mysql_num_rows($sql3);
echo "choice1Count=$choice1Count";
echo "&choice2Count=$choice2Count";
echo "&choice3Count=$choice3Count";
// ---------------------------------------- Section 2 -----------------------------------------------
// IF POSTING A USER'S CHOICE
if ($_POST['myRequest'] == "store_choice") {
//Obtain user IP address
$ip = $_SERVER['REMOTE_ADDR'];
// Create local variable from the Flash ActionScript posted variable
$userChoice = $_POST['userChoice'];
$sql = mysql_query("SELECT id FROM votingPoll WHERE ipaddress='$ip'");
$rowCount = mysql_num_rows($sql);
if ($rowCount == 1) {
$my_msg = "You have already voted in this poll.";
print "return_msg=$my_msg";
} else {
$sql_insert = mysql_query("INSERT INTO votingPoll (choice, ipaddress) VALUES('$userChoice','$ip')") or die (mysql_error());
$sql1 = mysql_query("SELECT * FROM votingPoll WHERE choice='1'");
$choice1Count = mysql_num_rows($sql1);
$sql2 = mysql_query("SELECT * FROM votingPoll WHERE choice='2'");
$choice2Count = mysql_num_rows($sql2);
$sql3 = mysql_query("SELECT * FROM votingPoll WHERE choice='3'");
$choice3Count = mysql_num_rows($sql3);
$my_msg = "Thanks for voting!";
echo "return_msg=$my_msg";
echo "&choice1Count=$choice1Count";
echo "&choice2Count=$choice2Count";
echo "&choice3Count=$choice3Count";
?>
AS3 code:
stop(); // Stop the timeline since it does not need to travel for this to run
// Assign a variable name for our URLVariables object
var variables1:URLVariables = new URLVariables();
// Build the varSend variable
var varSend1:URLRequest = new URLRequest("parse_my_poll.php");
varSend1.method = URLRequestMethod.POST;
varSend1.data = variables1;
// Build the varLoader variable
var varLoader1:URLLoader = new URLLoader;
varLoader1.dataFormat = URLLoaderDataFormat.VARIABLES;
varLoader1.addEventListener(Event.COMPLETE, completeHandler1);
// Set variable to send to PHP here for the varloader below
variables1.myRequest = "load_numbers";
// Send data to php file now, and wait for response using the COMPLETE event
varLoader1.load(varSend1);
function completeHandler1(event:Event):void{
count1_txt.text = "" + event.target.data.choice1Count;
count2_txt.text = "" + event.target.data.choice2Count;
count3_txt.text = "" + event.target.data.choice3Count;
// hide the little processing movieclip
processing_mc.visible = false;
// Initialize the choiceNum variable that we will use below
var choiceNum:Number = 0;
// Set text formatting colors for errors and success messages
var errorsFormat:TextFormat = new TextFormat();
errorsFormat.color = 0xFF0000; // bright red
var successFormat:TextFormat = new TextFormat();
successFormat.color = 0x00FF00; // bright green
// Button Click Functions
function btn1Click(event:MouseEvent):void{
choiceNum = 1;
choice_txt.text = choice1_txt.text;
function btn2Click(event:MouseEvent):void{
choiceNum = 2;
choice_txt.text = choice2_txt.text;
function btn3Click(event:MouseEvent):void{
choiceNum = 3;
choice_txt.text = choice3_txt.text;
// Button Click Listeners
btn1.addEventListener(MouseEvent.CLICK, btn1Click);
btn2.addEventListener(MouseEvent.CLICK, btn2Click);
btn3.addEventListener(MouseEvent.CLICK, btn3Click);
// Assign a variable name for our URLVariables object
var variables:URLVariables = new URLVariables();
// Build the varSend variable
var varSend:URLRequest = new URLRequest("parse_my_poll.php");
varSend.method = URLRequestMethod.POST;
varSend.data = variables;
// Build the varLoader variable
var varLoader:URLLoader = new URLLoader;
varLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
varLoader.addEventListener(Event.COMPLETE, completeHandler);
// Handler for PHP script completion and return
function completeHandler(event:Event):void{
// remove processing movieclip
processing_mc.visible = false;
// Clear the form fields
choice_txt.text = "";
choiceNum = 0;
// Load the response from the PHP file
status_txt.text = event.target.data.return_msg;
status_txt.setTextFormat(errorsFormat);
if (event.target.data.return_msg == "Thanks for voting!") {
// Reload new values into the count texts only if we get a proper response and new values
status_txt.setTextFormat(successFormat);
count1_txt.text = "" + event.target.data.choice1Count;
count2_txt.text = "" + event.target.data.choice2Count;
count3_txt.text = "" + event.target.data.choice3Count;
// Add an event listener for the submit button and what function to run
vote_btn.addEventListener(MouseEvent.CLICK, ValidateAndSend);
// Validate form fields and send the variables when submit button is clicked
function ValidateAndSend(event:MouseEvent):void {
//validate form fields
if(!choice_txt.length) {
// if they forgot to choose before pressing the vote button
status_txt.text = "Please choose before you press vote.";
status_txt.setTextFormat(errorsFormat);
} else {
status_txt.text = "Sending...";
processing_mc.visible = true;
// Ready the variables for sending
variables.userChoice = choiceNum;
variables.myRequest = "store_choice";
// Send the data to the php file
varLoader.load(varSend);
} // close else after form validation
} // Close ValidateAndSend function ////////////////////////This error means that you are trying to set the text field but there is no data in the variable. As a first step, try to identify where this is happening, eg Is it the first call, or once you have submitted your data or only if you try to submit data second time?
Trace out the data that is returned for both completeHandlers to see if there is a missing var. Try this for "load_numbers" and "store_choice". Do it twice for "store_choice". Do you get back what you expected?
You could also try altering the php to return some fixed dummy variables, eg choice1Count=11&choice2Count=22&choice3Count=33, etc. If this works then you know that the error is in the PHP.
It looks to me like the issue is when you submit the data a second time and just get back the return_msg - the handler then tries to assign the choice1Count etc but doesn't have any count data back from the poll.php.
Test that there is data before assigning it, eg
if(event.target.data.choice1Count){
count1_txt.text = event.target.data.choice1Count;
count2_txt.text = event.target.data.choice2Count;
count3_txt.text = event.target.data.choice3Count; -
Hi - Still new to flash as3 and php -
it is a contact form page - user puts in information - i am to receive it in an email address their information
as well the variables get sent back from the php to the .swf file.
I am receiving these errors and not knowing how to fix them.
any help would be much appreciated. thank you in advance really.
below are the errors in flash - as3 code - and php code setup.
errors:
ActionScript 3 + PHP: TypeError: Error #2007: Parameter text must be non-null:
at flash.text::TextField/set text()
at kwangjaekim_fla::wholeform_16/completeHandler()
at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/flash.net:URLLoader::onComplete()
my as3 code is the following:
// build variable name for the URL Variables loader
var variables:URLVariables = new URLVariables();
//Build the varSend variable
var varSend:URLRequest = new URLRequest("contact_parse.php");
varSend.method = URLRequestMethod.POST;
varSend.data = variables;
//Build the varLoader variable
var varLoader:URLLoader = new URLLoader;
varLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
varLoader.addEventListener(Event.COMPLETE, completeHandler);
//handler for the PHP script completion and return of status
function completeHandler(event:Event):void{
//value is cleared at ""
name_txt.text = "";
contact_txt.text = "";
msg_txt.text = "";
//Load the response PHP here
status_txt.text = event.target.data.return_msg;
//Add event listener for submit button click
submit_btn.addEventListener(MouseEvent.CLICK, ValidateAndSend);
//function ValidateAndSend
function ValidateAndSend(event:MouseEvent):void{
//validate fields
if(!name_txt.length){
status_txt.text = "Please Enter Your Name";
}else if(!contact_txt.length){
status_txt.text = "Please Enter Your Contact Detail";
}else if(!msg_txt.length){
status_txt.text = "Please Enter Your Message";
}else {
// ready the variables in form for sending
variables.userName = name_txt.text;
variables.userContact = contact_txt.text;
variables.userMsg = msg_txt.text;
// Send the data to PHP now
varLoader.load(varSend);
submit_btn.addEventListener(MouseEvent.CLICK, function(){MovieClip(parent).gotoAndPlay(151)});
} // Close else condition for error handling
} // Close validate and send function
my php code is the following:
<?php
// Create local PHP variables from the info the user gave in the Flash form
$senderName = $_POST['userName'];
$senderEmail = $_POST['userContact'];
$senderMessage = $_POST['userMsg'];
// Strip slashes on the Local variables
$senderName = stripslashes($senderName);
$senderContact = stripslashes($senderContact);
$senderMessage = stripslashes($senderMessage);
//!!!!!!!!!!!!!!!!!!!!!!!!! change this to my email address !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$to = "put iny me email address";
// Place sender Email address here
$from = "$senderContact ";
$subject = "Contact from your site";
//Begin HTML Email Message
$message = <<<EOF
<html>
<body bgcolor="#FFFFFF">
<b>Name</b> = $senderName<br /><br />
<b>Contact</b> = <a href="mailto:$senderContact">$senderEmail</a><br /><br />
<b>Message</b> = $senderMessage<br />
</body>
</html>
EOF;
//end of message
$headers = "From: $from\r\n";
$headers .= "Content-type: text/html\r\n";
$to = "$to";
mail($to, $subject, $message, $headers);
exit();
?>
thank you once again
jaythank you Ned -
i put in the trace line as you mentioned -
and this is what i received -
returns: undefined
TypeError: Error #2007: Parameter text must be non-null
at flash.text::TextField/set text()
at kwangjaekim_fla::wholeform_16/completeHandler()
at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/flash.net:URLLoader::onComplete()
what does this mean exactly?
thank you for the help really
Maybe you are looking for
-
I got a "new" iphone from the Apple store when my dog bit the phone and cracked the front. This new phone will not play any music, ie no sound will come out. I can watch videos with sounds but no music from any of my playlists. I checked with Appl
-
iphoto wont work
-
Elements 12 hangs with most selection tools. Why?
Elements 12 on MacBook Air hangs up every time a selection tool is selected and clicked once. I must force quit the program and start over. I just worked with Adobe to reinstall the program, but nothing changed. They told me I should upgrade to Eleme
-
Windows 10 for phones emulators on Windows 10 10041 - problem with network connection
Hi, I can't connect to Internet on Windows 10 mobile emulators on Windows 10041. I have tried to resolve problem. First I noticed, there was problem with displaying properties main network connection. I had reinstalled network driver. After that I re
-
Old G5 1.8 bought with no disks. What should we do next ?
My business partner bought a G5 1.8 GHz ( I think 2004 model ) Power PC in an auction, but did not come with any original disks, the machine is running 10.4.11 at the moment but I can not do anything because I don't have a administrators password and