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




Pre Loader - Does This Script Work With Flash 2004?



Pre loader - Does it work with Flash Mx 2004 ??


Does this script work with Flash Mx 2004 ?


totalK = getBytesTotal()/1000;
loadedK = getBytesLoaded()/1000;
remainingK = totalK-loadedK;
percentageK = (loadedK/totalK)*100;
setProperty ("bar", _xscale, percentageK);
if (loadedK>=totalK && totalK != 0) {
gotoAndPlay (3);
}



I´ve just installed and felt l a bit confused ;
Is there a way to paste the above action to
the frames ?

Actions frame panel is nothing but friendly ;
By the way I noticed that circle at every frame 1
what the meaning of that ?



KirupaForum > Flash > Flash 8 (and earlier) > Flash MX 2004
Posted on: 11-16-2003, 09:57 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Pre Loader - Does This Script Work With Flash 2004?
Pre loader - Does it work with Flash Mx 2004 ??


Does this script work with Flash Mx 2004 ?


totalK = getBytesTotal()/1000;
loadedK = getBytesLoaded()/1000;
remainingK = totalK-loadedK;
percentageK = (loadedK/totalK)*100;
setProperty ("bar", _xscale, percentageK);
if (loadedK>=totalK && totalK != 0) {
gotoAndPlay (3);
}



I´ve just installed and felt l a bit confused ;
Is there a way to paste the above action to
the frames ?

Actions frame panel is nothing but friendly ;
By the way I noticed that circle at every frame 1
what the meaning of that ?

Loader Doesnt Work In MX 2004?
Linky Thats the link to the tut, It wont work for me! Whats goin on? Error "Target not found: Target="undefined" Base="_level0" What I do wrong? Cant figure it out, maybe this script wont work for MX2004?

Loader.close Doesn't Work In Flash But Does Work In Flash Player
When testing a movie in flash with simulate download the Loader.close() function doesn't seem to work when trying to cancel a load but it does work in a browser! You'll need to try to load a movie that has sound. The loader looks as if it stops but then the sound that's in the loaded movie will play, proving it hasn't stopped loading

add a button with instance name btnCancel









Attach Code

function onClickbtnCancel(e) {
// damn thing doesn't work in Flash but works online
ldr.close();
/* this stuff isn't even needed
ldr.contentLoaderInfo.removeEventListener(Event.COMPLETE, onCompleteHandler);

for (var i:uint=0; i < container.numChildren; i++) {
if (container.getChildAt(i) is DisplayObjectContainer && container.getChildAt(i).name == "movieclip loader") {
container.removeChildAt(i);
}
}
*/
}
btnCancel.addEventListener(MouseEvent.CLICK, onClickbtnCancel);

var container = new Sprite();
var ldr = new Loader();
ldr.name = "movieclip loader";
container.addChild(ldr);
var urlReq = new URLRequest("file.swf");

function onCompleteHandler(e) {
addChild(e.currentTarget.content);
}
ldr.contentLoaderInfo.addEventListener(Event.COMPLETE, onCompleteHandler);

ldr.load(urlReq);

stop();

//--------------------On another note. Anyone know why I can't add text format styles to List components?

import fl.managers.StyleManager;

// set style for all components such as the List
var tf = new TextFormat();
tf.color = 0x000000;
tf.font = "Verdana";
tf.size = 14;
//StyleManager.setStyle("textFormat", tf); // <- this works but that's not the point
StyleManager.setComponentStyle(List, "textFormat", tf); // this works fine for a TextArea, just not a List??

























Edited: 07/11/2008 at 10:08:19 AM by Cine-Med

