1 Replies - 5132 Views - Last Post: 17 January 2012 - 09:59 AM

#1 gregwhitworth  Icon User is offline

  • Tired.
  • member icon

Reputation: 219
  • View blog
  • Posts: 1,605
  • Joined: 20-January 09

AS3 SetXML is not a function error - GOING INSANE!

Posted 06 January 2012 - 05:12 PM

I have a flash file that I wrote about a year ago that I need to resize, of course the one that I need for some reason is throwing a trace error:

Quote

TypeError: Error #1006: SetXML is not a function.
at oil_barrels_fla::MainTimeline/frame1()


Here is the only actionscript that deals with the XML (it is embedded):

Here is the XML and the call:

var myXML:XML = <Countdown
Type="Custom"
StartNum= {-i['totalBarrels']}
Increment="0.0012"
Delay="1"
UseDate={i['xmldate']}
EndFunction="Super"
Fullscreen="false"
Width="185"
Height="200"
Format="6 . 4"
TimeZone="user"
PlaySound="false"

FlipBackColor="#ffffff"
FlipTextColor="#6a1717"
FlipTextSize="70"

TextColor="#cccccc"
TextSize="15"
TextAlign="center"

ShowShadow="false"

/>

countdown_mc.SetXML(myXML);


Here is all of the actionscript on that frame:

 //Get barrel amount from parameters
var paramObj:Object = LoaderInfo(this.root.loaderInfo).parameters;
for (barrelamount in paramObj) {
	barrelamount = paramObj[barrelamount];
}

var barrelamount; //Instantiate barrel amount
if(barrelamount == '' || barrelamount == null)
{
	barrelamount = 620000;
}
var i:Array = new Array();
i['today'] = new Date();
i['xmldate'] = i['today'].fullYear + "/01/01 00:00";
i['tdyInSec'] = i['today'].getTime()/1000; // Milleseconds / 1000 to get seconds
var tdyInSecNum:Number = Math.round(Math.abs(i['tdyInSec']));

i['strtYr'] = new Date(2011, 05, 01);
i['strtYrInSec'] = i['strtYr'].getTime()/1000; // Milleseconds / 1000 to get seconds
var strtYrInSecNum:Number = Math.round(Math.abs(i['strtYrInSec']));

i['diffSec'] = tdyInSecNum - strtYrInSecNum;
i['barrels2Subtract'] = Math.round(Math.abs(i['diffSec'] * .0012));
i['totalBarrels'] = barrelamount - i['barrels2Subtract'];


var myXML:XML = <Countdown
Type="Custom"
StartNum= {-i['totalBarrels']}
Increment="0.0012"
Delay="1"
UseDate={i['xmldate']}
EndFunction="Super"
Fullscreen="false"
Width="185"
Height="200"
Format="6 . 4"
TimeZone="user"
PlaySound="false"

FlipBackColor="#ffffff"
FlipTextColor="#6a1717"
FlipTextSize="70"

TextColor="#cccccc"
TextSize="15"
TextAlign="center"

ShowShadow="false"

/>

countdown_mc.SetXML(myXML);


Please help, thanks!

Is This A Good Question/Topic? 0
  • +

Replies To: AS3 SetXML is not a function error - GOING INSANE!

#2 chinchang  Icon User is offline

  • Indie Game Developer
  • member icon

Reputation: 192
  • View blog
  • Posts: 725
  • Joined: 22-December 08

Re: AS3 SetXML is not a function error - GOING INSANE!

Posted 17 January 2012 - 09:59 AM

And where is the SetXML function defined?
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1