Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash








My Xml Loader Class Dont Work :(


Im trying to set up a class which will load xml and return data I can later parse with a parser class.

When I run the getRawData function from the fla, I get [type function]. any ideas?


Code:
class XMLloader {

public var rawData:String;
public var setTimeout:Function;
private var _filePath:String;
private var myXML:XML;

function XMLloader(filePath:String) {
this._filePath = filePath;
this.myXML = new XML();
init();
}

private function init() {
myXML.ignoreWhite = true;
myXML.onLoad = function() {
rawData = this;
};
myXML.load(_filePath);
}

public function getRawData(){
return rawData;
}

private function toString():String{
return ("[XMLloader]")
}

}
from the fla


Code:
import XMLloader

var myXML:XMLloader = new XMLloader("test.xml");

trace(myXML.getRawData)




KirupaForum > Flash > ActionScript 1.0/2.0
Posted on: 02-20-2007, 12:51 AM


View Complete Forum Thread with Replies

Sponsored Links:

My Xml Class Dont Work :(
Im trying to set up a class which will load xml and return data I can later parse with a parser class.

When I run the getRawData function from the fla, I get [type function]. any ideas?

Code:

class XMLloader {
   
   public var rawData:String;
   public var setTimeout:Function;
   private var _filePath:String;
   private var myXML:XML;
   
   function XMLloader(filePath:String) {
      this._filePath = filePath;
      this.myXML = new XML();
      init();
   }
   
   private function init() {
      myXML.ignoreWhite = true;
      myXML.onLoad = function() {
         rawData = this;
      };
      myXML.load(_filePath);
   }
   
   public function getRawData(){
      return rawData;
   }
   
   private function toString():String{
      return ("[XMLloader]")
   }
   
}



from the fla

Code:

import XMLloader

var myXML:XMLloader = new XMLloader("test.xml");

trace(myXML.getRawData)
[/code]

View Replies !    View Related
My Xml Loader Class Don't Work :(
Im trying to set up a class which will load xml and return data I can later parse with a parser class.

When I run the getRawData function from the flaw, I get [type function]. any ideas?


Code:
class XMLloader {

public var rawData:String;
private var _filePath:String;
private var myXML:XML;

function XMLloader(filePath:String) {
this._filePath = filePath;
this.myXML = new XML();
init();
}

private function init() {
myXML.ignoreWhite = true;
myXML.onLoad = function() {
rawData = this;
};
myXML.load(_filePath);
}

public function getRawData(){
return rawData;
}

private function toString():String{
return ("[XMLloader]")
}

}
from the fla


Code:
import XMLloader

var myXML:XMLloader = new XMLloader("test.xml");

trace(myXML.getRawData)

View Replies !    View Related
[Q] Loader Not Work In Class ?
Dear all,
I would like to make the following code to a CLASS

Code:

var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoaded);
loader.load(new URLRequest("http://localhost/1.png"));
function onLoaded(e:Event):void {
addChild(loader);
}
The above code works fine,
then i make it to CLASS

Code:

package {
import flash.display.Sprite;
import flash.events.Event;
import flash.display.Loader;
import flash.net.URLRequest;

public class ABC extends Sprite {
private var loader:Loader;

public function ABC() {
this.loader = new Loader();
this.loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoaded);
this.loader.load(new URLRequest("http://localhost/1.png"));
}
function onLoaded(e:Event):void {
addChild(this.loader);
trace("OK");
}
}
}
In the FLA file:

Code:

var c:ABC = new ABC();
It can output "OK"
but the image can't be loaded on screen ??
Any body can help ??

Thanks ~~

View Replies !    View Related
Dont Understand Why This Dont Work
ok this file is from another post and workes fine as far as the movement and stopping. i tried to add a button to it but the function seems to overtake every other script in the movieclip. heres the fla. is there a workaround or am i doing this wrong?

thanks for your time!