Where Is My Loader Bar & Streaming Testing On Flash 2004
Hello, need help :(

On Flash MX 2004:

1. I can't my loader any more. :(
2. I can't test the streaming any more. :(

What happen?
Thank you for your answer.



Robo Demo Does Not Work With Flash MX 2004
A heads up for those of you looking to purchase RoboDemo and edit movies in Flash with the FLA Module:

The FLA Module does not work with Flash MX 2004. The cursor motion tweens are misdirected for every mouse action. The FLA Module will also corrupt the import function on your system, preventing the import of movies, sound, and some images.

Macromedia just bought out robodemo, so there may be a fix in the future (no date set, and no promise that these problems will be solved), but for now, it doesn't work. The product doesn't come with any free customer support, and they won't stand behind the product (the customer support email address kicks back a 'not-received' message) - too bad, because it'd be pretty slick if the whole thing worked. just a heads up...

Flash Mx 2004 Help Panel Doesn't Work
Does anyone know why my Help panel in Flash MX 2004 will not show any information when I click on a help topic? I clicked the Update button, but it said it is up to date. I can do a search for a topic and the list of topics appears, but when I click on one nothing else shows up.
I am using Mac OS X 10.3.2
Thanks.

[Flash MX Pro 2004] I Made A Spiffy Menu, But The ActionScript Won't Work.
I made a menu in Flash MX using this tutorial and I've got all the steps done. One thing wrong with this tutorial is that it doesn't tell me how to link the buttons to another frame when I click them. I've tried the following code:

code: on (press) {
gotoAndStop(2);
}

But that doesn't work. The button is within a movie clip, so I'm guessing the Frame 2 that it is going to is the Frame 2 in the movie clip, not the one in the main Flash file. How would I code it so that it doesn't go to the Frame 2 in the movie clip, but the Frame 2 in the main Flash file?

If anyone would like to see the file where I made the menu, just ask. If you want to see the menu that I made, you can go here (the menu I am talking about is under "About").

I appreciate any help that is given.

Extension Working In Flash MX Cannot Work In Flash MX 2004
Hello,

I bought a flash extension last year which was working fine in flash MX. For your information, the flash extension was used to produce some flying effect.

However the flash extension cannot work in Flash MX 2004. The problem should be that the extension used ActionScripts 1.0 to produce the effect and Flash MX 2004 is using ActionScripts 2.0

Are there any softwares that can convert AS 1.0 to AS 2.0? If yes. Is it possible that, I used flash MX to produce a FLA file then use the software to convert AS 1.0 to AS 2.0. Or there are some other better ways to do that....

Thanks and best regards

Alex

Flash Mx 2004 Professional Action Script Help Needed To Make My Website Work
Hiya.. Im new to this website and to Flash, I've created an interactive pda before using flash 5 and it was pretty simple. But I decided to create my portfolio website in mx 2004 and have now completed all the content.

I have lots of buttons which I need to go to various frames along the timeline. I was shocked to find out 'normal' action script no longer exists and now im stuck on what to write to make it work. Can someone help me??

Loader Component (MX 2004)
Is there some sort of Timeout setting on the Loader component? It seems to randomly timeout and give me -1 for the bytesTotal when I try to load movies with actionscript. Is there a way around this?

HELP MX 2004 Loader Component
Hi there,

I'm trying to load an external swf into a loader compenent in Flash MX 2004. I've noticed on some other threads there seems to be some confusion on what this is. This component can load a jpg or swf into itself. The really cool thing is that it will load the external swf into whatever size the loader is sized to. Anyways I had it working at one point but when I lost the file I have been unable to recreate it.

Right now I have this code at the beginning of the movie:

_root.introLoader.loadMovie("intro.swf");

I have the loader named with the instance name of "introLoader". However I noticed that when you drop the component on the stage it says "mx.controls.Loader" on it. I'm confused as to whether I should reference the instance name I created or the Loader name.

Has anyone had any success using this component? I'm not sure if it came with MX 2004 or if I downloaded it as an extension.

Thanks alot!

Mx 2004 Loader Component Pc/mac Issues?
heres the problem i have. I have this script on the first frame of my fla:
I am basically loading a jpg file into a loader component in mx 2004 from a folder named thumbs, on my remote server. my .swf is in the root along with the folder containg the image. and there is a loader component in my fla library.


Code:
createClassObject(mx.controls.Loader, "loader", 0);
loader.autoLoad = true;
loader.contentPath = "/thumbs/3240.jpg";
loader.content._lockroot = true;

// Perform other tasks here and *then* start loading the file.

loader.load();
when i visit this in a browser on the mac platform it all works fine and the image loads into the component and displays fine. however on the pc the image does not show I have tested this using different browsers on the pc and this still dosent load the image. I am publishing my movie in player 7 and actionscript 2.

However on the pc if i load the image directly into my browser by putting in the path ie www.someurl.com/thumbs/3240.jpg the image shows up. Then when i return to my swf movie the image displays fine? that is, until i empty my cache and reload the page. then i get a no image again loading into my loader component.

I cant find the soloution but any help would be much appreciated! has anyone else had similar problems with the loader component?

Problem With The FlashMX 2004 Loader Component
I have a problem with the loader component in FlashMX 2004:


This is my code for the onLoadProgress method:

loader.onLoadProgress = function (targetMC, loadedBytes, totalBytes){
loaderM.percent = loadedBytes;
loaderM.status = "Loading menu0";
}


This gives my "percent text field" an updated value of how many bytes are loaded, but I want the value displayed in percent. I thought I could do it the old way:

loader.onLoadProgress = function (targetMC, loadedBytes, totalBytes){
loaderM.percent = (Math.floor (loadedBytes() / totalBytes() * 100) + "%");
loaderM.status = "Loading menu0";
}

that didn't work out to well. How can make the 'loadedBytes' into a percent value?

Problem With The FlashMX 2004 Loader Component
I have a problem with the loader component in FlashMX 2004:

loader.onLoadProgress = function (targetMC, loadedBytes, totalBytes){
loaderM.percent = (Math.floor (loadedBytes() / totalBytes() * 100) + "%");
loaderM.status = "Loading menu0";

[mx 2004] Loader Component Oncomplete Event
I am having problem with oncomplete event of loader.
This event fires before the content of the loader is actually loaded.

I tried to load a image through the loader, small images are loaded fine.
But for large images, the loader complete event is fired before actually the image is displayed.



I tried placing a delay after the oncomplete event, so that image gets rendered for displaying, but this delay would vary of large images.


Any help will be appreciated

Loader Component Content Control (Stop, Play Etc) [MX 2004, AS 2.0]
Hey everyone,

well i've made a perloader using the progress bar component + loader component. Its in event mode and it loads great. Here is the problem...

From the preloader when the loading is done, I want the user to be able to hit a button before the loaded movie plays. The Loader component automatically starts playing as the movie is loaded. How can i stop this. Here is what I tried:

Preloader Frame 1:

stop();
_root.beginButton._visible = false;
_root.introLoader._visible = false;

myLoaderListener = new Object();

myLoaderListener.complete = function(eventObject) {
_root.introLoader.content.stop();
_root.loaderClip._visible = false;
_root.galleryBar._visible = false;

_root.beginButton._visible = true;
};

_root.introLoader.addEventListener("complete", myLoaderListener);
_root.introLoader.load();

and from within the button I say:

on(press){
_root.introLoader.content.play();
}

This seems to work, however the first 30/40 frames are eaten up. The playing from the button begins near frame 42. How can I fix this? Thank you very much!

Can't Get A Pre Loader To Work?
Just got flash 8 and tried to apply a previous preloader to it. Dosen't seem to work when I preview it thou??? Have attached the file (as Flash MX)and would greatly appreciate help. Would rather have a line graphic preloader than a percentage based one but this is the only one I have.

Thanks for any help or advice!!

[F8] My Loader Should Work But...
i have a loader that uses a MC and the loading bar

Quote:




_root.stop();
var factor:Number = 100/loader._totalframes; //<--- leave this out of the loop
PercentLoaded = _root.getBytesLoaded() / _root.getBytesTotal() * 100;
if (PercentLoaded != 100) {
bar.gotoAndStop(Math.ceil(PercentLoaded/factor))
} else {
_root.gotoAndPlay("scene_2");
}




yet when i try it the loader bar does not move if asked for i can post the file.

Loader Won't Work
Hello,

I have a full action script with xml load into mc clip + a loader to load all, but the loader doesn't work. It goes from 10% to 100% even if the load is not finish. Im not real pro in action script so if someone can help me it would be great, i have tried so much to found out but no result. The loader use a x.scale and the loader bar never move and the % field either. Here's the full code :

XML.prototype.ignoreWhite = true;
_quality = "BEST";
isOk = false;
MovieClip.prototype.cacheLoad = function(url, i) {
var _l1 = i;
var _l2 = this;
if (!_l2["img"+_l1]) {
_l2.createEmptyMovieClip("img"+_l1, _l1);
var _l3 = url+"?anticache="+random(10000);
_l2["img"+_l1].loadMovie(_l3);
if (!_l2["mini_img"+_l1]) {
_l2.createEmptyMovieClip("mini_img"+_l1, _l1);
_l3 = url+"?anticache="+random(10000);
_l2["mini_img"+_l1].loadMovie(_l3);
}
// end if
}
// end if
};
_global.makeSafe = function(myData) {
var _l1 = myData;
_l1 = _l1.split("
").join("
");
xmlObj = new XML(_l1.substr(_l1.lastIndexOf("?>")+2));
xmlObj;
return (xmlObj);
};
XML.prototype.cache****Load = function(daUrl) {
var _l2 = new Date();
var _l1 = String(_l2.getTime());
if (_root._url.substr(0, 4) == "level0") {
this.load(daUrl+"?cf="+_l1.substr(0, _l1.length-4));
} else {
this.load(daUrl);
}
// end if
};
MovieClip.prototype.cache****Load = function(daUrl) {
var _l2 = new Date();
var _l1 = String(_l2.getTime());
if (_root._url.substr(0, 4) == "level0") {
this.loadMovie(daUrl+"?cf="+_l1.substr(0, _l1.length-4));
} else {
this.loadMovie(daUrl);
}
// end if
};
indexList = [4, 3, 2, 1];
selectedIndex = selectedNewIndex=4;
_global.getIndexOffset = function(aOffset) {
return ([[4, 3, 2], [1, 4, 3], [2, 1, 4], [3, 2, 1]][_root.selectedIndex-1][aOffset-1]);
};
_global.select = function(aSelectedIndex) {
var _l1 = _root;
clearInterval(_l1.selectInterval);
_l1.selectInterval = setInterval(_l1, "select2", 400, aSelectedIndex);
};
_root.select2 = function(aSelectedIndex) {
var _l1 = _root;
var _l2 = aSelectedIndex;
clearInterval(_l1.selectInterval);
if (_l1.selectedIndex == _l2) {
} else {
_l1.selectedNewIndex = _l2;
while (_l1.indexList[0] != _l2) {
_l1.indexList.unshift(_l1.indexList.pop());
}
// end while
_l1.mainMC.visuel.play();
}
// end if
};
_global.refreshImg = function() {
var _l2 = _root;
_l2.selectedLink = _l2.contentList[_l2.selectedNewIndex-1].link;
_l2.mainMC.textesMC.titles = _l2.contentList[_l2.selectedNewIndex-1].title;
_l2.mainMC.textesMC.subtitles = _l2.contentList[_l2.selectedNewIndex-1].subtitle;
var _l1 = 0;
while (_l1<4) {
var _l3 = _l2.mainMC.visuel["fenMC"+(_l1+1)].img;
_l3.loadMovie(_l2.imgList[_l2.indexList[_l1]-1]);
_l1++;
}
// end while
_l2.mainMC.visuel.play();
};
if (configXmlUrl.length<1) {
configXmlUrl = "HP_spaces.xml";
}
// end if
configXml = new XML();
configXml.onLoad = function(success) {
var _l1 = _root;
if (success) {
this = this.childNodes[0];
var imgCache = _l1.createEmptyMovieClip("imgCache", 255);
imgCache._visible = false;
imgCache._x = -1000;
_l1.imgList = [];
_l1.contentList = [];
var _l2 = 0;
while (_l2<=this.childNodes.length) {
if (this.childNodes[_l2].nodeName == "visuel") {
_l1.contentList.push({});
var node = this.childNodes[_l2];
var ii = 0;
while (ii<=node.childNodes.length) {
var _l3 = node.childNodes[ii];
switch (_l3.nodeName) {
case "title" :
_l1.contentList[_l2].title = _l3.firstChild.nodeValue;
break;
case "subtitle" :
_l1.contentList[_l2].subtitle = _l3.firstChild.nodeValue;
break;
case "link" :
_l1.contentList[_l2].link = _l3.firstChild.nodeValue;
break;
case "img" :
var imgc = imgCache.createEmptyMovieClip("img_"+_l2, _l2);
imgc.loadMovie(_l3.firstChild.nodeValue);
_l1.imgList.push(_l3.firstChild.nodeValue);
break;
case "mini_img" :
_l1.mainMC.miniMC["img"+(_l2+1)].mini_img.loadMovie(_l3.firstChild.nodeValue);
break;
}
// End of switch
ii++;
}
// end while
} else if (this.childNodes[_l2].nodeName == "coupdecoeur") {
var node = this.childNodes[_l2];
var ii = 0;
while (ii<=node.childNodes.length) {
_l3 = node.childNodes[ii];
switch (_l3.nodeName) {
case "subtitle" :
_l1.cdcMC.subtitles = _l3.firstChild.nodeValue;
break;
case "title" :
_l1.cdcMC.titles = _l3.firstChild.nodeValue;
break;
case "txt" :
_l1.cdcMC.textes = _l3.firstChild.nodeValue;
break;
case "link" :
_l1.cdcMC.link = _l3.firstChild.nodeValue;
break;
case "img" :
_l1.cdcMC.cdcfenMC.img.loadMovie(_l3.firstChild.no deValue);
break;
}
// End of switch
ii++;
}
// end while
} else {
var node = this.childNodes[_l2];
var ii = 0;
while (ii<=node.childNodes.length) {
_l3 = node.childNodes[ii];
switch (_l3.nodeName) {
case "astuce1" :
_l1.astuceMC.astuce1 = _l3.firstChild.nodeValue;
break;
case "astuce2" :
_l1.astuceMC.astuce2 = _l3.firstChild.nodeValue;
break;
case "astuce3" :
_l1.astuceMC.astuce3 = _l3.firstChild.nodeValue;
break;
}
// End of switch
ii++;
}
// end while
}
// end if
_l2++;
}
// end while
refreshImg();
}
// end if
};
_root.onEnterFrame = function() {
var _l2 = _root;
var lBytes = _l2.getBytesLoaded();
var tBytes = _l2.getBytesTotal();
var c = _l2.loader;
c.mcBarre2._xscale = Math.floor((lBytes/tBytes)*30);
c.pourcentage = Math.floor(30*(lBytes/tBytes));
if (lBytes>=tBytes && tBytes>0) {
_l2.configXml.cache****Load(_l2.configXmlUrl);
_l2.onEnterFrame = function() {
var _l2 = _root;
var bl = 0;
var _l3 = 0;
var _l1 = 0;
while (_l1<0) {
bl = bl+_l2.imgCache["img_"+_l1].getBytesLoaded();
_l3 = _l3+_l2.imgCache["img_"+_l1].getBytesTotal();
_l1++;
}
// end while
var c = _l2.loader;
c.mcBarre2._xscale = 30+Math.floor((lBytes/tBytes)*70);
c.pourcentage = 30+Math.floor(70*(lBytes/tBytes));
if (bl>=_l3 && _l3>0) {
delete _l2["onEnterFrame"];
_l2.gotoAndStop("end");
_l2.cdcMC.gotoAndPlay("go");
}
// end if
};
}
// end if
};
stop();


Thank you for your help

Loader Does Not Work
my Loader Does Not Work. i am create loader with animation. total animation are build a 100 frame.code should be write but loader does not work .Please help................











Attach Code

onClipEvent (load) {
tot_bytes = Math.round(_root.getBytesTotal());
}
onClipEvent (enterFrame) {
loaded = Math.round(_root.getBytesLoaded());
per = Math.round((loaded/tot_bytes)*100);
this.gotoAndStop(per);
}

Loader Doesn't Work, Why?
Hi guys!
I just wanted to play around with the .getBytesLoaded() and .getBytesTotal() functions... It seemed so simple, but it doesn'nt work!

The script for the download-button is:

on(press){
_root.window.createEmptyMovieClip("load_dummy",1);
_root.window.load_dummy.loadMovie("test2.jpg");
total = _root.window.load_dummy.getBytesTotal();

while(_root.window.load_dummy.getBytesLoaded() < total){
_root.textoutput.text = _root.window.load_dummy.getBytesTotal() + " Bytes";
}
_root.window.load_dummy._xscale = 5;
_root.window.load_dummy._yscale = 5;
}

Hope you can help me!

thx, borgus

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)

Pre-loader To Work Faster?
below i am using this pre-loader, which works great, but there is one problem. It takes forever to load to entire movie. The .swf is 5 mb. Is there a way that i can add something to the code or something to make the pre-loader load faster or quicker?
This is the website that i am working on.
http://www.fulfillmentcentral.com/videodemo/videodemo.html
thanks







Attach Code

//stop the play head
stop();

this.loader.gotoAndPlay(1);

//create the movie clip to hold the preloader
this.createEmptyMovieClip("preLoader_mc",1);
//put the preloader in the right spot
preLoader_mc._x = 350;
preLoader_mc._y = 200;
//create some variables for the preloader
preLoader_mc.tBytes = this.getBytesTotal();
preLoader_mc.startX = 0;
preLoader_mc.startY = 0;
//create the text field to display the information
preLoader_mc.createTextField("loader_txt",10,0,-40,200,40);
//create a text format and set some properties
var loadFormat:TextFormat = new TextFormat();
loadFormat.font="_sans";
loadFormat.bold=true;
loadFormat.size=14;
preLoader_mc.loader_txt.setNewTextFormat(loadFormat);
//this callback will run the preloader
preLoader_mc.onEnterFrame = function(){
this.clear();
//create the lineStyle
preLoader_mc.lineStyle(2,0x000000,100);
//get the amount of loaded bytes
lBytes = _root.getBytesLoaded();
//create the percentage variable
var percentLoaded:Number = Math.floor((lBytes/this.tBytes)*100);
if(lBytes != this.tBytes){

//insert the text into the text field
this.loader_txt.text="Loaded "+lBytes+" of "+this.tBytes+"
at "+percentLoaded+"%";
//start the fill
this.beginFill(0x8B5B2A,100);
//draw the loader
this.moveTo(this.startX,this.startY);
this.lineTo(this.startX,this.startY+25);
this.lineTo(this.startX+(percentLoaded*2),this.startY+25);
this.lineTo(this.startX+(percentLoaded*2),this.startY);
this.lineTo(this.startX,this.startY);
this.endFill();


}else{
//go to the second frame
_root.gotoAndPlay(2);
//remove this preloader
this.removeMovieClip();
}
}

Loader & ProgressBar Does Not Work On IE
Hello,
well, its the second time and the second day that i am looking for solution for this problem. i was looking all over for written solution, but nothing came up. so, here i go once again..
i have build a flash project where the most of the content externally loads in to the main movie. for each chapter i made a "Loader" component, and a "progressBar" connected to the "Loader". during building i was re checking that all is working well (test movie with "simulate download"). then, i was uploading it to my server and when i view it on "fireFox", or "Safari" , it all working. but, when trying to view it on "IE", i never see the "progressBar" and, all the Actions that relate to the "on (complete) {}" never happens.
If anyone knows something about this situation, please, leave me a comment, or a sign for HELP.
thanks.

Loader Does'n Work On Browser
my loader works perfecty in flash test scene ...but when i test i t on browser the loader does not work anymore.

the load_bar id on the main timeline

This is my code: addapted from the kirupa v3 gallery

Code:

MovieClip.prototype.loadPic = function(pic, id) {
info.text = "";
this._alpha = 0;
this.loadMovie(pic);
temp = this._parent.createEmptyMovieClip("temp2", 998);
temp.onEnterFrame = function() {
var t = container.getBytesTotal(), l = container.getBytesLoaded();
load_bar._visible = 1;
per = Math.round((l/t)*100);
if (Math.round(l/t) == 1 && container._width != 0 && container._height != 0) {
var w = container._width+spacing, h = container._height+spacing;
border.resizeMe(w, h, id);
load_bar._visible = 0;
delete this.onEnterFrame;
}
else{
load_bar._height = (l/t)*47;
info.info.text = per+" % loaded";
}

};
};

[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 ~~

Why Most AS Does Not Work W/ MX 2004
Actionscript.org has great resource/tutorials that are posted here but it's hard to figure out why most of the files that are posted does not work w/ Flash Player 7, AS 1 or 2. What's the deal?

[CS3] I Created A Pre-loader Now My Nav Buttons Don't Work
So, I have this web site that I've put a lot of time and energy into, so...there's a lot of info to load up for the portfolio page and to keep the user interested I created a pre-loader. I up loaded it and tested it...work fine.
The problem is now that when the portfolio page loads up initially, none of the other page links activate. The links for my work works correctly and when I go to an animation or other "work to show " link THEN go back to portfolio, the nav buttons function properly.
If anyone understands what I'm trying to say and can help I'd appreciate it.

Loader Not Allowing Buttons To Work
Ok I have a project where I have a menu that can call other .swf files and run them in a component loader and for the most part it works. It retrieves the files and plays them...however the .swf files it pulls up have dynamic text and buttons...none of which work (except two buttons in one of them for some reason). The .swf files they're pulling up work perfectly individually but not in the loader.

How do I fix this and what's causing this?

here's the simple code I'm using to call the files and put itin the loader:


ActionScript Code:
on (release) {
    loader.contentPath = "file.swf";
}

BitmapData.draw() Won't Work With Loader?
thanks for the speedy response; however, both flashdevelop and I do not know what "event.target.loader" is.

Loader.close() Seems Doesn't Work...
Hi,
this is the question:
I've a Loader I'm using in a photogallery.
It simply loads the new Picture each time I click on the next button
on the load event i put my flag _loading on true and i set it back to false on the complete event.

Casue when i click on the next button i know if my loader is loading something. I want it to stop what is actually loading and start to load the new picture. It seems this is the goal of the close() method but streams and streams are open and nothing is closed...

Does anyone have the same problem? Could you help me?
thnks.
Mariano

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)

Loader Doesn’t Work When Refresh
I’m currently using a loader that I found in this forum, it works great except when the browser is refreshed or your hit the back button it just sits there and it doesn’t let you see the content.

Here is the code:

this.stop();
this.loaderInfo.addEventListener (ProgressEvent.PROGRESS, PL_LOADING);
function PL_LOADING(event:rogressEvent):void
{
var pcent:Number=event.bytesLoaded/event.bytesTotal*100;
bar_mc.scaleX=pcent/100;

textBox.text=int(pcent)+"%";

if(pcent==100){
this.gotoAndStop(2);
}
}

As always, thank you very much.
fs_tigre

My Image Loader Doesn't Work
So I'm trying to preload some thumbnails for my gallery like so, but somestimes, the loaders stop working and just freeze, I'm preloading a total of 118 thumbnails, I have no idea why it isn't workin, any ideas?


Code:

// this loads five xml files, each contain links to images
for each(var element:String in r.galleryNameXML.*..link){
urlLoader = new URLLoader();
urlLoader.addEventListener(Event.COMPLETE,xmlLoaded);
urlLoader.load(new URLRequest(element));
}

private function xmlLoaded(evt:Event):void{

evt.target.removeEventListener(Event.COMPLETE,xmlLoaded);

myXML = XML(evt.target.data);
imagesToLoad += (myXML.*..Thumb.length());
//continues to add onto the total # of images to load, total == 118 eventually

for each(var element:* in myXML.*..Thumb.@file){ //grabs links to all the thumbnails

myLoader = new Loader();
myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,imageLoaded);
myLoader.load(new URLRequest(element));
//cache images so I can load and add to stage later

}

}

private function imageLoaded(evt:Event):void{
evt.target.removeEventListener(Event.COMPLETE,imageLoaded);
imagesLoaded += 1; //when i trace imagesLoaded, it usually stops around 85 or so
}

Movieclip Loader Woes. Cant Get It To Work
Trying to get this Movieclip loader to work but all I get is:

**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 5: There is no property with the name 'onLoadStart'.
adloader.onLoadStart = function(targetMC) {

**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 12: There is no property with the name 'onLoadComplete'.
adloader.onLoadComplete = function(targetMC) {

Total ActionScript Errors: 2 Reported Errors: 2

What am I doing wrong?


ActionScript Code:
var adloader:MovieClipLoader = new MovieClipLoader();
//
adloader.loadClip("scorptest.swf", "header_mc");
//
adloader.onLoadStart = function(targetMC) {
    var loadProgress:Object = adloader.getProgress(targetMC);
    var loaded:Number = loadProgress.bytesLoaded;
    var total:Number = loadProgress.bytesTotal;
    adprogress_txt.text = loaded+" of "+total+" bytes loaded";
};
//
adloader.onLoadComplete = function(targetMC) {
    adprogress_txt.text = "";
};

Pre Loader Doesn't Work With Dynamic Jpg
Hi everyone

I have created a pretty basic animation using the loadMovie command to import a number of jpgs from a text file.

I have tried to add a preloader to the first frame of the animation (using "getBytesTotal" so that when the jpgs have loaded the loader ends and the animation begins)

The preloader works fine if I import the jpgs into the library (rather than loading them dynamically).

When I try to load the jpgs dynamically it seems like the preloader doesn't recognise them as something that it needs to load before starting the animation - the preloader disapears very quickly before the jpgs have loaded.

Is there a basic way to get the preloader to include the jpgs in its "getBytesTotal" - I'm a newbie so anything too complex will probably lose me.

MX Script Won't Work In MX 2004 (mac)
I have installed MX 2004 mac (7.0.1) and now my MX file won't publish the correct script. It works fine on MX 2004 PC. Has anyone encountered the same problem?

Will This Code Work In MX 2004?
If Port1_Btn is my instance name of my button and Portfolio1.swf is the Movie I want to load into the MC "EmptyMC" will this work?

And where would I put the prelaoder at in the Movie?



ActionScript Code:
Port1_Btn.onRelease = function(){
_root.createEmptyMovieClip('EmptyMC', 1);
EmptyMC.loadMovie("Portfolio1.swf");
loadInterval = setInterval(getLoadInfo, 200, EmptyMC);
function getLoadInfo(mc) {   
      bloaded = holder.getBytesLoaded();   
      btotal = holder.getBytesTotal();   
      if (bloaded == btotal) {       
          clearInterval(loadInterval);   
      }
}

Getting 2004 Scrollpane To Work
I was pulling my hair out trying to get the new MX 2004 Scrollpane component to work when I came across a thread on another site, here's some script as put together by ComicGeek ( a kirupa member) and some guy called whatknows off flashmx2004.com..thought it may help


ActionScript Code:
//sp scrollpane cmp on stage, 'empty' is a empty clip in librarysp.createChild("empty_mc", "spContentHolder", initObject);contents_holder = sp.spContentHolder;contents = sp_contents_holder.createEmptyMovieClip("content_mc", 5);for (var i=0; i<12; i++) {        thumb = contents.attachMovie("thumb_mc", "thumb"+i+"_mc", i, {_y:nextY});        thumb.gotoAndStop((i%2)+1);        trace(i);        nextY = contents._height;}


Ive played around and it just seems creating the child mc makes all the difference....maybe Senocular or someone could explain it ?

thanks guys

Mx 2004 On Mac Won't Work (desperate)
Hi,

I am working on the following site: www.roguepost.com

When I view the site in windows on my machines at home, it works fine (what's finished at least) but on a Mac, there seems to be all kinds of problems from jerky swf playback and jerky flv playback to mouseover not working and the media controller not working correctly for all of the clips. At least this is what the guys there (who use macs) are reporting to me.

__________________________________________________ _
Here is their email to me:

"
The main things that I am noticing is that the longer
you spend on the site (mainly in the video clip
sections) the more bogged down it gets. For example
at the beginning of the visit to the site, everything
flys in very quickly and nicely. After playing a few
clips it takes a few seconds for the page to
completely change from one to the next.

Another thing is that when I cick on a video to load
or stream, it only plays the sound automatically as
it is loading with just the black showing w/ the text.
If I hit pause and then play the video comes up.
This is not on all but more than half of the clips and
good be the way I am compressing them.

One other thing that happens is that they just won't
load anymore and the part where the seconds, and
frames are that show you how much has been loading,
says just NN:NN:NN:NN."

__________________________________________________

I would really appreciate it if some of you with Macs and windows (you'll need broadband) could take a look at the site and tell me if you are experiencing any problems with the site playback in general (jerkiness) and also with the video clips. Go to the "REEL" menu and then select "broadcast" Mousing over the thumbnails should change the video clips and clicking the play button should start and stop them. They have chosen 450kbs on teh clips so even at 256k you will have to wait a little for them to load. The second time through they are cached and should play awithout pausing and (hopefully) without being choppy.

I can't find anything on the net that addresses flv playback problems on the mac, nor have I found much on swf playback on the mac for mx2004, at least in terms of problems.

Thanks,

Jay

Getting MX Tutorial To Work In 2004
I have been trying to get a form like this one working
http://www.kirupa.com/developer/mx/components2.htm

All the things I find online, do not work and I cannot find any good examples of it working in mx 2004. The code works fine but the buttons do not send the data. What code do I need in my submit button to get this to work correctly?

Thanks, Josh

Getting 2004 Scrollpane To Work
I was pulling my hair out trying to get the new MX 2004 Scrollpane component to work when I came across a thread on another site, here's some script as put together by ComicGeek ( a kirupa member) and some guy called whatknows off flashmx2004.com..thought it may help


ActionScript Code:
//sp scrollpane cmp on stage, 'empty' is a empty clip in librarysp.createChild("empty_mc", "spContentHolder", initObject);contents_holder = sp.spContentHolder;contents = sp_contents_holder.createEmptyMovieClip("content_mc", 5);for (var i=0; i<12; i++) {        thumb = contents.attachMovie("thumb_mc", "thumb"+i+"_mc", i, {_y:nextY});        thumb.gotoAndStop((i%2)+1);        trace(i);        nextY = contents._height;}


Ive played around and it just seems creating the child mc makes all the difference....maybe Senocular or someone could explain it ?

thanks guys

Mx 2004 On Mac Won't Work (desperate)
Hi,

I am working on the following site: www.roguepost.com

When I view the site in windows on my machines at home, it works fine (what's finished at least) but on a Mac, there seems to be all kinds of problems from jerky swf playback and jerky flv playback to mouseover not working and the media controller not working correctly for all of the clips. At least this is what the guys there (who use macs) are reporting to me.

__________________________________________________ _
Here is their email to me:

"
The main things that I am noticing is that the longer
you spend on the site (mainly in the video clip
sections) the more bogged down it gets. For example
at the beginning of the visit to the site, everything
flys in very quickly and nicely. After playing a few
clips it takes a few seconds for the page to
completely change from one to the next.

Another thing is that when I cick on a video to load
or stream, it only plays the sound automatically as
it is loading with just the black showing w/ the text.
If I hit pause and then play the video comes up.
This is not on all but more than half of the clips and
good be the way I am compressing them.

One other thing that happens is that they just won't
load anymore and the part where the seconds, and
frames are that show you how much has been loading,
says just NN:NN:NN:NN."

__________________________________________________

I would really appreciate it if some of you with Macs and windows (you'll need broadband) could take a look at the site and tell me if you are experiencing any problems with the site playback in general (jerkiness) and also with the video clips. Go to the "REEL" menu and then select "broadcast" Mousing over the thumbnails should change the video clips and clicking the play button should start and stop them. They have chosen 450kbs on teh clips so even at 256k you will have to wait a little for them to load. The second time through they are cached and should play awithout pausing and (hopefully) without being choppy.

I can't find anything on the net that addresses flv playback problems on the mac, nor have I found much on swf playback on the mac for mx2004, at least in terms of problems.

Thanks,

Jay

Loader Doesnt Work ONLY When Uploaded. Ideas?
Seems to be a very strange issue. Locally when I run my index.html file the site loads fine. The second I place it on my server I get an IO error. Has anyone else run into this problem? I'm getting really frustrated.

Duplicating Loader UI Component Doesn't Work
I created a grid (5X4) by duplicating a movie clip on the stage with a "for" loop, ok?
The duplication worked fine till I putted a loader component inside that Movie Clip.
After debugging it, I saw that (in actionscript 2) the duplicated clip was dissapearing
at repositioning (when "mc._x" or "mc._y" took place) and with actionscript 1 the loader
component doesn't load at all, as we all know.

Please tell me if this is a bug (witch I don't believe) or I am doing something wrong.


Code:
rows = 4;
cols = 5;
height = 100;
width = 100;
count = 1;
Image1 = "img1.jpg";
Image2 = "img2.jpg";
Image3 = "img3.jpg";
for (var r = 1; r<=rows; r++) {
for (var c = 1; c<=cols; c++) {
count++;
name = "clip"+r+"_"+c;
_root.myClip.duplicateMovieClip(name, count);
_root[name].loader.load(_root["Image"+count]);
with (_root[name]) {
_x = c*width;
_y = r*height;
}
}
}
myClip._visible = 1;

Loader ScaleContent And Preloader Does NOT Work Online
Hello Everyone

i am truly a newbie in as2, i have test the script in local flash "Test Movie" everything was perfect, however when i try to put the files into my remote server, the getBytesLoaded()
return to "0" and getBytesTotal() return to "-1" and the loader component scaleContent=true function was not working also,until i press "F5" refresh button, then everything back to normal, i dont know what is going wrong with my script, please anyone can help me?

i am using Flash CS3, as2.0 and ie7 and the dimension of my loader is 100x100 px

this is my script:


Code:
import mx.controls.Loader;
my_ldr.scaleContent = true;

this.onEnterFrame = function() {

var total = _root.my_ldr.getBytesTotal();
var loaded = _root.my_ldr.getBytesLoaded();
var perc = Math.round((loaded/total)*100);

CheckLoaded.text = loaded;
CheckTotal.text = total;
Checkperc.text = perc;

};
my_ldr.contentPath = http://www.flash-mx.com/images/image2.jpg;
this is my screen shoot Thank You Very Much
timoru

Duplicating Loader UI Component Doesn't Work
I created a grid (5X4) by duplicating a movie clip on the stage with a "for" loop, ok?
The duplication worked fine till I putted a loader component inside that Movie Clip.
After debugging it, I saw that (in actionscript 2) the duplicated clip was dissapearing
at repositioning (when "mc._x" or "mc._y" took place) and with actionscript 1 the loader
component doesn't load at all, as we all know.

Please tell me if this is a bug (witch I don't believe) or I am doing something wrong.


Code:
rows = 4;
cols = 5;
height = 100;
width = 100;
count = 1;
Image1 = "img1.jpg";
Image2 = "img2.jpg";
Image3 = "img3.jpg";
for (var r = 1; r<=rows; r++) {
for (var c = 1; c<=cols; c++) {
count++;
name = "clip"+r+"_"+c;
_root.myClip.duplicateMovieClip(name, count);
_root[name].loader.load(_root["Image"+count]);
with (_root[name]) {
_x = c*width;
_y = r*height;
}
}
}
myClip._visible = 1;

Buttons In Main Loader Swf No Longer Work
Hi

I have a main swf file main.swf (welcome screen) that loads in one of
two swfs location1.swf, or location2.swf depending on which one the user chooses (one button for each swf).
On the timeline of the loaded swf is a button to reload the welcome screen main.swf.
When the button is clicked, main.swf (the welcome screen) reloads, but the buttons to once again
load (location1.swf, or location2.swf) no longer work.

Could it be because main.swf is loaded back into itself?

Can someone help with this please!

Regards Max

Loader Doesn't Work Well When Sound Is Added
I've had trouble with preloaders for a while now. Instead of beginning with 0% and moving up to 100%, they don't show for quite some time. When the movie is almost loaded, they suddenly show 96% to 100%, thereby not doing their job.

I took someone's successful preloader movie clip, took out their content and slowly added my own to it, checking to see what would happen. It worked fine when I had all the visual content in. However, once I put sound in the library, it no longer showed. Is there something I should do with the sound other than leaving it in the library?

Thanks

Copyright © 2005-08 www.BigResource.com, All rights reserved