LOADING
Loading
Hi , welcome back.
LogoutLOGOUT
 
  Lost password?  
Hi
 




 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 03-12-2004, 03:47 PM
FrozenMedia's Avatar
FrozenMedia FrozenMedia is offline

Frozen Moderator
 
Join Date: Apr 2003
Location: United Kingdom
Posts: 2,701
Rep Power: 13
FrozenMedia is on a distinguished road
Javascript in Director MX 2004

So they added JS syntax to Director, making it much easier for us Actionscripters to head on over and dip our toes for certain projects, that's what was meant to happen...

It seems they didn't implement the ECMA standard too well due to incompatibilities with lingo, can anyone really good at understanding scoped languages (Tim u there :P) take a look at this and tell me what they think:
Actionscript:
trace("Global script scope");
 
_global.a = 1;
 
function locals() {
   a = 6;
   trace(a);  // 6
   delete a;
   trace(a);  // 1
   
   // var a = 5;  // If you uncomment this line, the previous 2 traces, trace "5" also ???
}


function locals2() {
  var a = 10;
  trace(a);  // 10
}


function locals3() {
  trace (a);   // 1
  this.a = 8;
  trace(a);    // 8
}

 
function locals4() {
  delete a;            // Comment out this line & next trace is "8" ??
  delete _global.a;    // Comment out this line & next trace is "1" ??
  trace(a);            // Don't comment either and trace is "undefined"
}


locals();   // Expected results until line is uncommented
locals2();  // Expected results
locals3();  // Expected results
locals4();  // What the hell is going on when you comment out lines
P.S. This is Director JS code not AS. Most of it is fine, but you can see in the 1st and 4th functions thing go a bit whacky with the marked lines. This explains some of it http://www.macromedia.com/devnet/mx/...zation_02.html

Rich

p.p.s Anyone managed to get code coloring working properly with JS syntax?
__________________
Blog: http://www.richardleggett.co.uk | If your happy with the help, let us know about it
Reply With Quote
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
My Flash and JavaScript don't like each other. BlackHatHunter Flash MX 2004 4 07-25-2006 06:15 PM
Flash and javascript? stunter Flash MX 2004 0 07-13-2005 08:47 AM
New Screen Capture/Recording Extension for Flash MX 2004 curi1122 New Softwares 6 06-16-2005 02:42 PM
Flash, Javascript, Do something on variable change... Splitz Flash MX 2004 7 04-20-2005 11:58 AM
MX 2004 Pro - Javascript TCallLabel Oddities Weevil Flash MX ActionScript 0 05-20-2004 04:23 PM




All times are GMT. The time now is 12:53 PM.