# Passing an associative array isn't working?

**URL:** <https://forum.kirupa.com/t/passing-an-associative-array-isnt-working/318102>\
**Category:** flash\
**Created:** [January 10, 2011, 9:37pm UTC](https://forum.kirupa.com/t/passing-an-associative-array-isnt-working/318102 "2011-01-10T21:37:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Spantagonist](https://avatars.discourse-cdn.com/v4/letter/s/a587f6/32.png) [@Spantagonist](https://forum.kirupa.com/u/Spantagonist)\
**Post date:** [January 10, 2011, 9:37pm UTC](https://forum.kirupa.com/t/passing-an-associative-array-isnt-working/318102/1 "2011-01-10T21:37:38Z")

</div>

TheCanadian answered this perfectly, see below.

Hey.  
The title is a little misleading since I figured a few things out. Please take a look at this code snippet and explain what’s going on…

Here’s the relevant information:

A extends B.

class B{  
function B(pData){  
trace(pData) //prints “undefined”  
}  
}

(in a callback function, in particular LoadVars.onData)  
var pData=“Print me”  
var foo=new A(pData)

Somehow pData isn’t getting to the constructor correctly… It has something to do with A being a subclass of B, because if I call the constructor of B directly, it works as expected.
