Flash Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignFlash Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 11th, 2004, 07:14 PM
kta kta is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 4 kta User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Referencing a MovieClip object from within a function

I have a movie clip that loads a file. If the file contains a certain value I want to call a function and send it "this" (a reference to this movieClip object). But "this" does not refer to the object, instead it seems to be linked to the values the file has loaded.

-----------------------------------------------------------------
function successFunc(success) {

if(success) {

if (myLoad.featured == "yes"){

_root.registerMeFeatured( this );

}

}

}
------------------------------------------------------------------

The above is what I have and it sends the contents of the file rather than a reference to the movie clip (which is what i would like).

-----------------------------------------------------------------

_root.registerMeFeatured( this );

------------------------------------------------------------------

The above, when used outside of the function will work properly and send the object as I would like. How can I make this work within the function? Thanks in advance.

Reply With Quote
  #2  
Old February 12th, 2004, 02:52 AM
Tann San Tann San is offline
Gotta get to the next screen..
Click here for more information.
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,584 Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 7835 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 5 h 57 m 22 sec
Reputation Power: 534
Facebook MySpace
Hi, what does this do?:

_root.registerMeFeatured( _parent );
__________________
-Tann

-Vote for your favorite ActionScript editor here.

Reply With Quote
  #3  
Old February 12th, 2004, 12:10 PM
kta kta is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2004
Posts: 4 kta User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I tried that and it returned _level0. So I tried using ( _parent + ".nameOfMovieClip" ), and although what it returned appeared right, I couldn't use it to reference the movie clip.

Reply With Quote
  #4  
Old February 12th, 2004, 01:42 PM
Tann San Tann San is offline
Gotta get to the next screen..
Click here for more information.
 
Join Date: Nov 2003
Location: Legion of Dynamic Discord
Posts: 4,584 Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)Tann San User rank is Colonel (50000 - 60000 Reputation Level)  Folding Points: 7835 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 5 h 57 m 22 sec
Reputation Power: 534
Facebook MySpace
Hi, try out eval, it's great:

_root.registerMeFeatured(eval(_parent + ".nameOfMovieClip"));

or:

_root.registerMeFeatured(eval("_parent." + "nameOfMovieClip"));

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignFlash Help > Referencing a MovieClip object from within a function


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway