Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

object variable not recognised

Status
Not open for further replies.

silverswim

Programmer
Oct 17, 2001
50
GB
Hi,
I'm trying some old script to classes...I had a global boolean variable called subtitlesYes , which I want to declare as the property of an object...It has to be readable by several levels of swf's which are loaded and unloaded at different times.
I put this in an as file, in the same directory as the swf's :

class ipa{
var subtitles : Boolean;

function ipa( subtitlesYes : Boolean){
subtitles = subtitlesYes;
}
}

In the root movie I put in the first frame:

var dpp : ipa = new ipa(false);

and then later on a level 3 swf, I had this:

if( dpp.subtitlesYes == false){
_level3.speech._visible = false;
};

then in publish settings for as2 I put the document level class path in; ie. the same directory path as where the swf's are stored. I've put the path into all the swf publish settings.
And it all doesn't work though the compiler doesn't complain of anything...
Thanks so much if you can help, silverswim
 
Shouldn't you be calling this instead:

Code:
if( dpp.subtitles == false){
           _level3.speech._visible = false;
};

...since 'subtitlesYes' exists only as a parameter in the class not as a property?
 
Thanks wangbar, that's definitley right- though I also had to specify the path of the object dpp i.e.
if( _level0.dpp.subtitles == false) {
etc etc

sure it ought to have worked with _root.dpp.subtitles but it only did work with _level0 etc

so its working, and thanks so much,
silverswim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top