TwelvestoneFlash

as3 - function scope


Sign in

  • Waiting for Godot ( 720 k posts )
    Just conversation.
  • Thunder Dome ( 23 k posts )
    Photoshop Tennis and Collabs.
  • Photography ( 4.8 k posts )
    For all you shutterbugs, sh...
  • Flash ( 18 k posts )
    ActionScripting to tweens, ...
  • Front End ( 5.8 k posts )
    general front end design an...
  • Back End ( 9.6 k posts )
    serverside scripting, progr...
  • Projects and Theory ( 12 k posts )
    This forum is for discussio...
  • FAQ ( 269 posts )
    All those nagging questions...
  • Design ( 17 k posts )
    graphics & all aspects of g...
  • Purgatory ( 3.6 k posts )
    12stone Jail, feel free to ...
Storm
 
2009-02-10

three simple SIMPLE lines from my Main application class

xmlSource = ExternalInterface.call("combineCatalogXML", jobCodeNum); xmlModule = new XML(xmlSource);

MovieClip(courseScroller.courseList).displayResults(xmlModule);

Line 3: there is a displayResults function inside the MC courseList which is inside the courseScroller MC.

jobCodeNum is 24 in this case and works just fine. But the function is NOT being called. What is the correct syntax for Line 3 when calling other MC's functions from a class.

MovieClip(mc1.mc2) ? MovieClip(mc1).MovieClip(mc2)?

neither seems to work as the function is not being called.

JLM
 
2009-02-11

this might work..

var mc: MovieClip = courseScroller.courseList as MovieClip; mc.displayResults(xmlModule);

but should you be making a getter on courseScroller?

Storm
 
2009-02-11

of note.....I'm not a programmer. I'm just able to write good code from doing Flash so long.

I don't know advantages/disadvantages of getters and setters, so I guess I'm asking you what would that do for me? And what exactly is it for?

JLM
 
2009-02-11

maybe I should have said setter.

if I want the courseScroller to show some info I shouldn't need to know about the internal display implementation, I just say to courseScroller display this ie

courseScroller.setResults(xmlModule);

so if i want to change the view I can code to an interface...

var courseView: IcourseView = new courseScroller();

then later I can

var courseView: IcourseView = new courseScroller3D();

what I am saying is that if you have

body.arm.wrist.hand.finger.point();

it couples your code very tightly to the body view you have implemented. But its always swings and rounderbouts, I am really saying if you go with the black box approach then your OOPing, otherwise your being practical and getting stuff done with less flexibility but maybe less overhead.

Sorry, you must be a member to post to a conversation. Either log in or sign up to get involved.
TwelvestoneFlash

as3 - function scope