Detecting A Null Event In XML
Hello all,I am using a variation on the resizing gallery. Great code and I'm sure many of you are familiar with it. Everything is working great but I do have a question. Most of my XML contains a comment for the corresponding image. When I don't have a comment (ie null), I'd like to have the text line not display anything. I've had some problems figuring out the best way to do this. Here's my XML code: ActionScript Code: var gallery_xml = new XML();gallery_xml.ignoreWhite = true;gallery_xml.onLoad = function(success) { if (success) { xmlNode = this.firstChild; total = xmlNode.childNodes.length; var gallery = this.firstChild; for (var i = 0; i<gallery.childNodes.length; i++) { tArray.push(gallery.childNodes[i].childNodes[3].firstChild.nodeValue); pArray.push("photos/"+gallery.childNodes[i].childNodes[0].firstChild.nodeValue); } containerMC.loadPic(0); } else { title_txt.text = "Error!"; }}; I've tried working with variations on picinfo.info.text = tArray[pic]; and some basic if statements, but with no luck. Any help appreciated, thanks!
KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 11-08-2006, 06:20 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Detecting Right Click Event
Hi,
I have a situation in which I am doing a software simulation using Flash MX. in the software we are trying to simulate there exists a context sensitive menu which appears on Right-Click and that has to be simulated. is it possible through Actionscript or actionscript/javascript to detect right click event and act according to that.
Please let me know fast ..... this is quite urgent
Detecting An On(release) Event
how do i detect whether an on(release) event has been executed on a movie clip?
I'm creating a button that needs to differ from on(rollOver), on(rollOut) and on(release)
If Statement Detecting Event..
How can I get this if statement to work?
Code:
if(mcBlock is pressed){
this.swapDepths(_root.getNextHighestDepth())
}
Or do I have to assign a variable to mcBlock and call it back in my if stataement some how??
Ta!
Detecting An Event In A Class.
Hi,
My main stage contains an object called StartCat of type CenterCategory(that I have created and which extends sprite). That object contains all the graphics & buttons that are loaded in that class.
Inside that object, Clicking on one of the buttons should clear all the data from the stage (everything that was loaded inside the class and a new object of type CenterCategory is loaded with new graphics and buttons)
I am not sure how to "tell" the stage to listen when a button is clicked inside that object. How do I transfer that kind of information?
I have an addEventListener on each button on screen that calls a function.
What should that function do so the stage loads a new object of type CenterCategory?
In a nutshell, what i am writing is a simple website with a line of buttons.
each button has an array of sub buttons which are loaded instead of all the data on screen.
Another small issue I'm having trouble with
The CenterCategory has some variables inside it and some event listeners.
If I set in the stage: StartCat = null, will it clear all the memory of the variables inside the class, or should i have a private function which is called inside that class that clears all the variables to null?
Thanks a lot,
Guy
Detecting A Change Event In An Include File
I am new to actionscript and I am trying to detect a change event in a class . I am using the demo files located on http://www.adobe.com/support/documentation/en/flash/fl8/samples.html#component_samples
This is the CheckBox and ComboBox cell renderer class examples. Since the combo box change event fires is in the class.
How do I detect the change in the datagrid in the root form? I have tried the datagrid change event but because the combo boxes are created dynamically in the class the datagrid change event doesn't see the change.
Thanks
Detecting Browser's 'Back' Button Event.
In flex I can use history manager to enable browser's back button event to viewStack or other similar components.
Is this possible using Flash?
I have an application and I want to be able to detect that user clicked 'Back' button in the browser
thanks,
Question Re: Detecting Event From A Movie Clip In Main Timeline
I have a 5 instances of a particular movie clip on a stage. They are the homework boxes along the bottom of this page: http://www.infodirect.us/template/le...essonplan4.swf
each one contains two buttons and two textareas (on two different frames). The buttons basically flip between the frames to show different text. I'd like to be able to detect when the button has been clicked from actionscript on the root timeline. Let's say that the instance of the movie clip for monday's homework is named mcHomeworkMon.
This does not seem to be working:
Code:
mcHomeworkMon.btnTwo.onPress = function () {
trace ("test");
}
nor does this:
Code:
var btnTwoListener = new Object();
btnTwoListener.press = function(eventObj){
trace("test");
}
mcHomeworkMon.btnTwo.addEventListener("press", btnTwoListener);
any other ideas on how to get that event to fire on the root level?
Question Re: Detecting Event From A Movie Clip In Main Timeline
I have a 5 instances of a particular movie clip on a stage. They are the homework boxes along the bottom of this page: http://www.infodirect.us/template/le...essonplan4.swf
each one contains two buttons and two textareas (on two different frames). The buttons basically flip between the frames to show different text. I'd like to be able to detect when the button has been clicked from actionscript on the root timeline. Let's say that the instance of the movie clip for monday's homework is named mcHomeworkMon.
This does not seem to be working:
Code:
mcHomeworkMon.btnTwo.onPress = function () {
trace ("test");
}
nor does this:
Code:
var btnTwoListener = new Object();
btnTwoListener.press = function(eventObj){
trace("test");
}
mcHomeworkMon.btnTwo.addEventListener("press", btnTwoListener);
any other ideas on how to get that event to fire on the root level?
Datagrid Listener Event Woes - Detecting Clicks On Individual Cells
Hi, this is one of my first times working with Flash and actionscript and I'm trying to find a way to create a listener for a datagrid that will be able to do the following:
1) Listen for a click event on any cell in the datagrid object.
2) Identify the column corresponding to the click event and proceed only if the column is a specific column.
3) Pull data from the row and column that were clicked to create a URL
I'm using Flash CS3 and Actionscript 2.0. I'd still be interested if this can be done in AS3.0.
Basically, I want something like this:
PHP Code:
var listener:Object = new Object();
listener.change= function(event:Object) {
var selectedItem:Object = event.target.selectedItem;
//
// code to determine if the apropriate column was clicked
//
// if apropriate column was clicked, code to generate url from clicked cell as variable myCellUrl
//
getUrl(myCellUrl);
}
myDataGrid.addEventListener("change", listener);
I'm fairly certain the change event isn't the event I need and I'm having trouble finding good documentation on accessing the data in a particular field in a datagrid. Any help would be greatly appreciated! Thanks!
Detecting A Mouse Event On A Clip Within A Clip
Hello,
I am trying to detect a mouse click on a clip within a clip, but it's not working. I have read that it's not possible to detect a child_mc.onMouseOver is 'child_mc' is within 'parent.mc'.
But there must be a ways around it, right?
Thank you.
A Null Problem That Isn't "null" To Me
Hi all...this is driving me around the bend
Code:
var currentMC:MovieClip = null;
function Open(evt:MouseEvent):void {
if (currentMC !=null) {
Close()
}
switch (evt.target.name) {
case "contact":
currentMC = contactMovie;
break;
case "purchase":
currentMC = purchaseMovie;
break;
case "uses":
currentMC=usesMovie;
break;
case "photos":
currentMC= photosMovie;
break;
case "testimonials":
currentMC =testimonialsMovie;
break;
case "about":
currentMC =aboutMovie;
break;
}
currentMC.y=175;
currentMC.x=900;
addChild(currentMC);
Tweener.addTween(currentMC, {x:370, time:.5, delay:0, transition:"linear"});
}
function Close() {
removeChildAt(getChildIndex(currentMC));
}
returns a error :TypeError: Error #1009: Cannot access a property or method of a null object reference.
at siteworkingTween_fla::MainTimeline/Open()
all the coding and names seem to be right. I made a simplified version with EXACTLY the same code to try it out and it worked. But for some reason in this particular instance it does not. Debug shows the error at
Code:
currentMC.y=175;
I am at loss of where to start to correct this.
Thank you so much.
MovieClipLoader OnLoadInit Event AND Loader Component Complete Event
What´s the difference beetwen the Loader complete event and MovieClipLoader onLoadInit. The manual says onLoadInit is called after the code on the first frame of the loaded clip gets executed, so, it´s better to use onLoadInit if you want to manipulate the loaded asset via code.
So, if anyone could clarify the following points to me, I would be grateful!
- Does the complete event of the Loader component have the same behaviour?
- How does MovieClipLoader knows that the code on the first frame of the loaded assets got executed?
Thanks,
Marcelo.
Custom Event Handlers - Triggering Event Listeners On Other Objects
I'm trying to update an object whenever something happens in another object. At the moment, I have the second object explicitly calling an update function on the first object, but this seems a little sloppy and it strikes me that this is the sort of scenario where I should be using custom event handlers.
I'm not quite sure how they work though. My first assumption is that if I built two objects, one like this which fires off an event:
Code:
public class eventFirer extends Sprite
{
public function eventFirer():void
{
dispatchEvent(new Event("customEvent"));
}
}
...and one like this which updates whenever the custom event happens:
Code:
public class eventListener extends Sprite
{
public function eventListener():void
{
trace ("main");
addEventListener("customEvent", eventFired);
}
private function eventFired(e:Event):void
{
trace ("ok");
}
}
...then eventListener.eventFired would automatically be set off whenever a new eventFirer is created. This seems not to be the case though.
Can anybody enlighten me as to how custom events bubble between otherwise unrelated objects?
Passing Parameters From Event Listener To Event Handler
Hi Chaps,
First of all, apologies as I know this question has been asked before, but I have spent the last twenty minutes reading this thread and still can't seem to figure out how to apply it to my situation - probably because I'm thick!
I have a number of objects which need to be rotated according to different parameters. I have a function which takes those parameters, then uses the tween class to handle the rotation. I'm then using the tweenEvent class to check for when the motion is complete. Then, I need access to those same parameters in the complete handler to do further operations. The problem I have is that the tween event class doesn't allow me to pass the parameters along to the cpmpleteHandler, so I'm stuck getting my parameters from the first function to the second function:
Code:
function rotate(parameters){
rotationTween = new Tween(object,parameter1,parameter2,........);
rotationTween.addEventListener(TweenEvent.MOTION_FINISH,completeHandler);
}
function completeHandler(e:TweenEvent){
//need access to the paremeters passed into the first function here!!
}
From reading the thread mentioned above, I have a feeling I may need a custom class to do this - please don't laugh but I've never written (or had the need to) write my own class before, so I really wouldn't know what to do. Any help greatly appreciated, but an actual code snippet which demonstrates this would be even better!
Ric.
Event Listener Mouse Event Click - Obstructions
This is an oversimplification of my problem.
I have an event listener on a sprite.
I then have portions of this sprite covered with other sprites or moveclips.
If I click a movieclip, it blocks my eventlistener on the sprite underneath it.
Is it possible to listen to the even click 'through' a movieclip. I dont want interaction with them, but I dont want them as bitmap data onto the base sprite either...
I Don't Understand The Keywords: This, Event.target, Event.currentTarget
I am almost a complete beginner to Actionscript 3.0.
I've been looking at tutorials and I now understand most of the basic principles and methods of this programing language (creating basic functions ect..).
However I do not understand the following keywords.
1. this
2. event.target
3. event.currentTarget
What do these words refer to?
How are they different from each-other?
When must i use them?
Event Propagation Vs. Event Blocking -- Confused, Even After Moock
I thought I understood the AS3 event scheme: capture, target, bubbling. That events (e.g. MouseEvents) travel from stage to the object clicked on and then back again, and all objects in the display chain receive and can check that event. But it's also true, it seems, that Interactive Objects in front of others will block and "absorb" events, and those beneath will never hear of the event (unless mouseEnabled for the blocking object is set to false). I don't understand this (seeming) contradiction.
On the Kirupa forums:
Along with event propagation in ActionScript 3 comes different phases of events with display objects. With propagation, you have events being propagated from display objects to other display objects, such as mouse click events being propagated from children to their parents. This lets clicks within children objects to be recognized by parents (since children make up the contents of their parents, its only natural for the parent to also have those same events). The phases of such an event represent the progression of the event as it makes its way through the parent and child objects.
Events actually start with parent objects (phase 1: capturing), starting with the top most parent (stage) and making its way down to the child where the event originated (phase 2: at target). Then after reaching the child it makes its way back up through all the parents again (phase 3: bubbling).
But also:
Though ActionScript 3 now supports event propagation (capturing, bubbling, etc). Events like mouse events still only occur for one specific target for each individual event. In other words, when you click the mouse button over some objects in a Flash movie, only one of those objects is going to recieve the event even though the mouse is physically over other objects as well.…One important thing to keep in mind is that, in ActionScript 3, mouseEnabled is true by default. This means, without any event handlers or listeners used in a movie, every InteractiveObject instance will capture mouse events and prevent them from reaching any other objects beneath them.
Any clarification much appreciated…
If Something Do Null?
I've a wee if statement here:
.
Code:
on (rollOut) {
if (web == "true") {
stop();
} else {
getURL("cursor:out");
}
}
now I dont want a stop action there, I just want it to do nothing, whats the code for nothing
Using Null In AS3
I have a function that passes a null argument the first time it is called. This worked well in AS2, but reports the good old error 1009 in AS3. I have tried using null and undefined.
The function is declared here:
Code:
function playBucket (theBkt, oldTxt, newTxt):void{
var revealTx3:Tween = new Tween (oldTxt, "alpha", Regular.easeInOut, 100, 0, 15, false);
revealTx3.addEventListener(TweenEvent.MOTION_FINISH, revealTx3Fin, newTxt);
var revealBkt:Tween = new Tween (theBkt, "alpha", Regular.easeInOut, 30, 100, 10, false);
revealBkt.addEventListener(TweenEvent.MOTION_FINISH, revealBktFin, theBkt);
};
The function is called here:
Code:
function revealTx2Fin (e:TweenEvent):void{
playBucket(bkt1_mc, null, instrTx1_mc);
};
So what is the new correct way to pass an undefined value to a function?
Many thanks helping a once-again-newbie find his way in the post-AS2 world
mm66
Set To Null
I'm currently working my way through C.Moock's Essential AS3 book and am currently looking at 'Event listeners and Memory Management' (page 216 if you've got a copy). The chapter suggests a hypothetical butterfly game for which to remove stranded listeners. Me being me has to emulate the whole thing in order to understand it properly, which means in this case adding flappy butterflies to the stage - (the book just suggests this would be the case) . I think I've approached it correctly...? and the whole thing works as required, I've removed the timer listener at the point I destroy/click the butterfly but am not sure about setting the new Butterfly class/object created in main Butterflygame class to null - do I trigger a function from Butterfly in Butterflygame to set butterfly to null? would that set them all to null?? I would be very grateful if someone could explain in plain numpty language.
Many Thanks
Mikeb
Attach Code
package {
import flash.display.*;
import flash.utils.*;
public class ButterflyGame extends Sprite {
private var timer:Timer;
public var butterfly:Butterfly;
public function ButterflyGame():void {
timer = new Timer(500,0);
timer.start();
for (var i:Number = 0; i < 5; i++) { // loop to add multiple butterflies
butterfly = new Butterfly(timer);
addChild(butterfly); // read here (http://greenethumb.com/article/23/understanding-root-and-the-document-class-in-as3) that this will add
// the new butterfly() created above to the display list and then the butterfly class can access stage objects etc..
}
}
}
}
////////////////////////////////////////////////////////
package {
import flash.display.*;
import flash.events.*;
import flash.utils.*;
import fl.transitions.*;
import fl.transitions.easing.*;
public class Butterfly extends Sprite {
private var gameTimer:Timer;
public var newBfly:bfly = new bfly(); //this is a linked movieclip in the main fla library
public function Butterfly(gameTimer:Timer) {
this.gameTimer = gameTimer;
this.gameTimer.addEventListener(TimerEvent.TIMER, timerListener);
addChild(newBfly); //sticks the mc above on the stage
newBfly.addEventListener(MouseEvent.CLICK, destroy);// added listener to mc to remove itself when clicked
}
public function timerListener(e:TimerEvent):void {
//some random tweening routine - code removed - does work though!//
}
public function destroy(event:MouseEvent):void {
gameTimer.removeEventListener(TimerEvent.TIMER, timerListener); //as reccomended in the book removes stranded listener(s)
//parent.removeChild(this); //either of these work
ButterflyGame(root).removeChild(this); //either of these work
}
}
}
Null ?
I'm trying to make an application but I don't this IF condition.
measuredValveClearance1=Number(a1_txt.text);
//--- problem
if (measuredValveClearance1 == Null) measuredValveClearance1=0;
//-- end problem
old1=Number(b1_txt.text);
var res1=(measuredValveClearance1-clearance1)+old1;
c1_txt.text=(res1);
How do I do to in the scenario the user doesn't enter any value for measuredValveClearance1 to make the value 0
Can anybody tell me the right syntax / way to do it?
Tx
Use Of Null?
I have a FLV player with standard controls. I have also made another play buttons that sits ontop of the video until it starts playing.
ActionScript Code:
vidPlayer.addEventListener(VideoEvent.PLAYING_STATE_ENTERED, hidePlaybtn);//when you click the play button I made it calls startVidfunction startVid(e:MouseEvent):void{ vidPlayer.play(); hidePlaybtn(null);}function hidePlaybtn(e:VideoEvent):void{ TweenLite.to(playBtn,1,{autoAlpha:0,ease:Exponential.easeOut});}
my problem was, in the startVid function I call hidePlaybtn(). I first had it like hidePlaybtn() and it was giving me an error because hidePlaybtn() is expecting a VideoEvent. So I just put null in their and it worked fine. I never really used null before, but is that ok what I did or is their a more proper way of doing it?
OnEnterFrame = Null?
Is this a proper way to turn off an onEnterFrame function without losing it?
Code:
onEnterFrame = function (){
blah, blah, blah;
}
if (this and that) {
onEnterFrame = null;
}
OnEnterFrame Null
Hey guys
I have a function that is couched in a an onEnterFrame command. I set it to null when I hit a certain button. However, how can i "unnullify it". In other words, what is the opposite of the null value. Just like false is the opposite of true, what is the opposite of null. Thanks guys
Don
Delete Vs. Null
just curious if there is any efficiency difference between using null versus delete. in other words, does it take less time or use less overhead to say:
delete this.onEnterFrame;
versus
this.onEnterFrame=null;
any info you have on this question, or any info at all related to delete vs. null would be greatly appeciated.
cheers
j
Parent To A Null?
Hello, I'm fairly new to Flash 8, and have a question about an effect I'm trying to achieve.
Example:
In After Effects, I can parent one object (child) to another object (parent). When I move the parent, so does the child.
How would I accomplish this with two movie clips in Flash 8?
Speficifallly, I'm scripting a tween for one object after a mouse click, but want to move a second object to move 90% of the x and y position of the first object.
I'm not sure where to start with the parenting/following bit.
The end goal is to achieve a multiplaning effect in my interface with "closer" objects moving slower than "further" objects.
thanks,
-SF
A Var Named Null
hello,
i have a situation where i have a variable named "null" on _root.
how do i trace it or check its content?
Null Error
So I have an error message like so...
Code:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Controller/loadXML()
at Image/loadXML()
Claiming that I have a access property that is null.... I don't know how this is possible, but I am willing to sugestions. Here is the code for the Controller and the loadXML for the Image class.
Controller:
Code:
package
{
public class Controller
{
private var model:Object;
private var stuff:Array;
public function Controller(model:Object):void
{
this.model = model;
}
public function loadXML(sectionName:String, image:Object):void
{
stuff[0] = sectionName;
stuff[1] = image;
model.loadXML(stuff);
}
}//end control
}//end package
Image class:
Code:
public function Image(model:Object, controller:Object)
{
this.model = model;//puts model object into var for the class
this.controller = controller;//puts controller object in var for class
this.model.registerView(this);//tells model to register this class
this.icon_btn.addEventListener("click", loadXML);
}
public function loadXML(evt:Event)
{
var sectionName:String = "section";//adds the name which the XML will look for
this.controller.loadXML(sectionName, this);
}
Thanks for any help!
Opposite To Null?
i have an onEnterFrame script that i set to null.
How do activate it again? without moving to a different frame.
I've tried:
PHP Code:
preloader_mc.onEnterFrame!=null;
Cheers,
bl
Null À Function
I have a movie clip where at some point I do this:
mcProd.onRelease = function (){
the code;
}
But later on, I need this specific movie clip to be unclickable...is it possible to remove a function or null it so that even the little hand doesn't appear?
Remove Null Value
Hi,
I have the following code which displays details within a multiline text field.
This all works fine however if the value for company[i].company_details['pm_company_address_2'] is null/contains no value how can i remove this.
I have tried applying an if statement but it keeps breaking the code.
If there is a better alternative i would like to hear your thoughts.
Code:
company_detail_mc.company_details.multiline = true;
company_detail_mc.company_details._width = 186;
company_detail_mc.company_details.styleSheet = styles;
company_detail_mc.company_details.text = "<p>"
+ company[i].company_details['pm_company_address_1'] + "<br>"
+ company[i].company_details['pm_company_address_2'] + "<br>"
+ company[i].company_details['pm_company_city'] + ", "
+ company[i].company_details['pm_company_state'] + " "
+ company[i].company_details['pm_company_postal_code'] + "</p>";
company_detail_mc.company_details.autoSize = true;
xHeight = company_detail_mc.company_details._height;
Null And Undefined
I have really never thought about this but what is the difference between null and undefined?
Opposite Of Null?
Hello!
I've used myFunction = null;
to kill some functions... but later on I want them back..
How do I un-null a function once it's been brutally killed off?
P
Null Vs Undefined And The GC
As I understand it, the only time "undefined" is applicable in AS3 is for untyped variables. If you try to assign a typed variable the value "undefined", then the default value of that variable type is assigned by Flash (eg var str:String = undefined would be changed by Flash to str = null).
My questions are this:
If a variable's value is null, the GC might collect it. If collected however, is the variable definition still available for future assignment or is it wiped from the program altogether and unavailable for future use/reassignment?
If the definition does persist, but has a null value, is there any way to delete the variable altogether and wipe it from the program entirely, never to be assigned a value again?
Null Check
Hey everyone
I'm using a pre-made script to create a gallery (thumbnails + enlarged images).
The thumbnails are stored in "holder_mc" and the enlarged images are stored in "largeContent". I'd like to remove these two childs when a certain frame is reached.
To do that I used this code:
Code:
removeChild(holder_mc);
largeContent.removeChild(loader.content);
The problem with using this is that sometimes the user reaches the frame that contains this code without viewing the gallery first. In other words, Flash tries to "removeChild" targeting 2 symbols that were not created in the first place; As in, symbols that are null.
How do I make it so flash checks whether holder_mc and largeContent are null or not, and only if they are not null will the code above run?
(I tried this but it didn't work, what am I doing wrong?
Code:
if ((holder_mc)== null){
removeChild(holder_mc);
}
if ((largeContent)== null){
largeContent.removeChild(loader.content);
}
)
Thanks!!!
If (myMovieClip = Null){ ?
I have been using this code for a while now and simply list all animated movie clips in a function like this...
ActionScript Code:
if (myMovieClip != null){
myMovieClip.stop();
I also make another function to play each movie clip.
The problem I am having now is I THINK when the movie clip isn't present at the beginning of the scene (Where the above code is) I get an "Access of undefined property" error. I dont know why I am getting this because I was hoping that if myMovieClip is null then it would ignore the rest of the if statement and go onto the next, but I could be wrong. Can anyone explain exactly what is going on here.
Cheers
Null Coercion
Hiya ...
I'm trying to get a String into a addChild object ... i thought my coercion would be ok - but its tracing 'null' (checkObj) when the String (animal) traces ok .
ActionScript Code:
var animal:String = thisClass + "Class";
var checkObj:MovieClip = this[animal];
trace(checkObj);
trace(animal);
addChild(checkObj)
i don't know whats in my code causing it to bomb .
any ideas ?
Xml String Is Null
if I trace out streamPlay inside the ReadContent function then it traces correctly. However if I trace streamPlay elsewhere it returns null...why?
ActionScript Code:
streamPlay:String;
function ReadContent(Client:XML):void {
trace("XML Output");
trace("------------------------");
streamPlay = Client.stream[0].file;
}
What Does Object=null Mean?
Hi, what does the following function declaration mean?
Code:
public function foo(bar:Object=null):void{
....
}
Does it mean that if I do foo() (I don't pass an argument), then bar will be null? And that if I do foo("duh"), then bar will be "duh" ?
Thanks in advance,
Nitro
XML - NodeValue=null?
Code:
ActionScript Code:
testXML = new XML("<cat>fluffy</cat><dog>spot</dog>");
testXML.ignoreWhite = true;
test = testXML.childNodes;
for (length in test) {
i++;
temp = test[(i-1)].toString();
tempXML = new XML(temp);
tempXML.ignoreWhite = true;
trace(tempXML.firstChild.nodeName+" -> "+tempXML.firstChild.nodeValue);
}
Output:
Quote:
cat -> null
dog -> null
I'm going nuts. All I want is fluffy and spot back.
So yeah, basic walkthough: I create an XML object, turn it into an array of nodes, then create new XML objects from the nodes. With the objective being knowledge of what node I'm stripping, and the value of that node.
But I can't seem to coerce a value out of this XML...
It is driving me mad. Perhaps I don't understand what is going on. =[
String = Null;
how do I set a sting equal to zero
I have tried:
blah = 0;
blah = 0
blah = "";
blah = ""
how do I do it?
Can Uint Be Null?
so ive got this method and FDT is complaining about uint not being able to be null. true?
public method SomeClass ( n:String=null, id:uint=null ) {}
OnEnterFrame = Null?
I am using a function for a simple pacman game (im new to flash and i wanna try to make the game and refine it as i get better)....the function makes the onEnterFrame for the ghost null and when the dead_ghost_mc gets to the originating ._x and ._y it will make the onEnterFrame accesible again. My problem is once the onEnterFrame is made null i can never get it back.
this is my code so far:
//green eatable is assigned a 1 when pacman eats green_ghost_mc
//green_ghost_dead_mc is the movie clip that turns to eyes and finds
//its way back to the starting coordinates.
//once at the starting coordiantes the original ghost returns
green_ghost_dead_mc.onEnterFrame = function()
{
if(green_eatable == 1)
{
green_ghost_mc.onEnterFrame = null;
if(green_ghost_dead_mc._x > 309)
{
green_ghost_dead._x--;
}
else
{
if(green_ghost_dead_mc._x < 308)
{
green_ghost_dead._x++;
}
else
{
green_ghost_dead_mc._x = 308.7;
}
}
if(green_ghost_dead_mc._y > 204)
{
green_ghost_dead_mc._y--;
}
else
{
if(green_ghost_dead_mc._y < 203)
{
green_ghost_dead_mc._y++;
}
else
{
green_ghost_dead_mc._y = 203.15;
green_eatable = 0;
green_ghost_mc.onEnterFrame; //how do i make this accesible?
}
}
}
}
Calcfields Comes Up NULL
Hi, I'm using flash 2004 professional. I'm trying to make a calculated field in a dataset but am having some trouble.
I've tried to follow the example used in the flash help.
I have a dataset named "ds".
I have 3 input text components called "f1" , "f2" and "box1"
In the ds schema, i've made 3 items -- "price", "quantity" and "totalPrice".
All 3 have datatypes set to Number.
"totalPrice" Kind is set to Calculated.
I have f1 bound(out) to ds.price -- f2 bound(out) to ds.quantity -- and box1 bound(in) to ds.totalPrice.
On the first frame of the movie i have this actionscript:
function calculatedFunct(evt) {
evt.target.totalPrice = (evt.target.price * evt.target.quantity);
}
_root.ds.addEventListener('calcFields', calculatedFunct);
When i run the movie and try to input numbers into f1 and f2, I get "NULL" in box1.
What am i doing wrong?
Thanks in advance, db
If (man.hitTest(none)){ Null
Hi is there a simple way to detect if a hit test is null?
I am trying to make something happen if the hit test is called and something else when it does not exist.
Code:
if (man.hitTest(mostache.dude)){
_root.mostache._x = man._x;
Caption_Create(true, "HELLO I AM BLAH", this);
}
if (man.hitTest(none)){
Caption_Create(false);
cheers
Opposite Of Null?
Hello,
I've killed some functions in my game with myFunction = null;
But later on I want them back! ie when I reset some stuff...
How do I un-null?
P
|