View Replies !    View Related
Fscommands Dont Work In .swf Format :( HOW DO YOU MAKE THEM WORK
Well i tried making them work forever in swf format butit doesnt work!

So i tried windows projector it works wtf.

please help me get it to work in the .swf format

View Replies !    View Related
Hittests Work/Dont Work
Ok, I think I may know the problem. I have a movie clip called "mario_mc". THen I have a background called "background_mc". Inside I have coins, blocks, and boxes. The ONE box is called "box_mc" and the ground blocks are all called "groundBlock_mc". Now when I do:

Code:
trace (mario_mc.hitTest(background_mc.groundBlock_mc));
it says "false". But when i do :

Code:
trace (mario_mc.hitTest(background_mc.box_mc));
Is it because there is more than one ground block? The .fla is attached.

Note: Mario copyrighted of Nintendo of America.

View Replies !    View Related
I Dont Want To My Class To Extend Anything?
Hi all,

I've been struggling with this for a while and figured it would be better to seek some advice from the kirupa forums as you guys have much more knowledge of as3 than me.

I am trying to build a simple debug class so I can debug remotely on projects I create. I got my class working using the singleton pattern so that it is only instantated once and it will trace fine, but when I try to add a TextField to the stage I get errors. I can't use addChild unless the class extends a DisplayObjectContainer, but if my class extends anything it throws an error.

The basic code is below for your thoughts? thanks?


Code:
package
{
import flash.display.DisplayObjectContainer
import flash.text.TextField;

public class Debug extends DisplayObjectContainer
{
private static var VERSION:String = "0.1";
private static var _instance:Debug;// enforce singleton pattern Debug instance
private var _textField:TextField;

// static function to trace to debugger console
public static function write(args)
{
if(_instance == null)
{
_instance = new Debug(arguments.callee);
}
// output arguments
trace(arguments);
// :TODO: send the arguments to the console
}

public function Debug(caller:Function = null)
{
if(caller != Debug.write)
{
throw new Error("Debug is a singleton pattern class, use write() instead");
}
if(Debug._instance != null)
{
throw new Error("Only one Debug instance should be instantiated");
}
// initialize the console
createConsole();
}

private function createConsole():void
{
// create Debug console here
trace("*** New Debugger - " + VERSION + " ***")
// :TODO: create the textfield and console
this._textField = new TextField();
this._textField.width = 200;
this._textField.height = 200;
//addChild(this._textField);
}
}
}

View Replies !    View Related
My Pop-ups Dont Work In IE6
my pop-ups dont work in IE6. They work perfect in IE5.
Here is the code.
-----------------------------------------------------
on (release) {
getURL("javascript:NewWindow=window.open('http://www20.brinkster.com/megalo5/marie.html','newWin','width=640,height=480,left=0, top=0,toolbar=No,location=No,scrollbars=No,status= No,resizable=No,fullscreen=No'); NewWindow.focus(); setTimeout('NewWindow.resizeTo(640,480)',0); screen_height = window.screen.availHeight; screen_width = window.screen.availWidth; left_point = parseInt(screen_width/2)-(640/2); top_point = parseInt(screen_height/2)-(480/2); setTimeout('NewWindow.moveTo(left_point,top_point) ',100); void(0);");
}


--------------------------------------------------
I got the code from http://www.flash-db.com/PopUp/

The example im refering to is @ http://www20.brinkster.com/megalo5
The 3 thumbnails on my portfolio site should make popups, but not on IE6.

View Replies !    View Related
IF (Var = Something) Dont Work
HI grand master flash'es

I dont understand why this dont work:

// startframe script
myvar = "1";

// a button
if (myvar = "2") {
do something;
}

// another button
if (myvar = "1") {
then do what i want it to do;
}

View Replies !    View Related
So It Dont Work Then ?
so what your all saying then is flash cannot store localy to txt files?... even if you had flash 5 to use the magical "save" fscommand" would be pointless, cos no other player would allow it.
only people with flash 5 players.

flash cannot write to txt files... simple only communicate with scripts.

View Replies !    View Related
Get Url Dont Work HELP
on (release) {
getURL("http://www.borneogungeraad.dk", "_blank");
}


its work when im in the flash program but when i oploade it, then it wont open the page What is op with it please help me


one more thing

if i want to make a butten to open a download.
what to do then ??

View Replies !    View Related
Y Dont Dis Work Mar?
I have this code:

Code:
never mind I found it....
but it dont work. it was now its not, I pritty sure the problem is within the huge do while loop. I just can not find the problem....can ne1 see it?

also is there any way I could achive the same result as the do while loop with something smaller?

View Replies !    View Related
Certain X, Y Dont Work.
Hi,

I have a problem regarding the x, and y coordinates on a flash project of mine. Whenever I set the x and y coordinates for a movieClip:


ActionScript Code:
function setPos() {    with (mc1) {        _x = 400;        _y = 300;    }}


The MovieClip never gets sent to the proper coordinates. If anyone could help me, that would be great. Thanks.

Sincerely,





-Joman.

View Replies !    View Related
Certain X, Y Dont Work.
Hi,

I have a problem regarding the x, and y coordinates on a flash project of mine. Whenever I set the x and y coordinates for a movieClip:


ActionScript Code:
function setPos() {    with (mc1) {        _x = 400;        _y = 300;    }}


The MovieClip never gets sent to the proper coordinates. If anyone could help me, that would be great. Thanks.

Sincerely,





-Joman.

View Replies !    View Related
Why Dont This Work (newbie)
Why dont this work it just goes to frame 2 all the time

on (release) {
if (a = 100) {
gotoAndPlay (2);
} else {
gotoAndPlay (3);
}
}

View Replies !    View Related
Nope It Dont Work....
ok i thought the code would work
but i need it to be an instruction
to a particular movieclip.

for instance the code would be in a button instance
and when the button is clicked it tells the movieclip
to fade out. Thats it.

im thinking along the lines of

on (rollOut, DragOut){
with (MC1) {

//this is the part that i need help with eg the code
to make the MC fade out to nothing, i reckon theres a loop operator in here some where..

}

Please please help!!!

View Replies !    View Related
Buttons Dont Work?
I have submitted this before but I have added more info.
Here's more info on my problem. I have an electronic governor and I have 22 scenes which show the circuit board and the 22 steps that are needed to calibrate it.

To simplify this problem for trouble shooting lets say you have a ball it goes from the bottom left goes to the top then sideways and back to the bottom. (On the actual movie this is the preview of the current step. When it finishes you can go to a button to play a movie which has gauges). As it makes it way around the scene it stops and a popup with a info panel on it. On each scene you have a button togo to previous scene or the next scene. The button's have action which say

on (release) {
gotoandplay("nextscene"),1;
}
or for the other button:
on (release) {
gotoandplay("previousscene"),1;
}
I have tried nameing the scenes also that didnt make any diffrence it works fine when you have 10 or 11 scenes but when you try more when you publish it just switches the scene and freezes on frame 1 so instead of gotoandplay it gotoandstops? If you put a play action on frame one it dosnt do anything.
I have also eliminated the play movie button with the movie to simplify it but that didnt make a diffrence. This is so basic yet it doesnt work.
Any ideas? The total scene are about 12 mb's. This finished movie will be placed on a cd and not the web so Iam not worried about size. Do you know if flash has a max on scenes. If you send me a place were I can send the file you can check it out.
ALpajack

View Replies !    View Related
Functions Dont Work
I've searched for a tutorial/answer on this but can't find what I've done wrong.

I have a 2 movie clips. 'recon' has a checkbox component. If it is checked, I want a movieclip in 'stress' to go to another frame.

My comments show what I think I'm doing but the clip in 'stress' never shows up...

'recon' has this code:


Code:

//capture values of checkboxes
function setValues() {
image.setValue(image_value);
}
//convert to variables
function getResults() {
image_value = image.getValue();
}
and a gotoAndPlay(1); on the second frame, to make it keep checking.

'stress' has this code:


Code:

//if box checked, go to visible frame
if (_root.recon.image.image_value == true) {
image2.gotoAndStop(2);
} else {
image2.gotoAndStop(1);
}
and again a gotoAndPlay (1);

Hope you can help

View Replies !    View Related
_currentFrame Dont Work
hello guys
i made a button and i called it button1 and i want that when i click on it the movieclip that i made go the next frame and check if its frame11 then stop,else next frame.
i checked my code and there is no syntax errors but it doesnt work, whats wrong? the code:


Code:
button1.onPress=function(){
mcPic.nextFrame();
if(_currentFrame==11){stop}
else
mcPic.nextFrame();

}
Can anyone help me? plzz becuz it drives me nuts

View Replies !    View Related
The If Statment Dont Work....
hello everyone...
let me bother u a little with my stupid problem

i made a button that ask the movie to go to next frame and play until it stops in the 15th frame and if the current frame is 15, then it goes to the next frame but that didnt work, i attached the file and i hope that u resolve it..

anouther question:
how to make a menu like the menu in this site: http://www.teknision.com
when i hit on company it opens a new menu and it doesn`t cover the other buttons and they go down, whats the idea of this menu? i tried to make one like it but it didnt work, it covers the other buttons. i hope u will answer me......
thanx in advance

View Replies !    View Related
Buttons Dont Work
Oke this is the problem.

I'm loading a movie clip (movie name = News-ned-movie, Instance name = news-ned) in my timeline.
This movie contains a Scroll Pane (Scroll content = Movie named "news-ned").
The movie contains buttons named nieuws-ned01 / nieuws-ned05, and a code:

news01.onRelease = function () {
_root.gotoAndPlay("nieuws-ned01");
}
news02.onRelease = function () {
_root.gotoAndStop("nieuws-ned02");
}
news03.onRelease = function () {
_root.gotoAndStop("nieuws-ned03");
}
news04.onRelease = function () {
_root.gotoAndStop("nieuws-ned04");
}
news05.onRelease = function () {
_root.gotoAndStop("nieuws-ned05");
}

I hope someone can tell me what's wrong


Thanks

Joris

View Replies !    View Related
On Keypress Dont Work
hi,

have some buttons with

on (release, keyPress "<Enter>") {
go somewhere
}

but the keypress doesnt work (the release does), but dont know why. i'm using flash player 6 with AS2.0

steven.

View Replies !    View Related
I Know The Problem Dont Know The Work Around
I have main movie, i am loading this little .swf in the BG into an empty MC, but it has _root in the actionscript so it wont play. Well i need it to be in the BG cause its a rotationg BG image. So how do i get this to work? Can i change it to something other than root and keep it in the BG? it can not load on top of the main movie it must load behind. I can offer up the .fla or whatever you need to help or better understand. Thanks in advance for any help you can offer.

View Replies !    View Related
Arrays Dont Work.
Hello All. I am making an array that is supposed to tell something to text. Here is the script in Frame 1:

Code:
stop ();
var modeN:Number = 0;
var modeInfo:Array = newArray();
this.modeInfo[1] = "Adventure Mode";
this.modeInfo[2] = "Classic Mode";
this.modeInfo[3] = "Practice Mode";
this.modeInfo[4] = "Event Mode";

modeN is the number that says what mode is selected (There are 4). Then modeInfo stores the info for that mode.
In another frame there is a button that when clicked sets modeN to 3.
Then in the final frame there is this...

Code:
stop ();
text_txt.text = modeInfo[modeN];

For some reason the text box says undefinded. What am I doing wrong?

View Replies !    View Related
SendandLoad - Dont Work For IE?
I have the code below that sends a query to a PHP script every 5 seconds.
useing firefox I have absolutly no problem with this code.
But when I test it with IE I it returns "undefined" as values.
ALSO Im testing on a localhost.
I pray some one can help.

setInterval(getsv, 5000);
sendvars = new LoadVars();
receivevars = new LoadVars();

function getsv() {
sendvars.sendAndLoad("gets.php?ask_time=" + _root.ask_time ,receivevars);
}
receivevars.onLoad = function () {
// stuff.
}

View Replies !    View Related
Button Dont Work With MC
I really dont understand this. I have a OnRelease function that triggers an animation. withing that animation reveals two new buttons. First I have noticed that when the animation starts, no matter what I click (non-assigned buttons) restart my animation and my buttons dont work....
Here is the Fla if anyone can help.

Thank you.

View Replies !    View Related
[F8] Why Dont My Links Work? Please Help
ok my links work when i test the movie yet once i uplod my flash to the site everything works but the links here is the websight and also my .fla i have the latest flash media player update and i still cant view it. any help?

http://profile.myspace.com/index.cfm?fuseaction=user.viewprofile&friendid=119 55890

.fla

View Replies !    View Related
IF Statements Dont Work? Please Help...
Hi,

Im having serious problems with this, am I missing something? It reads in and XML file fine and pwearing is the correct part of the XML file, but for every time pwearing == true I want it to output pwearing but atm it outputs everytime no matter what pwearing equals, so where am I going wrong?


Code:
_xml = new XML();
_xml.ignoreWhite = true;
_xml.load("playerItems.xml");

_xml.onLoad = function(){

aNode = this.childNodes;
len = aNode.length;//do this
oArr = [];

for (var r=0; r<len; r++){

pfile = aNode[r].firstChild.nextSibling.childNodes;
pwearing = aNode[r].firstChild.nextSibling.nextSibling.nextSibling.nextSibling.childNodes;

pwearingString = pwearing.toString();

trace (pwearingString);

if(pwearingString == true){

trace (pwearingString)


}
}
};

View Replies !    View Related
AS Dont Work After Tweening.
I have a MC with the instance name "heart". In the first 20 frames i am tweening it. Not by AS but on the timeline. On frame 22 i start moving "heart" around using AS (_X and _Y) but nothing works. I have figured out that "hearts" needs to be absent for one frame before i can target it with AS after the timeline tween, what i mean is that there needs to be one keyframe without the "hearts". Is this correct? Can anyone tell me a fix for this cause i would like to be able to use timelin tweens AND AS.

View Replies !    View Related
Using [] Instead Of Eval() In AS3.. Still Dont Work
Hi,

I have a MovieClip in libary Exported as: myMC.
Now, I wanna attach it to the flash at runtime.. in AS2 this would be easy using attachMovie and eval functions. But how to do it in AS3?


ActionScript Code:
var i:Number;
var makeTotalMc:Number = 10;

for ( i=1; i<makeTotalMc; i++)
{
var addedMC[i]:myMC = new myMC();
this.addchild(addedMC[i]);
}

What am I doing wrong? Please help me with this code while I'll bang my head against the wall

View Replies !    View Related
Dont Get Why This Shouldnt Work
I have this code for my game

function PlayCards(){
cardsArray=new Array("hydrogen","helium","lithium","beryllium")
for(c=0;c<=cardsArray.length;c++){
for(i=0;i<=cardCount;i++){
cardsArray[c+i].onPress=function(){
}
}
}
}
and everytime I execute it it comes up with an error i am declaring the card count varible
any ideas?

View Replies !    View Related
_parent Dont Work~
hi all~

this is part description of _parent from Flash help:
specifies or returns a reference to the movie clip or object that contains the current movie clip or object.

it said mc or object yes ? and this is my code:

Code:
var a = new Object();
a.b = new Object();
a.b.c = new Object();
a.b.c.func = function()
{
trace(_parent);
}
a.b.c.func();
to my surprise the output is: undefined !!! what's on earth happening and how can i get parent object within that function ???

thanx~

View Replies !    View Related
My Buttons Dont Work Right
I wanted my buttons to be somewhat dynamic so I made 2 movie symbols to enhance them.

One of them is a movie symbol of a glow that pulses. I put that in the Over frame and it seemed to play well.

The other movie symbol is a pulse of rings that I wanted to have emit from the button when it is pressed, so I put that one in Hit. It does not seem to show up at all. why is this?

Also my Down graphic only stays when the button is held down with the mouse button. I figured Down would be more like a Down-State and it would stay down when pressed. Are there more advanced options to buttons besides just Up, Over, Down and Hit?

View Replies !    View Related
Flash Dont Work
hi
ive got a dell pc running windows xp with 4 login accounts,the pc is regestered to my wife,the problem i am getting is that flash works ok on my login account but will not work on the other 3 accounts,have tried uninstalling,re installing on both mine and my wifes accound but am still unable to get flash working on all 4 pc users any suggestions !

View Replies !    View Related
AS3Flex2b3StarterFiles Dont Work
When I try to load the SimpleOutputUsage.as class I get an error:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Output$iinit()
at SimpleOutputUsage$iinit()
at test_class_fla::MainTimeline/test_class_fla::frame1()

Which I think is from this line:
mainStage.addEventListener(Event.RESIZE, fitToStage);

I think mainStage is not being set correctly....
As I cannot trace in this Output.as file (local trace function overrides), I'm finding it hard to debug..

I'm thinking that the is a problem with the order the objects are constructed.. perhaps the SimpleOutputUsage class isn't passing the stage variable properly?

Can someone please advise as to how to fix the file or provide a working version.

Thanks.

View Replies !    View Related
Onkeypress Dont Work With As2.0
Is there a reason that on (keypress) style code doesnt work with as2.0, its just i'm having problems with it. it just wont work! with as1.0 my buttons work fine but as2.0 they just dont work!

View Replies !    View Related
JUST NOT RIGHT - Dont Get It? - Should Work Fine?
I have tried everything and the stupid thing just don't work.

I have an xml file with a location to a swf file. All good. I know it works fine because I have outputted it to the screen. Fine.

Ok, now I want to show this on the screen, no problem, I just did this:


ActionScript Code:
_root.createEmptyMovieClip("swfMC",1);swfMC.loadMovie("flash.swf");swfMC._y = 10;swfMC._x = 0;


Ok all is great. Now because I am loading it from the xml file, and we know it is being pulled in correctly, I tried this:


ActionScript Code:
_root.createEmptyMovieClip("swfMC",1);swfMC.loadMovie(swf);swfMC._y = 10;swfMC._x = 0;


swf is just the variable from my xml file. and nothing is being displayed, ahhhhhh what am i doing wrong here, just dont understand it?????

Please help us out here, must be something really simple, just not noticeable to me .

Cheers

View Replies !    View Related
I Dont Know How To Make It Work
I've wrote this code...


Code:
function makeTree(xmlLoad:String) {
import mx.controls.Tree;
createClassObject(Tree, "myTree", 1);
myTree.removeAll();
myTree._x = 150;
myTree.setStyle("backgroundColor", "0x00ffcc");
trace("clicked");
var trDP_xml:XML = new XML();
trDP_xml.ignoreWhite = true;
trDP_xml.onLoad = function() {
myTree.dataProvider = this.firstChild;
};
trDP_xml.load(xmlLoad);
}

dokimi.onPress = makeTree;
What i want to do is to when i press the dokimi movieclip to call the makeTree function. This script works but i cannot figure how i can pass the xmlLoad variable value to the function... If i write for example


Code:
dokimi.onPress = makeTree("lib.xml");
it doesnt works as i want it generates the tree component first and then it doesnt work anymore.

(sorry for my english)

View Replies !    View Related
Buttons Dont Work?
I have made a drop down menu and added a button to it but the button doesnt work at all I also have a hilights button which works but doesnt load text properly. altogether it is a very mess bit of work to my shame. But hey im learning. Would someone in there spare time if they dont mind have a look at what I have made and tell me where I am screwing up or if I should just kick it back to the drawing board.

http://www.softgoowything.com/buttons.zip

thanx

View Replies !    View Related
I Am Pretty Sure This Is What I Did Before But Now It Dont Work
I have a for loop

Code:
for(var i:int = 0; i<arrX.length();i++){
arrLoader = new Loader();
arrLoader.load(new URLRequest(arrX[i].@asset));
arrLoader.name = "arrH"+i
arrLoader.x = i * 200;
mainHolder.arrHolder.addChild(arrLoader);
}

// for testing purpose i added a button, i want to shift all items to the LEFT 50 pixels, but i don't want to move the container mainHolder.

button.addEventListener(MouseEvent.CLICK,clicked);
function clicked(e:MouseEvent):void{
for(var c:int = 0; c<arrX.length();c++){
mainHolder.arrHolder.arrH[c].x =+ 50;
}
}
This should be simple solution.. anyone got suggestions?

View Replies !    View Related
Onkeypress Dont Work With As2.0
Is there a reason that on (keypress) style code doesnt work with as2.0, its just i'm having problems with it. it just wont work! with as1.0 my buttons work fine but as2.0 they just dont work!

View Replies !    View Related
Why XML Dont' Work In Flash 8 ?
Last edited by Profano : 2006-04-04 at 01:22.
























Hi all.
Time ago i do a code for a simple xml>array converter. This code don't work in flash 8 (in Flash 7 work perfectly), and i don't find what's wrong. Can someone help me please?

/* ------------------------------------------------------------------------
Creo i namespace.
*/
if (_global.com == undefined) {
_global.com = new Object ();
}
if (_global.com.commoedia == undefined) {
_global.com.commoedia = new Object ();
}
if (_global.com.commoedia.Struttura == undefined) {
_global.com.commoedia.Struttura = new Object ();
}
/* ------------------------------------------------------------------------
/*
================================================
Funzione per la creazione di array da file XML
================================================

Metodo:Struttura()
Descrizione:Controlla in un nodo XML la presenza di figli
convertendola in array.

Parametri:nodo_xmlil percorso del nodo da convertire.

*/
com.commoedia.Struttura = function (link):Void {
// creato un nuovo ogetto XML.
var cont_xml:XML = new XML ();
var controlloProgresso:Function = function (xmlObj:XML):Void {
var bytesCaricati:Number = xmlObj.getBytesLoaded ();
var bytesTotali:Number = xmlObj.getBytesTotal ();
var percentualeCaricata:Number = Math.floor ((bytesCaricati / bytesTotali) * 100);
trace ("millisecondi passati : " + getTimer ());
trace ("bytes caricati : " + bytesCaricati);
trace ("bytes totali : " + bytesTotali);
trace ("percentuale : " + percentualeCaricata);
trace ("---------------------------------");
};
cont_xml.onLoad = function (success:Boolean) {
cont_xml.ignoreWhite = true;
var nodo_xml:XMLNode = this.firstChild;
trace (cont_xml);
var menuSito:Array = com.commoedia.main = new Array ();
for (var i = 0; i < nodo_xml.childNodes.length; i++) {
// Riempio l'array con i parametri dei figli.
menuSito.push (new Object ());
menuSito[i].nome = nodo_xml.childNodes[i].nodeName;
menuSito[i].link = nodo_xml.childNodes[i].firstChild.nodeValue;
// Controllo se i figli hanno a loro volta figli,
if (nodo_xml.childNodes[i].firstChild.hasChildNodes ()) {
// In questo caso creo un nuovo array.
var subMenuSito = com.commoedia[nodo_xml.childNodes[i].nodeName] = new Array ();
var elabNodo = nodo_xml.childNodes[i].childNodes;
for (var l = 0; l < elabNodo.length; l++) {
subMenuSito.push (new Object ());
subMenuSito[l].nome = elabNodo[l].nodeName;
subMenuSito[l].link = elabNodo[l].firstChild.nodeValue;
}
}
}
clearInterval (intervalloID);
trace ("intervalloID: " + intervalloID);
};
cont_xml.load (link);
var intervalloID:Number = setInterval (controlloProgresso, 100, cont_xml);
delete com.commoedia.Struttura;
};


error found...sorry

View Replies !    View Related
Buttons Dont Work In Mc
i have an mc with actions applied to it and in the mc i have several mc's with button actions applied to them. so on rollover its supposed to highlight.

the only thing is that the buttons wont work because there are on rollout actions applied to the mc that the buttons are in.

is there any way around this?

thanks!
austin

View Replies !    View Related
Anchors Dont Work In IE
Hey,

Im building a onepager flash site. The HTML contains two layers: one with flash and one with a table containing anchor points. When I use this code in flash on a button: getURL(#anchorPoint, "_self"); it works fine in Mozilla but not in IE 6. I think IE doesnt paste the #anchorPoint behind the url. Ive tried: getURL("javascript:window.location.href="index.html#anchorPoint""); but that doesnt work for both browsers. I didnt test it in other browsers yet (safari and other mac browsers)

Does anyone have a solution to do this?

Jan

View Replies !    View Related
SWFObject And IE6 Dont Work
Hi Experts,

Thx for your help on a problam I am facing:

On my site I have some flash content and in order to detect whther the user has flash loaded and working I am using swfobject.js (please see below for source).


Now I do have flash enabled, and js as well, but on my ie6 the flash movie wouldn't play and I always get the alt-content.

At the same time (same computer) I have a firefox which properly brings up the flash movies. Any ideas?

Thx a lot
Phillip

The call:


Code:

<script type="text/javascript">
// <![CDATA[
var so = new SWFObject("images/1717LS_innupFIN.swf", "1717LS_innupNO", "414", "100", "5", "#FFFFFF");
so.write("flashcontent");
// ]]>
</script>



The source:

Code:

if(typeof deconcept=="undefined"){var deconcept=new Object();}
if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}
if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}
deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a,_b){if(!document.getElementById){return;}
this.DETECT_KEY=_b?_b:"detectflash";
this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);
this.params=new Object();
this.variables=new Object();
this.attributes=new Array();
if(_1){this.setAttribute("swf",_1);}
if(id){this.setAttribute("id",id);}
if(w){this.setAttribute("width",w);}
if(h){this.setAttribute("height",h);}
if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}
this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();
if(c){this.addParam("bgcolor",c);}
var q=_8?_8:"high";
this.addParam("quality",q);
this.setAttribute("useExpressInstall",_7);
this.setAttribute("doExpressInstall",false);
var _d=(_9)?_9:window.location;
this.setAttribute("xiRedirectUrl",_d);
this.setAttribute("redirectUrl","");
if(_a){this.setAttribute("redirectUrl",_a);}};
deconcept.SWFObject.prototype={setAttribute:function(_e,_f){
this.attributes[_e]=_f;
},getAttribute:function(_10){
return this.attributes[_10];
},addParam:function(_11,_12){
this.params[_11]=_12;
},getParams:function(){
return this.params;
},addVariable:function(_13,_14){
this.variables[_13]=_14;
},getVariable:function(_15){
return this.variables[_15];
},getVariables:function(){
return this.variables;
},getVariablePairs:function(){
var _16=new Array();
var key;
var _18=this.getVariables();
for(key in _18){_16.push(key+"="+_18[key]);}
return _16;},getSWFHTML:function(){var _19="";
if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){
if(this.getAttribute("doExpressInstall")){
this.addVariable("MMplayerType","PlugIn");}
_19="<embed type="application/x-shockwave-flash" src=""+this.getAttribute("swf")+"" width=""+this.getAttribute("width")+"" height=""+this.getAttribute("height")+""";
_19+=" id=""+this.getAttribute("id")+"" name=""+this.getAttribute("id")+"" ";
var _1a=this.getParams();
for(var key in _1a){_19+=[key]+"=""+_1a[key]+"" ";}
var _1c=this.getVariablePairs().join("&");
if(_1c.length>0){_19+="flashvars=""+_1c+""";}_19+="/>";
}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");}
_19="<object id=""+this.getAttribute("id")+"" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width=""+this.getAttribute("width")+"" height=""+this.getAttribute("height")+"">";
_19+="<param name="movie" value=""+this.getAttribute("swf")+"" />";
var _1d=this.getParams();
for(var key in _1d){_19+="<param name=""+key+"" value=""+_1d[key]+"" />";}
var _1f=this.getVariablePairs().join("&");
if(_1f.length>0){_19+="<param name="flashvars" value=""+_1f+"" />";}_19+="</object>";}
return _19;
},write:function(_20){
if(this.getAttribute("useExpressInstall")){
var _21=new deconcept.PlayerVersion([6,0,65]);
if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){
this.setAttribute("doExpressInstall",true);
this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));
document.title=document.title.slice(0,47)+" - Flash Player Installation";
this.addVariable("MMdoctitle",document.title);}}
if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){
var n=(typeof _20=="string")?document.getElementById(_20):_20;
n.innerHTML=this.getSWFHTML();return true;
}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}
return false;}};
deconcept.SWFObjectUtil.getPlayerVersion=function(){
var _23=new deconcept.PlayerVersion([0,0,0]);
if(navigator.plugins&&navigator.mimeTypes.length){
var x=navigator.plugins["Shockwave Flash"];
if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|s)+/,"").replace(/(s+r|s+b[0-9]+)/,".").split("."));}
}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}
catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}
catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}
catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}
return _23;};
deconcept.PlayerVersion=function(_27){
this.major=_27[0]!=null?parseInt(_27[0]):0;
this.minor=_27[1]!=null?parseInt(_27[1]):0;
this.rev=_27[2]!=null?parseInt(_27[2]):0;
};
deconcept.PlayerVersion.prototype.versionIsValid=function(fv){
if(this.major<fv.major){return false;}
if(this.major>fv.major){return true;}
if(this.minor<fv.minor){return false;}
if(this.minor>fv.minor){return true;}
if(this.rev<fv.rev){
return false;
}return true;};
deconcept.util={getRequestParameter:function(_29){
var q=document.location.search||document.location.hash;
if(q){var _2b=q.substring(1).split("&");
for(var i=0;i<_2b.length;i++){
if(_2b[i].substring(0,_2b[i].indexOf("="))==_29){
return _2b[i].substring((_2b[i].indexOf("=")+1));}}}
return "";}};
deconcept.SWFObjectUtil.cleanupSWFs=function(){if(window.opera||!document.all){return;}
var _2d=document.getElementsByTagName("OBJECT");
for(var i=0;i<_2d.length;i++){_2d[i].style.display="none";for(var x in _2d[i]){
if(typeof _2d[i][x]=="function"){_2d[i][x]=function(){};}}}};
deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};
__flash_savedUnloadHandler=function(){};
if(typeof window.onunload=="function"){
var _30=window.onunload;
window.onunload=function(){
deconcept.SWFObjectUtil.cleanupSWFs();_30();};
}else{window.onunload=deconcept.SWFObjectUtil.cleanupSWFs;}};
if(typeof window.onbeforeunload=="function"){
var oldBeforeUnload=window.onbeforeunload;
window.onbeforeunload=function(){
deconcept.SWFObjectUtil.prepUnload();
oldBeforeUnload();};
}else{window.onbeforeunload=deconcept.SWFObjectUtil.prepUnload;}
if(Array.prototype.push==null){
Array.prototype.push=function(_31){
this[this.length]=_31;
return this.length;};}
var getQueryParamValue=deconcept.util.getRequestParameter;
var FlashObject=deconcept.SWFObject;
var SWFObject=deconcept.SWFObject;

View Replies !    View Related
Help, Levels Dont Work In Netscape
I need some urgent help, the levels which i have used in my site wont work in Netscape. I have 5 different levels loading from the one frame, i dont know if this is causing the problem or not. But it worked in IE just not Netscape.

Does anyone have any ideas? Thanks

View Replies !    View Related
Keystrokes Keypress Key Down. THEY DONT WORK
ARGH! Has anyone figured out how to get around the issue of having to click on the screen to get flash to register keystrokes? In the flashplayer app. clicking on the screen is not required, but it seems the browsers force you to click on the flash movie before any keystrokes are registered.

The old WDDG (brown site) used a keystroke "hit space to skip intro" and you didnt have to click on the screen. Hey James Baker!!! How did you do it???

/ tom ajello
Modem Media

BTW : Im launching a HUGE site in one week. Keep your eyes pealed!!!!

/ t

View Replies !    View Related
Flash MX-FSCommand Dont Work
Can somebody help with this.....
Im doing a project that needed standalone projector for macintosh.... FlashMX FS Command (Full Screen=True, Scale=False) works on a single swf file only......but when it links to another swf file, the links started to load in the upper left of the screen....can anybody help me solve this????

View Replies !    View Related
Alphatransp. And Text Dont Work?
Hi!

Testing to create a lite function that fades a copy of a textinstance. I create a new moveclip, and in this one i use createTextField to create a new textfield in this mc. Then i wanna set the _alpha to 20. But it wont work!!

This is the code:


Code:
this.fadeTextFormat = this.textArea.getTextFormat();
newMC = _root.createEmptyMovieClip("textFader",0);
newMC._x = this.textArea._x;
newMC._y = this.textArea._y+15;
newMC.createTextField("textFaderField",0,0,0,this.textArea._width,this.textArea._height)
newMC.textFaderField.setNewTextFormat(this.fadeTextFormat);
newMC.textFaderField.text = this.textArea.text;
newMC._alpha = 20;


I tested to draw a line in the same mc, and the line got faded to 20%, but not the text! Why??

-- Mike

View Replies !    View Related
Anchor Points (why Dont They Work?)
In a time line i have 4 keyframes each in intervals of 10. so one on 10,20,30 and 40 i name them all and apply a anchor to each but the back button sill dosent work once its published to an html document. anyone know why this might be?
please help i gotta hand this thing in tomorrow.
thank all.

View Replies !    View Related
Masking And Actionscript Dont Work Together
hey... i have this image which shud show in bit and pieces when i'll move the mouse over the stage... like a scratch card???... well i tried duplicating the mask on the x and y pos of the mouse... but looks like script and mask do go together... is it so??? gauree...

View Replies !    View Related
Copyright © 2005-08 www.BigResource.com, All rights reserved