TwelvestoneFlash

referencing movie clip in a function


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 ...
Technomancer
 
2009-11-04

I've got a little bit of flash to do and I haven't opened flash since version 4 and AS1.

I'm using CS3 and AS2 (I think).

The issue: I have a movie clip on layer in Frame1 (instance name of 'soldmark'. I add an event listener and want to affect the movie clip in the event listener function:

listenerObject = new Object(); listenerObject.onMyEvent = function(eventObject):Void {

soldmark._visible = false;

sold = eventObject.data.sold;

if (sold == "true") { var soldmarkTween = new Tween(soldmark,'_alpha',None.easeNone(0,1,2),true); } } myMovie.addEventListener("onMyEvent", listenerObject);

I'm getting the following error at compile time:

"The class or interface soldmark could not be loaded"

and I'm 99% sure that it's when it's being referenced in the new Tween instantiation.

How do i reference the mc as a parameter to the class instantiation?

I get the same error if i use _root.soldmark.

DontBogartMe
 
2009-11-05

did u sort this already Techno?

Make sure you're specifying AS2 in your publish settings.

Then try to see if it can find soldmark at all, just add a simple trace outside of your event handler: trace("soldmark = " + soldmark);

Technomancer
 
2009-11-06

Yeah, got it sorted thanks, it was something totally trivial.

On the linkage and properties dialog there is a field for 'class' which I had populated with 'soldmark' but I think flash was throwing a wobbly because that is for AS3 only and it was hunting for a class that didn't exist. Anyway, i cleared those fields and all was good.

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

referencing movie clip in a function