08-07-2005, 12:32 AM
|
#1
|
|
Will Flash for Cash
Join Date: Jul 2005
Posts: 99
|
cannot set/get properties on class instance - why?
I have several movieClips in my app that are linked to a class
I have extended the MovieClip class by editing the properties of the clip in the library to set linkage: Export for actionscript, Export in first frame and I have placed my class name in the field labeled AS 2.0 Class.
Sample - Symbol Properties dialog:
Identifier: kracko_btn
AS 2.0 Class: parkButton
Linkage: X - Export for ActionScript, X - Export in first frame
I have altered the classpath to include the path where (parkButton.as) containing the class parkButton resides.
An excerpt from the class code is as follows:
Code:
class parkButton extends MovieClip {
// stores URL for processEvent()
private var myURL:String = "None";
// stores media type for processEvent()
private var myType:String = "None";
function set theURL(myStr:String) {
this.myURL = myStr;
}
function get theURL():String {
return this.myURL;
}
function set theType(myStr:String) {
this.myType = myStr;
}
function get theType():String {
return this.myType;
}
function doesStuff():String {
return heresSomeStuff;
}
}
Note that I have created implicit set/getters. So I believe should be able to set/get properties with (class.property = value) syntax.
Also note that I have placed default values in the properties, so I should not later find that they are undefined.
On the 1st frame of my timeline I have the script:
Code:
import Buttons.parkButtons;
As a result of a parsing function that executes in frame 3 of the timeline the following code is executed to update properties of (kracko_btn):
Code:
this.kracko_btn.theURL = "http://www.moretothestory.com";
this.kracko_btn.type = "HTTP"
Following the parsing routing I do some tracing to see where I stand:
Code:
trace("kracko_btn.theType = " + this.kracko_btn.theType);
trace("kracko_btn.theURL = " + this.kracko_btn.theURL);
the resulting output is:
Code:
kracko_btn.theType = UNDEFINED
kracko_btn.theURL = UNDEFINED
The publish settings for the swf file have the classes exporting on frame 1.
I have done basically the same thing minus the XML parsing in another SWF file and it works fine. In the other example where it now works it didn't work at first. I changed the set/gets to frame 3 of the timeline (they were in frame 1) and it worked.
However, doing the same thing in this application does not help. What are the issues surrounding targetting these properties? I think I must be missing something.
An insight you can provide would be greatly appreciated. I'm stuck.
Kracko
Last edited by kracko; 08-07-2005 at 12:36 AM.
|
|
|
08-07-2005, 01:01 AM
|
#2
|
|
Registered User
Join Date: Dec 2003
Location: ireland
Posts: 15
|
hi,
first off i assume you attach the class like so:
this.kracko_btn = this.attachMovie("kracko_btn", "kracko_btn", 1);
secondly is the import required?:
import Buttons.parkButtons;
the class is already bound to 'kracko_btn' in your library.
then its hard to know what the problem is. can you trace:
trace("kracko_btn= " + this.kracko_btn);
successfuly? if not then the MovieClip isn't being instantiated correctly.
but its hard to know without seeing how its all set up.
later
e
|
|
|
08-07-2005, 01:55 AM
|
#3
|
|
Will Flash for Cash
Join Date: Jul 2005
Posts: 99
|
thanks for the quick response
No I had not done the attachMovie().
I had placed the clip on the stage manually to visually get the position, etc.
I added the import because I was trying to get it to work. (kinda like waving a dead chicken over it) Cause I couldn't get it to work.
I try adding the attach movie and see what happens.
Kracko
|
|
|
08-07-2005, 02:26 AM
|
#4
|
|
Will Flash for Cash
Join Date: Jul 2005
Posts: 99
|
Ok, I added the attachMovie() statements to the 1st frame. And now it is weirder. I have one instance returning the default values (when they should be populated according to the XML file) I have thoroughly tested the XML parsing and I know it is ok.
But for some reason the get/sets are still flaky.
Frame 1
Code:
this.kracko_btn = this.attachMovie("woodMan_btn", "woodMan_btn", 1);
this.kracko_btn = this.attachMovie("office_btn", "office_btn", 1);
this.kracko_btn = this.attachMovie("phone_btn", "phone_btn", 1);
this.kracko_btn = this.attachMovie("mobile1_btn", "mobile1_btn", 1);
this.kracko_btn = this.attachMovie("copMan_btn", "copMan_btn", 1);
this.kracko_btn = this.attachMovie("copCar_btn", "copCar_btn", 1);
this.kracko_btn = this.attachMovie("MTTSBlog_btn", "MTTSBlog_btn", 1);
this.kracko_btn = this.attachMovie("kracko_btn", "kracko_btn", 1);
this.kracko_btn = this.attachMovie("hires_btn", "hires_btn", 1);
this.kracko_btn = this.attachMovie("bike_btn", "bike_btn", 1);
this.kracko_btn = this.attachMovie("manDog_btn", "manDog_btn", 1);
this.kracko_btn = this.attachMovie("mobile2_btn", "mobile2_btn", 1);
this.kracko_btn = this.attachMovie("mobile3_btn", "mobile3_btn", 1);
this.kracko_btn = this.attachMovie("mobile4_btn", "mobile4_btn", 1);
this.kracko_btn = this.attachMovie("mobile5_btn", "mobile5_btn", 1);
this.kracko_btn = this.attachMovie("fridge_btn", "fridge_btn", 1);
this.kracko_btn = this.attachMovie("mobile6_btn", "mobile6_btn", 1);
this.kracko_btn = this.attachMovie("mobile7_btn", "mobile7_btn", 1);
this.kracko_btn = this.attachMovie("upOnBlocks_btn", "upOnBlocks_btn", 1);
this.kracko_btn = this.attachMovie("woodWoman_btn", "woodWoman_btn", 1);
this.kracko_btn = this.attachMovie("mobile8_btn", "mobile8_btn", 1);
Frame 3
Code:
/* get Location data from XML file
this data is used to process clicks on buttons in the
movie trailer park. See documentation in locations.xml
for details. (called on frame 3 to ensure that classes
are available to set member data)
========================================================*/
function xParse(xObj:XML) {
// 'this' is the returned xml
var rootNode = firstChild;
var locationNode = rootNode.firstChild;
var buttonNode = locationNode.firstChild;
//
var locName:String = "";
var btnName:String = "";
var btnURL:String = "";
var btnType:String = "";
var arrLen:Number = 0;
var locField = "location";
var btnField = "button";
var URLField = "URL";
var typeField = "type";
//================================================
// loop through park locations
// gather location list for array
while (locationNode.attributes.label != null) {
locName = "";
btnName = "";
btnURL = "None";
btnType = "None";
btnTrigger = "release"
locName = locationNode.attributes.label;
trace(locName);
//=============================================
// loop through buttons at this location
// gather button list for array
while (buttonNode.attributes.name != NULL) {
btnName = buttonNode.attributes.name;
trace(btnName);
//=======================================
// if button links to content prepare
// data for array
if (buttonNode.attributes.URL != NULL) {
btnURL = buttonNode.attributes.URL;
btnType = buttonNode.attributes.type;
btnTrigger = buttonNode.attributes.trigger;
} else {
btnURL = "x";
btnType = "x";
}
trace(btnURL);
/* store URL data in parkButton instances
associated with elements from XML file */
if (locName == "home") {
if (btnName == "woodMan_btn") {
this.woodMan_btn.theLocName = locName;
this.woodMan_btn.theBtnName = btnName;
this.woodMan_btn.itActive = true;
this.woodMan_btn.theURL = btnURL;
this.woodMan_btn.theType = btnType;
this.woodman_btn.theTrigger = btnTrigger;
}
if (btnName == "office_btn") {
this.office_btn.theLocName = locName;
this.office_btn.theBtnName = btnName;
this.office_btn.itActive = true;
this.office_btn.theURL = btnURL;
this.office_btn.theType = btnType;
this.office_btn.theTrigger = btnTrigger;
}
if (btnName == "phone_btn") {
this.phone_btn.theLocName = locName;
this.phone_btn.theBtnName = btnName;
this.phone_btn.itActive = true;
this.phone_btn.theURL = btnURL;
this.phone_btn.theType = btnType;
this.phone_btn.theTrigger = btnTrigger;
}
}
if (locName == "mobile1") {
if (btnName == "mobile1_btn") {
this.mobile1_btn.theLocName = locName;
this.mobile1_btn.theBtnName = btnName;
this.mobile1_btn.itActive = true;
this.mobile1_btn.theURL = btnURL;
this.mobile1_btn.theType = btnType;
this.mobile1_btn.theTrigger = btnTrigger;
}
if (btnName == "copMan_btn") {
this.copMan_btn.theLocName = locName;
this.copMan_btn.theBtnName = btnName;
this.copMan_btn.itActive = true;
this.copMan_btn.theURL = btnURL;
this.copMan_btn.theType = btnType;
this.copMan_btn.theTrigger = btnTrigger;
}
if (btnName == "copCar_btn") {
this.copCar_btn.theLocName = locName;
this.copCar_btn.theBtnName = btnName;
this.copCar_btn.itActive = true;
this.copCar_btn.theURL = btnURL;
this.copCar_btn.theType = btnType;
this.copCar_btn.theTrigger = btnTrigger;
}
}
if (locName == "kracko") {
trace("setting URL data for location: " + locName + " button name:" + btnName);
if (btnName == "MTTSBlog_btn") {
trace("Setting kracko - MTTS - itActive");
_level25.MTTSBlog_btn.theLocName = locName;
_level25.MTTSBlog_btn.theBtnName = btnName;
_level25.MTTSBlog_btn.itActive = true;
_level25.MTTSBlog_btn.theURL = btnURL;
_level25.MTTSBlog_btn.theType = btnType;
_level25.MTTSBlog_btn.theTrigger = btnTrigger;
}
if (btnName == "kracko_btn") {
trace("Setting kracko - kracko - itActive");
_level25.kracko_btn.theLocName = locName;
_level25.kracko_btn.theBtnName = btnName;
_level25.kracko_btn.itActive = true;
_level25.kracko_btn.theURL = btnURL;
_level25.kracko_btn.theType = btnType;
_level25.kracko_btn.theTrigger = btnTrigger;
}
if (btnName == "hires_btn") {
trace("Setting kracko - hires - itActive");
_level25.hires_btn.theLocName = locName;
_level25.hires_btn.theBtnName = btnName;
_level25.hires_btn.itActive = true;
_level25.hires_btn.theURL = btnURL;
_level25.hires_btn.theType = btnType;
_level25.hires_btn.theTrigger = btnTrigger;
}
}
if (locName == "mobile2") {
if (btnName == "bike_btn") {
this.bike_btn.theLocName = locName;
this.bike_btn.theBtnName = btnName;
this.bike_btn.itActive = true;
this.bike_btn.theURL = btnURL;
this.bike_btn.theType = btnType;
this.bike_btn.theTrigger = btnTrigger;
}
if (btnName == "manDog_btn") {
this.manDog_btn.theLocName = locName;
this.manDog_btn.theBtnName = btnName;
this.manDog_btn.itActive = true;
this.manDog_btn.theURL = btnURL;
this.manDog_btn.theType = btnType;
this.manDog_btn.theTrigger = btnTrigger;
}
if (btnName == "mobile2_btn") {
this.mobile2_btn.theLocName = locName;
this.mobile2_btn.theBtnName = btnName;
this.mobile2_btn.itActive = true;
this.mobile2_btn.theURL = btnURL;
this.mobile2_btn.theType = btnType;
this.mobile2_btn.theTrigger = btnTrigger;
}
}
if (locName == "mobile345") {
if (btnName == "mobile3_btn") {
this.mobile3_btn.theLocName = locName;
this.mobile3_btn.theBtnName = btnName;
this.mobile3_btn.itActive = true;
this.mobile3_btn.theURL = btnURL;
this.mobile3_btn.theType = btnType;
this.mobile3_btn.theTrigger = btnTrigger;
}
if (btnName == "mobile4_btn") {
this.mobile4_btn.theLocName = locName;
this.mobile4_btn.theBtnName = btnName;
this.mobile4_btn.itActive = true;
this.mobile4_btn.theURL = btnURL;
this.mobile4_btn.theType = btnType;
this.mobile4_btn.theTrigger = btnTrigger;
}
if (btnName == "mobile5_btn") {
this.mobile5_btn.theLocName = locName;
this.mobile5_btn.theBtnName = btnName;
this.mobile5_btn.itActive = true;
this.mobile5_btn.theURL = btnURL;
this.mobile5_btn.theType = btnType;
this.mobile5_btn.theTrigger = btnTrigger;
}
}
if (locName == "mobile67") {
if (btnName == "fridge_btn") {
this.fridge_btn.theLocName = locName;
this.fridge_btn.theBtnName = btnName;
this.fridge_btn.itActive = true;
this.fridge_btn.theURL = btnURL;
this.fridge_btn.theType = btnType;
this.fridge_btn.theTrigger = btnTrigger;
}
if (btnName == "mobile6_btn") {
this.mobile6_btn.theLocName = locName;
this.mobile6_btn.theBtnName = btnName;
this.mobile6_btn.itActive = true;
this.mobile6_btn.theURL = btnURL;
this.mobile6_btn.theType = btnType;
this.mobile6_btn.theTrigger = btnTrigger;
}
if (btnName == "mobile7_btn") {
this.mobile7_btn.theLocName = locName;
this.mobile7_btn.theBtnName = btnName;
this.mobile7_btn.itActive = true;
this.mobile7_btn.theURL = btnURL;
this.mobile7_btn.theType = btnType;
this.mobile7_btn.theTrigger = btnTrigger;
}
}
if (locName == "mobile8") {
if (btnName == "upOnBlocks_btn") {
this.upOnBlocks_btn.theLocName = locName;
this.upOnBlocks.theBtnName = btnName;
this.upOnBlocks_btn.itActive = true;
this.upOnBlocks_btn.theURL = btnURL;
this.upOnBlocks_btn.theType = btnType;
this.upOnBlocks_btn.theTrigger = btnTrigger;
}
if (btnName == "woodWoman_btn") {
this.woodWoman_btn.theLocName = locName;
this.woodWoman_btn.theBtnName = btnName;
this.woodWoman_btn.itActive = true;
this.woodWoman_btn.theURL = btnURL;
this.woodWoman_btn.theType = btnType;
this.woodWoman_btn.theTrigger = btnTrigger;
}
if (btnName == "mobile8_btn") {
this.mobile8_btn.theLocName = locName;
this.mobile8_btn.theBtnName = btnName;
this.mobile8_btn.itActive = true;
this.mobile8_btn.theURL = btnURL;
this.mobile8_btn.theType = btnType;
this.mobile8_btn.theTrigger = btnTrigger;
}
}
buttonNode = buttonNode.nextSibling;
}
//=======================================
// check for more locations
trace(locationNode.attributes.label);
locationNode = locationNode.nextSibling;
// re-set button node to first in list
buttonNode = locationNode.firstChild;
}
}
function loadXMLData() {
moviList_XML = new XML();
moviList_XML.ignoreWhite = true;
moviList_XML.onLoad = xParse;
moviList_XML.load("locations.xml");
}
loadXMLData();
trace("MTTSBlog_btn:" + MTTSBlog_btn.theLocName);
trace("MTTSBlog_btn:" + MTTSBlog_btn.theBtnName);
trace("MTTSBlog_btn:" + MTTSBlog_btn.itActive);
trace("MTTSBlog_btn:" + MTTSBlog_btn.theURL);
trace("MTTSBlog_btn:" + MTTSBlog_btn.theType);
trace("MTTSBlog_btn:" + MTTSBlog_btn.theTrigger);
trace("kracko_btn:" + kracko_btn.theLocName);
trace("kracko_btn:" + kracko_btn.theBtnName);
trace("kracko_btn:" + kracko_btn.itActive);
trace("kracko_btn:" + kracko_btn.theURL);
trace("kracko_btn:" + kracko_btn.theType);
trace("kracko_btn:" + kracko_btn.theTrigger);
trace("hires_btn:" + hires_btn.theLocName);
trace("hires_btn:" + hires_btn.theBtnName);
trace("hires_btn:" + hires_btn.itActive);
trace("hires_btn:" + hires_btn.theURL);
trace("hires_btn:" + hires_btn.theType);
trace("hires_btn:" + hires_btn.theTrigger);
returns
Code:
MTTSBlog_btn:undefined
MTTSBlog_btn:undefined
MTTSBlog_btn:undefined
MTTSBlog_btn:undefined
MTTSBlog_btn:undefined
MTTSBlog_btn:undefined
kracko_btn:None
kracko_btn:None
kracko_btn:false
kracko_btn:None
kracko_btn:None
kracko_btn:release
hires_btn:undefined
hires_btn:undefined
hires_btn:undefined
hires_btn:undefined
hires_btn:undefined
hires_btn:undefined
|
|
|
08-07-2005, 02:52 PM
|
#5
|
|
Registered User
Join Date: Dec 2003
Location: ireland
Posts: 15
|
in attachMovie you should be using depth management within the host movieclip... sorry i didn't make this clear in my last post. you should be using
ActionScript Code:
this.kracko_btn = this.attachMovie("woodMan_btn", "woodMan_btn", 1);
this.kracko_btn1 = this.attachMovie("office_btn", "office_btn", 2);
this.kracko_btn2 = this.attachMovie("phone_btn", "phone_btn", 3);
this.kracko_btn3 = this.attachMovie("mobile1_btn", "mobile1_btn", 4);
this.kracko_btn4 = this.attachMovie("copMan_btn", "copMan_btn", 5);
this.kracko_btn5 = this.attachMovie("copCar_btn", "copCar_btn", 6);
// and so on...
// or ...
this.kracko_btn1 = this.attachMovie("woodMan_btn", "woodMan_btn", this.getNextHighestDepth());
this.kracko_btn2 = this.attachMovie("office_btn", "office_btn", this.getNextHighestDepth());
this.kracko_btn3 = this.attachMovie("phone_btn", "phone_btn", this.getNextHighestDepth());
// and so on..
that will solve the problem that only one mc is showing up, try that and see where it gets you...
ed
|
|
|
08-07-2005, 04:06 PM
|
#6
|
|
Will Flash for Cash
Join Date: Jul 2005
Posts: 99
|
ed,
thanks so much. I should have caught that myself. I had been working more than 13 hours at that point and was looking for a quick solution (that I implemented hastily)
Thanks again,
Kracko
|
|
|
08-07-2005, 05:01 PM
|
#7
|
|
Will Flash for Cash
Join Date: Jul 2005
Posts: 99
|
ed,
That solved the get part of the scenario, but not the set part. It seems that my attempt to set the properties with the values parsed from the XML is not changing the property values.
And so it is clear, the class instances are working. They respond to methods in the extended class at run time.
You have been very helpful. Thanks again.
By the way, I saw the tutorials on your site. I look forward to checking them out in detail sometime when I get a chance.
Regards,
Kracko
|
|
|
08-07-2005, 06:52 PM
|
#8
|
|
Registered User
Join Date: Dec 2003
Location: ireland
Posts: 15
|
hi kracko,
you're very welcome... i know the feeling of staring at the code..
just one last thing i spotted:
in your parse function 'xParse', this refers to the xml object, not your timeline or movieclip parent. you have to specify the location of the clip that contains all your mcs.
eg:
ActionScript Code:
moviList_XML.onLoad = xParse(this);
function xParse(holder : MovieClip)
{
trace("holder : " holder );
...
}
later,
e
|
|
|
08-07-2005, 08:14 PM
|
#9
|
|
Will Flash for Cash
Join Date: Jul 2005
Posts: 99
|
I had considered that, but no luck
I had reviewed the object and variable lists in debug mode and worked out where the clips were, but even when I explicitly specify the target path (_level25.button_btn) it seems that the properties remain unchanged.
This is really starting to drive me crazy.
This is my code now...
Code:
function xParse(xObj:XML, holder:MovieClip) {
// 'this' is the returned xml
var rootNode = firstChild;
var locationNode = rootNode.firstChild;
var buttonNode = locationNode.firstChild;
//
var locName:String = "";
var btnName:String = "";
var btnURL:String = "";
var btnType:String = "";
var arrLen:Number = 0;
var locField = "location";
var btnField = "button";
var URLField = "URL";
var typeField = "type";
//================================================
// loop through park locations
// gather location list for array
trace("Holder: " + holder)
while (locationNode.attributes.label != null) {
locName = "";
btnName = "";
btnURL = "None";
btnType = "None";
btnTrigger = "release"
locName = locationNode.attributes.label;
trace(locName);
//=============================================
// loop through buttons at this location
// gather button list for array
while (buttonNode.attributes.name != NULL) {
btnName = buttonNode.attributes.name;
trace(btnName);
//=======================================
// if button links to content prepare
// data for array
if (buttonNode.attributes.URL != NULL) {
btnURL = buttonNode.attributes.URL;
btnType = buttonNode.attributes.type;
btnTrigger = buttonNode.attributes.trigger;
} else {
btnURL = "x";
btnType = "x";
}
trace(btnURL);
/* store URL data in parkButton instances
associated with elements from XML file */
if (locName == "home") {
if (btnName == "woodMan_btn") {
holder.woodMan_btn.theLocName = locName;
holder.woodMan_btn.theBtnName = btnName;
holder.woodMan_btn.itActive = true;
holder.woodMan_btn.theURL = btnURL;
holder.woodMan_btn.theType = btnType;
holder.woodman_btn.theTrigger = btnTrigger;
}
if (btnName == "office_btn") {
holder.office_btn.theLocName = locName;
holder.office_btn.theBtnName = btnName;
holder.office_btn.itActive = true;
holder.office_btn.theURL = btnURL;
holder.office_btn.theType = btnType;
holder.office_btn.theTrigger = btnTrigger;
}
if (btnName == "phone_btn") {
holder.phone_btn.theLocName = locName;
holder.phone_btn.theBtnName = btnName;
holder.phone_btn.itActive = true;
holder.phone_btn.theURL = btnURL;
holder.phone_btn.theType = btnType;
holder.phone_btn.theTrigger = btnTrigger;
}
}
if (locName == "mobile1") {
if (btnName == "mobile1_btn") {
holder.mobile1_btn.theLocName = locName;
holder.mobile1_btn.theBtnName = btnName;
holder.mobile1_btn.itActive = true;
holder.mobile1_btn.theURL = btnURL;
holder.mobile1_btn.theType = btnType;
holder.mobile1_btn.theTrigger = btnTrigger;
}
if (btnName == "copMan_btn") {
holder.copMan_btn.theLocName = locName;
holder.copMan_btn.theBtnName = btnName;
holder.copMan_btn.itActive = true;
holder.copMan_btn.theURL = btnURL;
holder.copMan_btn.theType = btnType;
holder.copMan_btn.theTrigger = btnTrigger;
}
if (btnName == "copCar_btn") {
holder.copCar_btn.theLocName = locName;
holder.copCar_btn.theBtnName = btnName;
holder.copCar_btn.itActive = true;
holder.copCar_btn.theURL = btnURL;
holder.copCar_btn.theType = btnType;
holder.copCar_btn.theTrigger = btnTrigger;
}
}
if (locName == "kracko") {
trace("setting URL data for location: " + locName + " button name:" + btnName);
if (btnName == "MTTSBlog_btn") {
trace("Setting kracko - MTTS - itActive");
holder.MTTSBlog_btn.theLocName = locName;
holder.MTTSBlog_btn.theBtnName = btnName;
holder.MTTSBlog_btn.itActive = true;
holder.MTTSBlog_btn.theURL = btnURL;
holder.MTTSBlog_btn.theType = btnType;
holder.MTTSBlog_btn.theTrigger = btnTrigger;
}
if (btnName == "kracko_btn") {
trace("Setting kracko - kracko - itActive");
holder.kracko_btn.theLocName = locName;
holder.kracko_btn.theBtnName = btnName;
holder.kracko_btn.itActive = true;
holder.kracko_btn.theURL = btnURL;
holder.kracko_btn.theType = btnType;
holder.kracko_btn.theTrigger = btnTrigger;
}
if (btnName == "hires_btn") {
holder.hires_btn.theLocName = locName;
holder.hires_btn.theBtnName = btnName;
holder.hires_btn.itActive = true;
holder.hires_btn.theURL = btnURL;
holder.hires_btn.theType = btnType;
holder.hires_btn.theTrigger = btnTrigger;
}
}
if (locName == "mobile2") {
if (btnName == "bike_btn") {
holder.bike_btn.theLocName = locName;
holder.bike_btn.theBtnName = btnName;
holder.bike_btn.itActive = true;
holder.bike_btn.theURL = btnURL;
holder.bike_btn.theType = btnType;
holder.bike_btn.theTrigger = btnTrigger;
}
if (btnName == "manDog_btn") {
holder.manDog_btn.theLocName = locName;
holder.manDog_btn.theBtnName = btnName;
holder.manDog_btn.itActive = true;
holder.manDog_btn.theURL = btnURL;
holder.manDog_btn.theType = btnType;
holder.manDog_btn.theTrigger = btnTrigger;
}
if (btnName == "mobile2_btn") {
holder.mobile2_btn.theLocName = locName;
holder.mobile2_btn.theBtnName = btnName;
holder.mobile2_btn.itActive = true;
holder.mobile2_btn.theURL = btnURL;
holder.mobile2_btn.theType = btnType;
holder.mobile2_btn.theTrigger = btnTrigger;
}
}
if (locName == "mobile345") {
if (btnName == "mobile3_btn") {
holder.mobile3_btn.theLocName = locName;
holder.mobile3_btn.theBtnName = btnName;
holder.mobile3_btn.itActive = true;
holder.mobile3_btn.theURL = btnURL;
holder.mobile3_btn.theType = btnType;
holder.mobile3_btn.theTrigger = btnTrigger;
}
if (btnName == "mobile4_btn") {
holder.mobile4_btn.theLocName = locName;
holder.mobile4_btn.theBtnName = btnName;
holder.mobile4_btn.itActive = true;
holder.mobile4_btn.theURL = btnURL;
holder.mobile4_btn.theType = btnType;
holder.mobile4_btn.theTrigger = btnTrigger;
}
if (btnName == "mobile5_btn") {
holder.mobile5_btn.theLocName = locName;
holder.mobile5_btn.theBtnName = btnName;
holder.mobile5_btn.itActive = true;
holder.mobile5_btn.theURL = btnURL;
holder.mobile5_btn.theType = btnType;
holder.mobile5_btn.theTrigger = btnTrigger;
}
}
if (locName == "mobile67") {
if (btnName == "fridge_btn") {
holder.fridge_btn.theLocName = locName;
holder.fridge_btn.theBtnName = btnName;
holder.fridge_btn.itActive = true;
holder.fridge_btn.theURL = btnURL;
holder.fridge_btn.theType = btnType;
holder.fridge_btn.theTrigger = btnTrigger;
}
if (btnName == "mobile6_btn") {
holder.mobile6_btn.theLocName = locName;
holder.mobile6_btn.theBtnName = btnName;
holder.mobile6_btn.itActive = true;
holder.mobile6_btn.theURL = btnURL;
holder.mobile6_btn.theType = btnType;
holder.mobile6_btn.theTrigger = btnTrigger;
}
if (btnName == "mobile7_btn") {
holder.mobile7_btn.theLocName = locName;
holder.mobile7_btn.theBtnName = btnName;
holder.mobile7_btn.itActive = true;
holder.mobile7_btn.theURL = btnURL;
holder.mobile7_btn.theType = btnType;
holder.mobile7_btn.theTrigger = btnTrigger;
}
}
if (locName == "mobile8") {
if (btnName == "upOnBlocks_btn") {
holder.upOnBlocks_btn.theLocName = locName;
holder.upOnBlocks.theBtnName = btnName;
holder.upOnBlocks_btn.itActive = true;
holder.upOnBlocks_btn.theURL = btnURL;
holder.upOnBlocks_btn.theType = btnType;
holder.upOnBlocks_btn.theTrigger = btnTrigger;
}
if (btnName == "woodWoman_btn") {
holder.woodWoman_btn.theLocName = locName;
holder.woodWoman_btn.theBtnName = btnName;
holder.woodWoman_btn.itActive = true;
holder.woodWoman_btn.theURL = btnURL;
holder.woodWoman_btn.theType = btnType;
holder.woodWoman_btn.theTrigger = btnTrigger;
}
if (btnName == "mobile8_btn") {
holder.mobile8_btn.theLocName = locName;
holder.mobile8_btn.theBtnName = btnName;
holder.mobile8_btn.itActive = true;
holder.mobile8_btn.theURL = btnURL;
holder.mobile8_btn.theType = btnType;
holder.mobile8_btn.theTrigger = btnTrigger;
}
}
buttonNode = buttonNode.nextSibling;
}
//=======================================
// check for more locations
trace(locationNode.attributes.label);
locationNode = locationNode.nextSibling;
// re-set button node to first in list
buttonNode = locationNode.firstChild;
}
}
function loadXMLData() {
moviList_XML = new XML();
moviList_XML.ignoreWhite = true;
moviList_XML.onLoad = xParse(moviList_XML,this);
moviList_XML.load("locations.xml");
}
loadXMLData(this);
trace("MTTSBlog_btn:" + MTTSBlog_btn.theLocName);
trace("MTTSBlog_btn:" + MTTSBlog_btn.theBtnName);
trace("MTTSBlog_btn:" + MTTSBlog_btn.itActive);
trace("MTTSBlog_btn:" + MTTSBlog_btn.theURL);
trace("MTTSBlog_btn:" + MTTSBlog_btn.theType);
trace("MTTSBlog_btn:" + MTTSBlog_btn.theTrigger);
trace("kracko_btn:" + kracko_btn.theLocName);
trace("kracko_btn:" + kracko_btn.theBtnName);
trace("kracko_btn:" + kracko_btn.itActive);
trace("kracko_btn:" + kracko_btn.theURL);
trace("kracko_btn:" + kracko_btn.theType);
trace("kracko_btn:" + kracko_btn.theTrigger);
trace("hires_btn:" + hires_btn.theLocName);
trace("hires_btn:" + hires_btn.theBtnName);
trace("hires_btn:" + hires_btn.itActive);
trace("hires_btn:" + hires_btn.theURL);
trace("hires_btn:" + hires_btn.theType);
trace("hires_btn:" + hires_btn.theTrigger);
Which returns:
Code:
Holder: _level25
MTTSBlog_btn:None
MTTSBlog_btn:None
MTTSBlog_btn:false
MTTSBlog_btn:None
MTTSBlog_btn:None
MTTSBlog_btn:release
kracko_btn:None
kracko_btn:None
kracko_btn:false
kracko_btn:None
kracko_btn:None
kracko_btn:release
hires_btn:None
hires_btn:None
hires_btn:false
hires_btn:None
hires_btn:None
hires_btn:release
These are the default settings for the properties, and these specific buttons have different values in the XML file. I can see from earlier tracing activities that the values from the XML file are returning properly, but still no luck in setting the properties of the clips to match.
Sorry to be such a pest, but I am getting desperate to solve this now so I can get back on track with this project.
Regards,
Kracko
|
|
|
08-07-2005, 08:20 PM
|
#10
|
|
Will Flash for Cash
Join Date: Jul 2005
Posts: 99
|
object list for _level25
Here is the list from the debugger
you can see they are all there...
Code:
Level #25: Frame=3 Label="home"
Shape: Mask
Shape:
Shape:
Movie Clip: Frame=1 Target="_level25.phone_btn"
Shape:
Movie Clip: Frame=1 Target="_level25.office_btn"
Shape:
Movie Clip: Frame=1 Target="_level25.woodMan_btn"
Shape:
Movie Clip: Frame=1 Target="_level25.woodMan_btn"
Shape:
Movie Clip: Frame=1 Target="_level25.office_btn"
Shape:
Movie Clip: Frame=1 Target="_level25.phone_btn"
Shape:
Movie Clip: Frame=1 Target="_level25.mobile1_btn"
Shape:
Movie Clip: Frame=1 Target="_level25.copCar_btn"
Shape:
Movie Clip: Frame=1 Target="_level25.MTTSBlog_btn"
Shape:
Movie Clip: Frame=1 Target="_level25.kracko_btn"
Shape:
Movie Clip: Frame=1 Target="_level25.hires_btn"
Shape:
Movie Clip: Frame=1 Target="_level25.bike_btn"
Shape:
Movie Clip: Frame=1 Target="_level25.manDog_btn"
Shape:
Movie Clip: Frame=1 Target="_level25.mobile2_btn"
Shape:
Movie Clip: Frame=1 Target="_level25.mobile3_btn"
Shape:
Movie Clip: Frame=1 Target="_level25.mobile4_btn"
Shape:
Movie Clip: Frame=1 Target="_level25.mobile5_btn"
Shape:
Movie Clip: Frame=1 Target="_level25.fridge_btn"
Shape:
Movie Clip: Frame=1 Target="_level25.mobile6_btn"
Shape:
Movie Clip: Frame=1 Target="_level25.mobile7_btn"
Shape:
Movie Clip: Frame=1 Target="_level25.upOnBlocks_btn"
Shape:
Movie Clip: Frame=1 Target="_level25.woodWoman_btn"
Shape:
Movie Clip: Frame=1 Target="_level25.mobile8_btn"
Shape:
|
|
|
| Thread Tools |
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT. The time now is 04:33 AM.
///
|
|