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




 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 03-23-2011, 02:18 AM
freaksarise freaksarise is offline
Registered User
 
Join Date: Nov 2004
Posts: 111
Rep Power: 9
freaksarise is on a distinguished road
Understanding Class: Assigning to MC is easy. How to use for array?

Hello all. I apologize for the cryptic title of this post but am not sure how to ask.

Allow me to explain:

1. If I needed to create a package, class, constructor function/method that is executed with each instantiation of a movieclip that includes it's link to the class, I am cool.

2. I have four arrays. Each need to have their values shuffled. I developed code that does just that but instead of keying the same block of code over and over, I would like to just say arrayName.shuffle();

I am not sure how to parse an array (which is not an MC/sprite) through a class.

This is what I am using to shuffle an array

Actionscript:
while (ChooseFromCollections.length > 0)
    {
        var rw_randomNumbr:Number = Math.floor(Math.random()*ChooseFromCollections.length);
        chosenCollections.push(ChooseFromCollections[rw_randomNumbr]);
        ChooseFromCollections.splice(rw_randomNumbr,1);
        trace(ChooseFromCollections);
        
    }
In the above I could swap the ChooseFromCollections hardcoded array name with a more dynamic variable that would allow any array to be passed through there.

But if I was passing the array to the above with the udpated dynamic variables, how would I pass it to? It's an array not a movieclip.

I would like to be able to add a new sprite to the stage and with that new sprite have it inherit a bunch of the functions and properties I will need.

This is my worst post over. i am just very confused and my sleeping pill has kicked in. I hope maybe some of this makes sense.

Thanks
Rich
__________________
Enjoy my music for free
http://www.FreaksArise.com

Last edited by FlashMove : 05-17-2011 at 03:23 AM
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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Linking symbol to custom class skitzer Flash CS3 / Flash 9 6 03-12-2010 02:20 PM
ways for movieclip inheriting class Isekream Actionscript 2.0 1 07-27-2006 02:00 AM
deleting Class resources wesm Flash MX 2004 1 01-31-2006 07:13 PM
Getting the class name/package at runtime Scottae Actionscript 2.0 3 01-26-2005 04:39 AM
as2 class questions Solari Flash MX 2004 7 10-11-2003 01:38 AM




All times are GMT. The time now is 10:54 PM.