Current location: Hot Scripts Forums » General Web Coding » Flash & ActionScript » instance name


instance name

Reply
  #1 (permalink)  
Old 02-08-08, 05:17 AM
jonnekke jonnekke is offline
Code Guru
 
Join Date: Oct 2005
Location: holland!
Posts: 706
Thanks: 0
Thanked 0 Times in 0 Posts
instance name

Hi there..

in my movie I got an MC with the Instance Name: "partone"
there is a button on this MC. There is AS on that button (on release..)

In this AS I want to use the Instance Name "partone" but I want it to
be detected automatic so I can use the button several times and not
to make a new on for each part.

how can I get this Instance Name to use in my AS?

thnx!

_j
Reply With Quote
  #2 (permalink)  
Old 02-08-08, 05:50 AM
jonnekke jonnekke is offline
Code Guru
 
Join Date: Oct 2005
Location: holland!
Posts: 706
Thanks: 0
Thanked 0 Times in 0 Posts
some changes to this topic...
but i was to late to edit.. that's why I react to my own topic




I got row of code like this:

ActionScript Code:
  1. on (release) {
  2.  
  3.     var wich = _name;
  4.     var stat = "stat";
  5.     var statu = wich+stat;
  6.    
  7.     _root.statu = 1;
  8.        
  9. this.gotoAndStop(2);
  10. }

now it returns: _root.statu = 1

but i should return: _root. "wich+stat" = 1;

how to fix this?..

Last edited by UnrealEd; 02-14-08 at 03:59 AM.
Reply With Quote
  #3 (permalink)  
Old 02-14-08, 03:59 AM
UnrealEd's Avatar
UnrealEd UnrealEd is offline
Community Liaison
 
Join Date: May 2005
Location: Antwerp, Belgium
Posts: 3,165
Thanks: 4
Thanked 25 Times in 25 Posts
please use the [highlight=ActionScript] wrapper

i think what you need is this:
ActionScript Code:
  1. _root[_name + "stat"] = 1;
  2.  
__________________
"Good judgement comes from experience, and experience comes from bad judgement." - Fred Brooks

Reply With Quote
Reply

Bookmarks


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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
reference not set to an instance of an object. Please help! DonLindon ASP.NET 10 12-26-07 12:37 PM
new instance - new name skwair Flash & ActionScript 0 04-26-07 07:04 AM
is it possible to create instance of button using javascript janunme JavaScript 7 04-11-07 01:12 PM
Dif between static & instance method (I forgot)??PLEEESE! smartweezie Windows .NET Programming 1 09-18-05 03:54 PM
Error in OleDBConnection : Object reference not set to an instance of an object pvsunil Windows .NET Programming 1 04-22-05 01:45 PM


All times are GMT -5. The time now is 06:35 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.