Preloader Not Functioning Correctly
hi my preloader doesnt seem to be working but i dont really know why
check it out here!
http://www.liquidfists.com/portfolio/
and here is the code on the preloader page!
code: stop() msg = "main content loaded";
nFrame = function(){ _root.nextFrame() } fadeAlpha2 = function(){ this._alpha = Math.round(getPercent*100); if(this._alpha == 100){ _root.wLoaded.text = msg; setInterval(nFrame,5000) delete (this.onEnterFrame); if(_root._currentframe == 2){ clearInterval(nFrame,5000);
} } } for (i=0; i<50;++i){ _root["square"+i]._alpha = Math.round(0); _root["square"+i].speed = Math.round(5); _root["square"+i].onEnterFrame = fadeAlpha2; } bytes_loaded = Math.round(getBytesLoaded()); bytes_total = Math.round(getBytesTotal()); getPercent = bytes_loaded/bytes_total; loadedBytes = bytes_total-bytes_loaded; _root.loadBar._xscale = Math.round(getPercent*100); _root.pText.text = Math.round(getPercent*100); _root.pText.autoSize = true; _root.wLoaded.autoSize = true; _root.pText._x = Math.round(getPercent*525)
can anyone see what could be stopping the file from preloading? thanx for ur help in advance!
FlashKit > Flash Help > Flash ActionScript
Posted on: 05-12-2004, 03:38 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
GetURL Not Functioning Correctly
I have used this a billion times in flash mx 2004, but with Flash 8 it seems to be broken. I have the following on some of my buttons:
on (release){
getURL("page.html", _self)
}
What happens, however, is that a new window opens for the first button you push. After the new window is open then the buttons behave as designed. If I close that window then it will reopen a new window (just one). Same for IE 7 and Firfox.
Any thoughts? To test this go to HERE.
Edited: 01/07/2007 at 09:21:00 AM by harms239b
SWF Not Functioning Correctly In Movie Clip
Can some one help me? I've created a site in flash and I have a couple of swf being opened in movie clips. The separate swf functions fine stand alone but does not once it is called into the move clip. Does anyone have suggestions?
Thanks,
Aaron
If Statement Not Functioning Correctly With Form
Hello, I've coded this simple form in flash and I'm using an if statment to check to make sure that input is received with the form before I run my gather form function... for some reason the form is not checking my input fields and it also sends the form whether the user has entered data in or not.
Does anyone know what I'm doing wrong here?
stop();
// -------------------<send form LoadVars>------------------- \
var gatherForm:LoadVars = new LoadVars();
this.commentsTxt.wordWrap = true;
function sendForm() {
gatherForm.recipient = "me";
gatherForm.subject = "Noise Without Sound Quiz Form";
gatherForm.redirect ="http://www.noisewithoutsound.com";
gatherForm.realname = nameTxt.text;
gatherForm.email = emailTxt.text;
gatherForm.Address = addressTxt.text;
gatherForm.City = cityTxt.text;
gatherForm.State = stateTxt.text;
gatherForm.Zip = zipTxt.text;
gatherForm.Comments = commentsTxt.text;
gatherForm.send("http://www.noisewithoutsound.com/cgi-sys/formmail.pl","","POST");
}
// -------------------</send form LoadVars>------------------- \
/*_global.style.setStyle("fontFamily", "_sans");
_global.style.setStyle("fontWeight", "bold");
_global.style.setStyle("embedFonts", true);
_global.style.setStyle("fontSize", 12);
_global.style.setStyle("color", 0x3F7FBE);
*/
//--------------------<submit button AS>---------------------\
this.contactForm.submitBtn.btnLabel.autoSize = "center";
this.contactForm.submitBtn.btnLabel.text = "submit";
// onRollOver
btnSend.onRollOver = function() {
btnSend.gotoAndStop(2);
}
// onRollOut
this.btnSend.onRollOut = function() {
btnSend.gotoAndStop (1);
}
// onRelease
this.btnSend.onRelease = function() {
if (this.emailTxt.text == "" || this.addressTxt.text == "" || this.cityTxt.text == "" || this.nameTxt.text == "" || this.stateTxt.text == "" || this.zipTxt.text == "") {
gotoAndStop("error");
} else {
sendForm();
gotoAndStop("correct");
}
}
//--------------------</submit button AS>---------------------\
Loop Add Button Not Functioning Correctly
Hey all,
I have been trying to get a for loop to produce buttons based on a value.
My current code is:
var xPosition:Number = 50;
var yPosition:Number = 15;
//problem one is that "rows" is a variable from the html page the swf is
on, I have had it working on other flash programs, but unable to get it
working on this, but for the purpose of this, I can replace it with a
numeric value e.g. "3".
//but this causes the main problem, if it is set to 3, the 3rd button
only appears, if set to 2 the 2nd button only appears.
for(i=0;i<rows;i++){
_root.attachMovie("button","btn"+i,_root.getNextHighestDepth());
_root["btn"+i]._x = xPosition;
_root["btn"+i]._y = yPosition;
yPosition = yPosition + 25;
//Does anyone have any idea's for this?
Thanks in advance.
Slpixe
Loop Add Button Not Functioning Correctly
Hey all,
I have been trying to get a for loop to produce buttons based on a value.
My current code is:
var xPosition:Number = 50;
var yPosition:Number = 15;
//problem one is that "rows" is a variable from the html page the swf is
on, I have had it working on other flash programs, but unable to get it
working on this, but for the purpose of this, I can replace it with a
numeric value e.g. "3".
//but this causes the main problem, if it is set to 3, the 3rd button
only appears, if set to 2 the 2nd button only appears.
for(i=0;i<rows;i++){
_root.attachMovie("button","btn"+i,_root.getNextHighestDepth());
_root["btn"+i]._x = xPosition;
_root["btn"+i]._y = yPosition;
yPosition = yPosition + 25;
//Does anyone have any idea's for this?
Thanks in advance.
Slpixe
Preloader Not Functioning As Expexted
Hi again,
already posted this but the replies didn't work out for me. I've tried numerous approaches but none did the job.
Thingy is, I got a big swf file with lots of symbols(which are ALWAYS loaded in the first frame), so I can't put the preloader into the first two frames of my swf since it just doesn't load before the main movie. Same with different scenes within one movie.
Therefore I tried flashbax approach.
Created a separate preloader.swf with two frames. Within these two frames some small movies are displayed to show the connection is still downloading.
Actionscript for first frame:
_root.createEmptyMovieClip("wachstum", 1);
_root.wachstum.loadMovie("wachstum.swf");
if (_root.wachstum.getBytesLoaded() >= _root.wachstum.getBytesTotal());
{
_root.loadMovie("wachstum.swf");
}
Actionscript second frame:
gotoAndPlay(1);
Problems: Everytime I upload this on the server and load the site via web, there is just blank white space and the "wachstum.swf" doesn't load as expected.
If I trace _root.wachstum.getBytesLoaded() and _root.wachstum.getBytesTotal()) Flash MX returns 0 for both, which can't be true, at least for the second one.
If anyone can provide a working fla sample file I would be grateful
. I have been laborating with this bugger for two weeks now. And please don't point me to one of those preloader tutorials, the ones I've seen are not oriented practically since none of these has as much symbols as the average real life file.
Thanks for reading.
Non-functioning Preloader For Scrolling Menu
Hey thanks a bunch for checking out my problem.
Well the problem is that when these (player icons) appear they take a long time to show up, especially when its their first time loading.
THESE ARE THE ICONS:[IMG]http://www.webinkgraphics.com/root/redi2play.jpg{/IMG]
What I want to do is add a loader to it, so that before you see the icons you get a loading bar or something. I don't care even if its just a percent loaded dynamic text box. N e way it could be done would be great.
THIS IS THE EXTERNAL ACTIONSCRIPT FILE:
[code]
//---------------------------------------------------------------------------------------------
// parsing the XML of the scrolling menu item players
//---------------------------------------------------------------------------------------------
var xml:XML = new XML();
xml.ignoreWhite = true;
////////* I TRIED USING THIS PEICE OF CODE TO DO IT BUT NOTHING HAPPENS EXCEPT WHAT HAPPENS THE OLD WAY //// NOT WHAT I WANTED *//////////
var profile_xml:XML = new XML();
profile_xml.ignoreWhite=true;
xmlpercent = (profile_xml.getBytesLoaded())/(profile_xml.getBytesTotal())*100
profile_xml.onLoad = function(success){
if (success){
trace("Yup, it loads")
} else {
trace("Error loading XML file")
}
}
xml.load("icons.xml");
xml.onLoad = function()
{
var nodes = this.firstChild.childNodes;
numOfItems = nodes.length;
for(var i=0;i<numOfItems;i++)
{
toolText[i] = nodes[i].attributes.tooltip;
playlist[i] = nodes[i].attributes.playlist;
descTitle[i] = nodes[i].attributes.descTitle;
description[i] = nodes[i].attributes.description;
image[i] = nodes[i].attributes.image;
}
_level0.play();
}
//xml.load("icons.xml");
//------------ ON ROLLOVER
function over()
{
var t:MovieClip = this._parent;
var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,t._xscale,100,.5, true);
var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,t._yscale,100,.5, true);
var tiptext = this._parent.toolText;
//tooltip function
expand(tiptext);
home.tooltip._x = this._parent._x;
home.tooltip._y = this._parent._y - this._parent._height;
home.tooltip.onEnterFrame = Delegate.create(this,moveTip);
home.tooltip._alpha = 100;
}
//------------ ON ROLLOUT
function out()
{
var t:MovieClip = this._parent;
var tw:Tween = new Tween(t,"_xscale",Bounce.easeOut,t._xscale,75,1,tr ue);
var tw2:Tween = new Tween(t,"_yscale",Bounce.easeOut,t._yscale,75,1,tr ue);
//tooltip function
disappear();
delete home.tooltip.onEnterFrame;
home.tooltip._alpha = 0;
}
//------------ ON RELEASED
function released(dropDownSelection)
{
tooltip._alpha = 0;
home.titleHolder.unloadMovie("title.swf"); // ( BMCC*81 )
unloadMovie("_level5");
// sets the mp3SelectedOut var to true
mp3SelectedIn = true;
trace("mp3SelectedIn : " + mp3SelectedIn);
//creates a new var with the selection done with the dropdown Menu
var dDown = dropDownSelection;
trace("dDown = "+dDown);
//---- stops the scroll of the mp3 players menu
delete home.menuHolder.onEnterFrame;
for(var i=0;i<numOfItems;i++)
{
var t:MovieClip = home.menuHolder["item"+i];
//recording the_x and _y positions for each player
t.xPos = t._x;
t.yPos = t._y;
//setting the_x and _y "selected" coordinates for each player
if(Stage.width < 800)
{
t.destX = ((Stage.width/2 - 301)- (20*(Stage.width/2 - 345)/100) -(home.menuHolder._x));
}
else
{
t.destX = ((Stage.width/2 - 301) - 44.4 -(home.menuHolder._x));
}
//recording _xscale for each player
t.theScale = t._xscale;
//disable all mp3 player item buttons to be clicked
delete t.icon.onRollOver;
delete t.icon.onRollOut;
delete t.icon.onRelease;
if(t != this._parent && t!= dDown)
{
var tw3:Tween = new Tween(t.icon.brightness,"_alpha",Strong.easeOut,0, 50,1.5,true);
var tw4:Tween = new Tween(t.r.brightness,"_alpha",Strong.easeOut,0,50, 1.5,true);
var tw5:Tween = new Tween(lightOut,"_alpha",Strong.easeOut,0,50,1.5,tr ue);
}
else
{
if(dDown != undefined)
{
selectedItem = dDown;
trace("selectedItem = DropDown selection: "+selectedItem._name);
}
else
{
selectedItem = t;
trace("selectedItem = MP3 Menu selection: "+selectedItem._name);
}
//defines which playlist to load
myPlaylist = t.playlist;
//parse the playlist xml and load myPlaylist inside the flv player
loadPlaylist();
//load and set all the details about the selected player
inPlayerDetail();
myIndic = i;
var tw:Tween = new Tween(t,"_xscale",Strong.easeOut,t._xscale,100,1,t rue);
var tw2:Tween = new Tween(t,"_yscale",Strong.easeOut,t._yscale,100,1,t rue);
var tw3:Tween = new Tween(t,"_x",Strong.easeOut,t._x,t.destX,1,true);
var tw4:Tween = new Tween(t,"_y",Strong.easeOut,t._y,150,1,true);
var s:Object = this;
tw4.onMotionStopped = function()
{
s.onRelease = unReleased;
mp3SelectedIn = false;
trace("mp3SelectedIn = "+mp3SelectedIn);
// sets the mp3PlayerLoaded var to true
mp3PlayerLoaded = true;
trace("mp3PlayerLoaded : " + mp3PlayerLoaded);
invBrowseBack._visible = true;
}
}//end else
}// end for
};
function inPlayerDetail()
{
//---- tooltip is set to transparent
tip._alpha = 0;
// slides in the "view tracks"
if(Stage.width < 800){
var destViewTracks =(Stage.width/2 - 191) - 20*(Stage.width/2 - 345)/100;
}
else
{
var destViewTracks = Stage.width/2 - (191 + 44.4);
}
viewTracks.tween("_x",destViewTracks,.5,"easeInQua d");
viewTracks.alphaTo(100,.5,"easeOutQuad");
theTitle.text = selectedItem.descTitle;
theText.text = selectedItem.description;
theTitle.alphaTo(100,.5,"easeOutQuad");
theText.alphaTo(100,.5,"easeOutQuad");
}
//------------ ON UNRELEASED
function unReleased(whichPlayer)
{
// de-activate the invisible browseBack button
invBrowseBack._visible = false;
// sets the mp3SelectedOut var to true
mp3SelectedOut = true;
trace("mp3SelectedOut : " + mp3SelectedOut);
// delete the onRelease action that was set to call unReleased()
delete this.onRelease;
//unloads all the infos about the mp3 player
outPlayerDetail();
//----- determines which player do we unload
if(whichPlayer == undefined){
whichPlayer = this._parent;
} else {
whichPlayer = home.menuHolder["item"+myIndic];
}
//----- brings all the players back to the scrolling position
for(var i=0;i<numOfItems;i++)
{
var t:MovieClip = home.menuHolder["item"+i];
if(t != whichPlayer)
{
t.icon.brightness.alphaTo(0,1.5,"easeOutQuad");
t.r.brightness.alphaTo(0,1.5,"easeOutQuad");
lightOut.alphaTo(0,1.5,"easeOutQuad");
home.titleHolder.unloadMovie("title.swf"); // ( BMCC*81 )
}
else
{
t.tween("_xscale",75,1.5,"easeOutQuad");
t.tween("_yscale",75,1.5,"easeOutQuad");
t.tween("_x",t.xPos,1.5,"easeOutQuad");
t.tween("_y",t.yPos,1.5,"easeOutQuad",0,unReleased End);
home.titleHolder.loadMovie("title.swf", "_level10"); // ( BMCC*81 )
}
}
}
function unReleasedEnd()
{
trace("reactivating actions for the button after UNRELEASED");
for(var j = 0; j < numOfItems; j++)
{
var t:MovieClip = home.menuHolder["item"+j];
home.titleHolder.loadMovie("title.swf"); // ( BMCC*81 )
t.icon.onRollOver = Delegate.create(t.icon,over);
t.icon.onRollOut = Delegate.create(t.icon,out);
t.icon.onRelease = Delegate.create(t.icon,released);
}
home.menuHolder.onEnterFrame = mover;
// sets the mp3PlayerLoaded var to false
mp3PlayerLoaded = false;
trace("mp3PlayerLoaded : " + mp3PlayerLoaded);
// sets the mp3SelectedOut var to true
mp3SelectedOut = false;
trace("mp3SelectedOut : " + mp3SelectedOut);
// sets the selectedItem var to undefined
selectedItem = undefined;
trace ("selectedItem = "+selectedItem);
}
function outPlayerDetail()
{
//------- hides buttons for the playlist management
viewTracks.tween("_x",-300,.5,"easeInQuad");
viewTracks.alphaTo(0,.5,"easeOutQuad");
hideTracks.tween("_x",-300,.5,"easeInQuad");
hideTracks.alphaTo(0,.5,"easeOutQuad");
//--------- unloads the playlist swf
plLoader.unloadMovie();
//---- stops any playing sound
playerLoader.ns.pause(true);
playerLoader.ns.seek(0);
//---- switch off the mp3 player
playerLoader.gotoAndStop(39);
//---- makes the Title and Text of the player disappear
theTitle.alphaTo(0,.5,"easeOutQuad");
theText.alphaTo(0,.5,"easeOutQuad");
}
//------------ Moving the tooltip
function moveTip()
{
tooltip._x = _root._xmouse; //this._parent._x;
tooltip._y = 355;
}
//--------------------------------------------------------------------------------------
// FUNCTION TO MAKE THE MP3 MENU SCROLL
//--------------------------------------------------------------------------------------
function mover()
{
if(_ymouse > 250 && _ymouse < 365)
{
var xdist = _xmouse - Stage.width/2;
this._x -= xdist / 25;
}
else
{
if(_xmouse > centerX)
{
this._x -= speed;
}
else
{
this._x += speed;
}
}
if (this._x>= -600)
{
this._x = -1500;
}
if (this._x<= -1501)
{
this._x = -601;
}
//trace("my POsition = "+home.menuHolder._x);
}
//--------------------------------------------------------------------------------------
// FUNCTION TO MAKE THE MP3 MENU DISAPPEAR
//--------------------------------------------------------------------------------------
function explode()
{
// sets the mp3Exploding var to true
mp3Exploding = true;
trace("mp3Exploding : " + mp3Exploding);
//------------------------------------------------------------
//---------- if the menu of mp3 players is visible
if(playerVisible)
{
//stop the scrolling of the menu
// --- if the selectedItem is defined, we are currently viewing a player
if(mp3PlayerLoaded = true && selectedItem!= undefined)
{
// call the function that brings the player back in the menu
unReleased(selectedItem);
this.onEnterFrame = function()
{
trace("----- waiting for the selected player to unload before EXPLOSION ");
if(selectedItem == undefined){
// we are now ready to make all the menu disappear
explosion();
delete this.onEnterFrame;
}
}
}
// --- else the selectedItem is not defined, we are browsing the menu list
else
{
// we are now ready to make all the menu disappear
explosion();
}
}
//------------------------------------------------------------
//---------- else the menu of mp3 players is not visible
else
{
trace("menu of mp3 players is not visible, no explosion necessary !");
// sets the mp3Exploding var to false
mp3Exploding = false;
trace("mp3Exploding : " + mp3Exploding);
}
}
//--------------------------------------------------------------------------------------
// FUNCTION TO REMOVE THE MP3 MENU
//--------------------------------------------------------------------------------------
function explosion()
{
// initalize the counter of MP3
mp3count = 0;
trace("---- deactivating actions for the button while EXPLOSION ------");
for(var i=0;i<numOfItems;i++)
{
var t:MovieClip = home.menuHolder["item"+i];
//deactivate the buttons
delete t.icon.onRollOver;
delete t.icon.onRollOut;
delete t.icon.onRelease;
// we store the x and y position for each of the items of the menu
// to be able to bring back all the elements in place when needed.
t.xPos = t._x;
t.yPos = t._y;
// random target position
var tempNB:Number = randRange(0,1);
if(tempNB>0)
{
t.yBoom = tempNB * 1000;
}
else
{ tempNB = -1;
t.yBoom = tempNB * 1000;
}
// tweening all the players to their respective random target
t.tween("_y", t.yBoom, 0.5, "easeOutQuad", 0.05*i);
t.alphaTo(0,0.5,"easeOutExpo", 0.05*i,endExplosion);
}
}
function endExplosion()
{
mp3count++;
// if mp3count = numOfItems, all the players are out of the scene and unvisible,
if(mp3count >= numOfItems)
{
// sets the mp3Exploding var to false
mp3Exploding = false;
//sets the property of the menu to false
playerVisible = false;
trace("player visible : " + playerVisible);
trace("mp3Exploding : " + mp3Exploding);
trace("mp3 items are out of the scene and de-activated");
}
}
//-------- function to randomly choose a NB between 0 and 1
function randRange(min:Number, max:Number):Number {
var randomNum:Number = Math.floor(Math.random() * (max - min + 1)) + min;
return randomNum;
}
//--------------------------------------------------------------------------------------
// FUNCTION TO BRING BACK THE MP3 SCROLLING MENU
//--------------------------------------------------------------------------------------
function implode()
{
// sets the mp3Imploding var to true
mp3Imploding = true;
trace("mp3Imploding : " + mp3Imploding);
// initalize the counter of MP3
mp3count = 0;
//---------- if the menu of mp3 players is not visible
if(!playerVisible)
{
// brings back the mp3items at their initial state : _y = 0 , _alpha = 100;
for(var i=0;i<numOfItems;i++)
{
var t:MovieClip = home.menuHolder["item"+i];
t.tween("_y", 0, 0.5, "easeInQuad", 0.05*i);
t.alphaTo(100,0.5,"easeInQuad", 0.05*i,mp3ScrollBack);
}
}
//---------- else the menu of mp3 players is already visible
else
{
trace("menu of mp3 players is already visible, no implosion necessary !");
// sets the mp3Imploding var to false;
mp3Imploding = false;
trace("mp3Imploding : " + mp3Imploding);
}
}
function mp3ScrollBack()
{
mp3count++;
// if mp3count = numOfItems, all the players are back on the scene and visible,
if(mp3count >= numOfItems)
{
trace("---- reactivating actions for the button after IMPLOSION ------");
for(var i=0;i<numOfItems;i++)
{
// re-activating all the clicks state on the mp3 items
var t:MovieClip = home.menuHolder["item"+i];
t.icon.onRollOver = Delegate.create(t.icon,over);
t.icon.onRollOut = Delegate.create(t.icon,out);
t.icon.onRelease = Delegate.create(t.icon,released);
}
//sets the property of mp3Imploding to false
mp3Imploding = false;
//sets the property of the menu back to visible
playerVisible = true;
//re-activate the scrolling of the mp3 menu
menuHolder.onEnterFrame = mover;
trace("player visible : " + playerVisible);
trace("mp3Imploding : " + mp3Imploding);
trace("mp3 items are scrolling");
}
}
[CODE/]
Thanking you in advanced
Preloader Not Working Correctly
Howdy all,
I am working on a preloader that works completely fine when I TEST MOVIE. However, when I post, the %loaded is calculated but my TellTarget command for my red loading bar doesn't move. The index.html has a main.swf in it which loads up movies in Level 0 (replacing the main.swf) which works locally, outside of HTML, but in the Flash 5 Player.
Anyone got any tips??!
Here's the link:
http://www.ianryan.com/ibasics
Thanks in advance!
Not Returning From Preloader Correctly...
I'm having sporatic problems coming back from my preloader. It doesn't happen all the time, just with Flash5 and older Flash6 players.
Ive got a 2 frame main movie: http://www.dynamicpage.com/new/mainmovie.gif
1st I play the preloader mc, then at the end of that, I do a
with (_parent) {
nextFrame ();
}
to return control back to the parent mc. I've got a stop action both the 1st and 2nd frames. Looks like when I return back from the preloader, the action stops before the mc in the companyMovie frame gets started.
Not Returning From Preloader Correctly...
I'm having sporatic problems coming back from my preloader. It doesn't happen all the time, just with Flash5 and older Flash6 players.
Ive got a 2 frame main movie: http://www.dynamicpage.com/new/mainmovie.gif
1st I play the preloader mc, then at the end of that, I do a
with (_parent) {
nextFrame ();
}
to return control back to the parent mc. I've got a stop action both the 1st and 2nd frames of the main mc. Looks like when I return back from the preloader, the action stops before the mc in the companyMovie frame gets started.
What would make that happen? My load order is bottom up, thats why this is such a mystery to me. And why would this just be sporatic??
Preloader Not Working Correctly
Hi, I am developing a website for my interactive multimedia class. I decided to put it online. So now I decided that I need a preloader because it is rather large in size. This is the last step to completing my site. I have my preloader all set up, but it is not working correctly. First off, all I have in frame one of scene 1 is the preloader and action script. But the bandwidth profiler says that that first frame is 6581 KB, so the preloader doesn't even kick in till it's about 60% done loading the whole site. Has anyone here ever dealt with a preloader before? Thanks, Kev
Preloader Not Working Correctly - Help
I would like to know if anyone else has had this problem and how I can solve it or work around it. I recently upgraded to flash player 7. I am authoring my files in Flash MX, not Flash MX 2004. Whenever I export an SWF file with a pre-loader in it, I get a message saying that a script is causing flash player 7 to run slowly and that this may cause my computer to become unresponsive. If I click "yes" to disable the script, my movie never gets past the preloader. When I test the movie in the flash authoring environment, it works fine. What is causing this, and how can I work around it? Thanks!
Preloader Not Behaving Correctly
I am creating a website, in my main movie i have a movieclip named content_mc which gets loaded with different swf's. I am using a simple preloader when loading the different swf's to be displayed.
Here is an example of the code:
ActionScript Code:
var loadit:Loader = new Loader();
content_mc.addChild(loadit);
var contentURL:URLRequest = new URLRequest("home.swf");
loadit.load(contentURL);
loadit.contentLoaderInfo.addEventListener(Event.OPEN,showPreloader);
loadit.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,showProgress);
loadit.contentLoaderInfo.addEventListener(Event.COMPLETE,showContent);
var myPreloader:Preloader = new Preloader();
function showPreloader(event:Event):void {
content_mc.addChild(myPreloader);
myPreloader.x = 900;
myPreloader.y = 300;
}
function showProgress(event:ProgressEvent):void {
var percentLoaded:Number = event.bytesLoaded/event.bytesTotal;
myPreloader.loading_txt.text = "Loading - " + Math.round(percentLoaded * 100) + "%";
myPreloader.bar_mc.width = 131.7 * percentLoaded;
}
function showContent(event:Event):void {
content_mc.removeChild(myPreloader);
content_mc.addChild(loadit);
}
My problem is that often the swf is displayed before the preloader is finished. If i display a rather large swf (3.5mb) the swf is displayed when the preloader is around 80%.
So my thoughts were that i must have done something wrong in the calculation. Is it not correct to use Event.COMPLETE on the loader?
I hope someone can help me with this.
Thank you!
Preloader Don't Load Correctly
i got a strange thing
i made the UIloader instance of loader
and moving bar instance of preloader_mc
and when test it
loader play before the preloader complete
here is the codes which i typed
Quote:
loader.addEventListener(ProgressEvent.PROGRESS, onProgress);
loader.addEventListener(Event.COMPLETE, onComplete);
function onProgress(erogressEvent):void
{
var loaded:Number = loader.bytesLoaded;
var total:Number = loader.bytesTotal;
preloader_mc.scaleX = loaded / total;
}
function onComplete(e:Event):void
{
removeChild(preloader_mc);
removeChild(outline_mc);
}
Preloader Not Working Correctly
I'm using the preloader example from:
http://www.monkeyflash.com/flash/cre...tom_preloader/
However, it's currently playing the .swf that it's supposed to be preloading as if there was no preloader at all. As soon as the .swf loads to about 14%, it starts playing. I need it to autostart once it's loaded, but I don't know how to keep it from starting to play as soon as it's loaded enough.
I made a seperate flash file with the following code in the first frame.
var myRequest:URLRequest = new URLRequest("schilsky_embedded_semifinal_evenEnd2.s wf");
var myLoader:Loader = new Loader();
myLoader.load(myRequest);
myLoader.contentLoaderInfo.addEventListener(Event. OPEN,showPreloader);
myLoader.contentLoaderInfo.addEventListener(Progre ssEvent.PROGRESS,showProgress);
myLoader.contentLoaderInfo.addEventListener(Event. COMPLETE,showContent);
var myPreloaderreloader = new Preloader();
function showPreloader(event:Event):void {
addChild(myPreloader);
myPreloader.x = stage.stageWidth/2;
myPreloader.y = stage.stageHeight/2;
}
function showProgress(eventrogressEvent):void {
var percentLoaded:Number = event.bytesLoaded/event.bytesTotal;
myPreloader.loading_txt.text = "Loading " + Math.round(percentLoaded * 100) + " %";
myPreloader.bar_mc.width = 198 * percentLoaded;
}
function showContent(event:Event):void {
removeChild(myPreloader);
addChild(myLoader);
var myRequest:URLRequest = new URLRequest("schilsky_embedded_semifinal_evenEnd2.s wf");
var myLoader:Loader = new Loader();
myLoader.load(myRequest);
myLoader.contentLoaderInfo.addEventListener(Event. OPEN,showPreloader);
myLoader.contentLoaderInfo.addEventListener(Progre ssEvent.PROGRESS,showProgress);
myLoader.contentLoaderInfo.addEventListener(Event. COMPLETE,showContent);
var myPreloaderreloader = new Preloader();
function showPreloader(event:Event):void {
addChild(myPreloader);
myPreloader.x = stage.stageWidth/2;
myPreloader.y = stage.stageHeight/2;
}
function showProgress(eventrogressEvent):void {
var percentLoaded:Number = event.bytesLoaded/event.bytesTotal;
myPreloader.loading_txt.text = "Loading " + Math.round(percentLoaded * 100) + " %";
myPreloader.bar_mc.width = 198 * percentLoaded;
}
function showContent(event:Event):void {
removeChild(myPreloader);
addChild(myLoader);
}
I'd also love to know why a cursor doesn't show up in the message box for me. I'm using Firefx 3.0.5.
As2 External Swf Preloader Almost Working Correctly --please Help --
Hi. Sorry this is a preloader question.
My preloader works, but letters are missing from the % loaded text that is displayed. Rather than saying whatever % "loaded", it says "oadd."
In the output box it says: [type Function].
And, in the compiler errors box, it says the following:
"The class or interface 'Preloader' could not be loaded."
Code:
// create an empty movie clip
this.createEmptyMovieClip("container", this.getNextHighestDepth());
// create the MovieClipLoader Object
var mcl:MovieClipLoader = new MovieClipLoader();
// create the listener Object
var listener:Object = new Object();
// when it starts loading
listener.onLoadStart = function(mc:MovieClip)
{
mc._visible = false; // hide the movie
}
// while it's loading, grab the percentage
listener.onLoadProgress = function(mc:MovieClip, bl:Number, bt:Number)
{
var percentage = Math.round(bl / bt * 100);
// play the animation accordingly
preloader_mc.bar_mc.gotoAndStop(percentage);
// show it in the text field
preloader_mc.percentage_txt.text = percentage + "% loaded";
};
// when it finishes loading
listener.onLoadComplete = function(mc:MovieClip)
{
// remove to animation
preloader_mc.swapDepths(preloader_mc._parent.getNextHighestDepth());
preloader_mc.removeMovieClip();
}
// when the first frame bebomes available
listener.onLoadInit = function(mc:MovieClip)
{
// we're ready to interact with it
mc._visible = true;
}
// load the external file:
mcl.loadClip("MP3PlayerF8_v14.swf", container);
// add the listener to the MovieClipLoader Object
mcl.addListener(listener);
// stop the bar animation and initialize the text
preloader_mc.bar_mc.stop();
preloader_mc.percentage_txt.text = "contacting server...";
My Preloader Doesn't Work Correctly
This is the fist site I make and it doesn't seem to work very well. The main problem is that the gallery ("imagenes") is quite big and it takes some time to load, it has a preloader but it doesn't appear until 70% of the movie is loaded.
How can I make the preloader appear when I click the button to open the gallery?
My site is:
www.geocities.com/plmorell
Tnkx for the help
My Preloader Doesn't Work Correctly
This is the fist site I make and it doesn't seem to work very well. The main problem is that the gallery ("imagenes") is quite big and it takes some time to load, it has a preloader but it doesn't appear until 70% of the movie is loaded.
How can I make the preloader appear when I click the button to open the gallery?
My site is:
www.geocities.com/plmorell
Tnkx for the help
Lee's Preloader Script Not Working Correctly (with Big Swf)
Hi all,
I'm a professional graphic and web designer. I've got some experience with flash actionscripting but I'm not a professional programmer.
I've used Lee Brimelow's basic preloader script many times before and it always performed flawlessly. Great and easy script!
At the moment I'm working on a new web project. I implemented the same preloader scripts. Somehow there's some time lag on the preloader. There's nothing showing for quite a few seconds (depending on the speed of your internet connection of course) and then the preloader is bypassed very quickly. You only see my loading bars for a brief second or even less...
Check it out: http://www.pachthof.com/ [dutch site]
(be patient, the site will show up...)
The swf file is about 5Mb large.
It's like the this preloader script has some bugs with large files.
Is there anyone who knows a solution?
thanks in advance,
Bart
Here's my code:
Code:
// frame 1
// Tripled code to make three loadbars
var amountLoaded1:Number = _root.getBytesLoaded()/_root.getBytesTotal();
var amountLoaded2:Number = (_root.getBytesLoaded()/_root.getBytesTotal())/2;
var amountLoaded3:Number = (_root.getBytesLoaded()/_root.getBytesTotal())/3;
preloader1._width = amountLoaded1*905;
preloader2._width = amountLoaded2*905;
preloader3._width = amountLoaded3*905;
loadText.text = Math.round(amountLoaded1*100)+"%";
Code:
//frame 2
if (_root.getBytesLoaded() == _root.getBytesTotal()) {
nextScene();
} else {
gotoAndPlay(1);
}
Bar Preloader In External Swf Doesn't Work Correctly
Prologue:
1) what's wrong with my preloader script?
or
2) is this a known issue with MAC OS9/IE5
and
3) and how can I test preloaders when they are in external .swfs
Developing on Windows98 and Flash 5)
My preloader, (which is script taken from PeachPit Press' Macromedia Flash5 Advanced book) does the following when viewed on a 56K modem/MacOS9/IE5:
It loops several times, then proceeds to SLOWLY run the preloader bar incrementally, except that it's now godawful slow. You can view it at our test site:
http://mccay.hitchcock.org/ADL/summi...dings/joe.html
the live version seems to load just fine on a dial-up (it doesn't yet include the preloader, and makes me wonder if a preloader is necessary for this one, but I want to know what makes this happen anyway...). It is here:
http://iml.dartmouth.edu/ADL/summit/...dings/joe.html
How I built it:
I used one main .swf which contains the non-changing components and title sequence (as a MC) and several external .swfs which contain the audio and timed text which are loaded and unloaded depending on which frame you are in of the main .swf.
I used external .swfs because, it was easier to time the text to the audio, and a little bird once told me that Flash degrades audio when it's put into an MC. Plus, Flash crashed every time I tried to export a movie with 11 minutes of streaming audio!
The popup menu ("Jump to Section") is also and external .swf which is loaded into level2.
Our network is too fast for me to test this project at work (and I read that the bandwidth profiler doesn't help with external .swfs), so I must go home for a slow connection, so i can never tell until that evening if what I've done has fixed the problem. Or if it's a problem that only occurs with a limited number of OS/IE combinations (I've encountered other funny little mac issues). So any comments on a better way to test a preloader in this situation are also helpful.
Here's the object script of my preloader, in the first frame of each external .swf:
onClipEvent (enterFrame) {
if (_root._framesloaded>=_root._totalframes) {
_root.gotoAndPlay("thisMovie");
} else {
this.gotoAndStop(Math.floor((_root._framesloaded/_root._totalframes)*this._totalframes));
}
}
the preloader itself is simply a bar which has a motion tween and 20 frames, and a stop() on the last frame. Incidentally, there is also a stop() in the same frame as the preloader MC.
Thanks! Regrets for the blandness of the content. Not my choice!
Preloader Doesn't Work Correctly When Using Components
Good Morning All,
Just wondering if you have any suggestions on this:
I have built a single frame shop poll using components such as List Box, Radio Buttons and Combo Box. Upon adding a preloader it seems my preloader only shows at approx 80% loaded when testing in the preview window.
The preloader is just a scaled rectangle. I also tried using some dynamic text but this also works in the same way (shows at 80%).
Do you think it could be something to do with having to load the components ?
I have experienced something similar before when preloading an SWF with embedded fonts. I eventually got my preloader to work 100% when i removed the embed font character option. It appeared to be loading the fonts before the preloader would start.
Do you think the same is happening with my components ?
Is there any other options i'm missing ?
And finally do you have any suggestions for resetting List box, Radio buttons and Combo box back to default published settings as i want to add these features to a reset button (which currently only resets my input text fields).
My page is here (without preloader)
My Poll
Thanks in advance,
Doug
Functioning Grid
I posted this before, but got no answer. Maybe some more info is in order.
I've been unable to find any tutorials or info regarding the use of a grid. I want to define a grid not unlike one in a chess game. I want to be able to move pieces around (and ultimately save their position). However, I have no idea how to define such a grid in Actionscript. The best example I have is a connect four game I d/led as an example. The following code defines the game grid...
// connect4 jim burton mar 2002 j.b@dynamitechicken.com
// initialise the array of places on the board
// Define 2D array object of the form places[row][column]
// with properties
// x: positions x pos
// y: place's y pos
// state: (empty, red, yellow) the status of each
places = new Array(7);
for (var r = 0; r<7; r++) {
// new row
places[r] = new Array(7)
for (var k = 0; k<7; k++) {
// new column
places[r][k] = new Object()
places[r][k].x = 65+(k*50)
places[r][k].y = 85+(r*50)
places[r][k].state = "empty"
}
}
emptySpaces = 49
its pretty apparent how the Array and For loops work to create the the rows and columns. What part confuses me is "places [r][k] = 65+(k*50)" and the other line below it. Exactly what does this do?
If anyone can explain this to me, or show me a better way to establish a grid, I'd be most grateful.
Flash Not Functioning On The Mac
Pardon me if this has been explained before, but I have a site that's been tested in IE and NN down to the 4.0 level and works fine on the PC. However, on the Mac it seems to work only erratically. Some can use it with IE5, others can't.
I'm using a preloader and a passive sniffer to detect a flash 5.0 player. The site does use flash 6.0 (need a sniffer for that)
The URL is http://www.minneapolisroads.com
If anyone has an idea of what's going on please do give me a shout.
This.onLoad = Functioning?
I just discovered, and really like putting
this.onEnterFrame = function(){
MakeMagic("now");
}
on the 1st frame of a MC. Much better than onClipEvent(enterFrame){ on the outside of the MC when you have lots of duplicates of the MC, and want to make changes to all of them. yeah.
but, this.onLoad = function(){ isn't working for me like an onClipEvent(load){ should. waa.
?
[CS3] Functions Not Functioning
Can any one tell me why this don't work?
function buttonAction(buttonName:MovieClip, buttonMove:String) {
buttnName.gotoAndStop(buttonMove);
}
aboutButton.onRollOver = function() {
buttonAction(aboutButton, over);
};
Thanks
RSB
NetDebug Not Functioning
I'm trying to get one of the packaged tutorials running on our FLASH COMM SERVER, "tutorial_hello".
Initially, when testing I couldn't get anything to function because I received an error message due to the inclusion of the "#include netDebug.as". I received an error indicating the script could not be found (using V8 Pro).
I decided to comment out the include request to see how the swf would behave...well...I can connect to the server ("Net Connection success") but do not receive anything back from the server.
So, now I'm back to debugging. After reading a number of threads from others who have experienced what I'm currently going through, I found info suggesting the download of the newest version of the "FLASH REMOTING COMPONENTS". After doing so, I still get the error message. On a fluke, I decided to see if the components installed - no luck.
I've since found a Macradobia tech note explaining that V8 does not install with these tools for some reason. As a work around I have decompiled the exe containing these scripts and attempted to place them mannually in the proper directory. Still no success
ANYONE HAVE A CLUE HOW TO GET THESE TOOLS TO FUNCTION?
THANKS!
AttachMovie Not Functioning?
I am trying to write a script that attaches a loading bar when the clipListener does onLoadInit. For some reason the attachMovie action I have added does not work but the code looks correct to me.
Is there some kind of error with my code here?
Code:
Stage.align = "LT"
Stage.scaleMode = "noScale"
var clipListener:Object = new Object();
var clipLoader:MovieClipLoader = new MovieClipLoader();
clipLoader.loadClip("port.swf", this.contentMC)
clipLoader.addListener(clipListener)
clipListener.onLoadInit = function(target_mc:MovieClip){
var loadingmc:MovieClip = this.createEmptyMovieClip("loadingmc", this.getNextHighestDepth())
loadingmc.attachMovie("loader", "loadermc", 1)
loadingmc._x = 425
loadingmc._y = 325
}
clipListener.onLoadProgress = function(imageClip:MovieClip, loaded:Number, total:Number){
percent = (loaded/total)*100
var percentText:Number = Math.round(percent)
//trace(percent)
}
clipListener.onLoadComplete = function(imageClip:MovieClip){
//removeMovieClip(loadingmc)
}
Functioning .swf And No .html
I've just completed writing a sizeable program in Flash. When I publish it, I end up with an .swf file that's pretty much perfect - and an .html file that does virtually nothing at all.
The program uses a simple graphical interface to display text loaded in as xml data to the user.
If I publish using the default settings, I end up with the graphical interface visible - but none of the xml loads. If I override the default with a manually coded <param name="base"> tag to specify the absolute filepath, I end up with a file and xml which is visible on my home computer, but which disappears entirely (including the graphical interface) when I attempt to view it over the web.
I know this sounds like a security problem - but the xml files are actually stored in the same folder as the .swf and .html files themselves, so it's not a question of cross-domain problems...
Has anyone run into anything like this?
Frames Not Functioning On A Mac.
Hey guys,
so, really basic layout; been done a million times; top frame = flash navigation, bottom frame = html content.
I understand the basic concept of:
ActionScript Code:
on (release) {
getURL("home.html", "dynamic");
}
"dynamic" being the name of my lower frame. All is great on a PC, but when tested on a Mac, all of the links are dead.
Any ideas? I've browsed the site forever and have come close to answers, but not quite there yet. Any suggestions would be amazing.
http://www.audioproinc.com/dev
Combo Box Not Functioning
Hello. I'm loading a flash movie (2.swf) into a main flash container movie(main.swf). 2.swf has a combo box component that works fine independently, but when loaded into the main.swf the combo box is not functional. Is this normal combo box behavior or is there a glitch within flash? I need this combo box to work being loaded into the main.swf movie.
Thanks!
Swf Functioning Very Very Very Slow
Hi
i`m building a site that loads external swf. after i built it i started to work on the external swf. after one was finished i managed to load it, and all seem well.
a week and a half has past and i wanted to load other swfs i created. but (before i did anything) the site it self is functioning very very slowly.
i checked the size: 52.0 KB.
does anybody has any idea? or had the same problem? the only difference is the passing time, but this is aging on drugs:)
best regards
ron
Buttons Not Functioning~
I had the buttoms working but as soon as i converted them into movie clips to spice them up they don't seem to excecute the button anymore, im using the code from voetsjoba tutorial transitions between external swf's
can anyone help me out with this???
the links is www.a2-media.cjb.net
Thanks!
Site Not Functioning In IE?
I need some help!
I built this site about a year ago for a photographer. I am on a Mac, and she just recently started complaining that the site doesnt work on her PC. She says that after the home page, and page that she goes to gives her an error message? I dont have a PC to look at. Could it be something with IE7 and my Flash detection script? Any help would be GREATLY appreciated.
Cameron
http://duluthphotographer.com/
http://duluthphotographer.com/weddings.html
For Loops Not Functioning How I Want It - Help Plz
ActionScript Code:
var cityArray:Array = new Array();cityArray[0] = "southland";cityArray[1] = "otago";cityArray[2] = "westland";cityArray[3] = "sthCanterbury";cityArray[4] = "nthCanterbury";cityArray[5] = "buller";cityArray[6] = "marlborough";cityArray[7] = "nelson";cityArray[8] = "wellington";cityArray[9] = "manawatu";cityArray[10] = "hawkesbay";cityArray[11] = "taranaki";cityArray[12] = "eastCoast";cityArray[13] = "centralNorth";cityArray[14] = "bop";cityArray[15] = "waikato";cityArray[16] = "auckland";cityArray[17] = "northland";var startNumber:Number = 0;for (var createLinks:Number = 0; createLinks<cityArray.length; createLinks++) { _root.nzmap_mc[cityArray[createLinks]+"_mc"].onRelease = function() { var thisNumber:Number = _root.startNumber; trace(thisNumber); //Play Animation //_root.nthCanterbury.play(); //Disable Map //mapEnable(false); //Fade Map //fadeOut(nzmap_mc); }; _root.startNumber++;}
What have I done wrong? I'm trying to give each mc it's own number based on the name position in the array etc etc - It returns 18 for all of them when I click them one at a time.
Please Help
RemoveMovieClip Not Functioning
I am have problems with the removeMovieClip() function;
I have tried several methods to get the function to work. see below
Code:
newThis.removeMovieClip();
newThis.unloadMovie();
unloadMovie(newThis);
newThis.unloadMovie;
removeMovieClip(newThis._parent["bullet_mc"+nStoredLocation]);
none of them seemed even remotely effective.
I created the movieclip dynamically so the removeMovieClip function should work.
Below is the code for my Movie Clip
Code:
//seperates this movieclip from the parent from which it is duplicated from (now bRequestRotation)
//var bBulletActive:Boolean = new Boolean(false);
//dynamically changes the bullet velocity.(not in use)
//var nBulletVelocity:Number = new Number(5);
//a number that is set by the parent mc.
var nBulletAngle:Number;
//starting value for the timer
var nTimer:Number = new Number(0);
//timer function based on 12fps about a sec.
var nTimerMax:Number = new Number(15);
var newThis = this;
//stores the movieclips number which is also the clip's depth
var nStoredLocation;
//boolean which is activated by a parent movieclip
var bRequestRotation;
function fRequestRotation()
{
//trace("fRequestRotation Running")
//trace("Bullet: "+ newThis);
if(bRequestRotation == true)
{
//mathematical function run for the duration(AKA, the bullets movement)
if(nTimer<nTimerMax)
{ //converts degrees to radians which is handled by flash
nBulletRadian =(nBulletAngle/180)*Math.PI;
//calculates the speed
dy=(15*Math.sin(nBulletRadian));
dx=(15*Math.cos(nBulletRadian));
//pointer to this clip; moves it horizontally and vertically
newThis._x+=dx;
newThis._y+=dy;
//["bullet_mc"+nStoredLocation]
//trace("dx: "+dx +" Loaction X: "+this._x);
//trace("dy: "+dy+" Loaction Y: "+this._y);
//progresses the timer variable
nTimer++;
}
if(nTimer>nTimerMax)
{
//removes this interval
clearInterval(iRequestRotation);
//removes movieclip
newThis.removeMovieClip();
newThis.unloadMovie();
unloadMovie(newThis);
newThis.unloadMovie;
//trace("Location: "+newThis._parent["bullet_mc"+nStoredLocation])
removeMovieClip(newThis._parent["bullet_mc"+nStoredLocation]);
//setTimeout an undocument Function calls the function once after a time delay
//setTimeout(fUnloader,1000);
trace("Movie Unloaded");
}
trace(newThis);
}
}
//sets an interval that is activated on startup
var iRequestRotation = setInterval(fRequestRotation, 1000 / 12);
i've tried everything i can think of any help at all would be greatly appreciated.
[AS 2.0] RemoveMovieClip Not Functioning
I am have problems with the removeMovieClip() function;
I have tried several methods to get the function to work. see below
Code:
newThis.removeMovieClip();
newThis.unloadMovie();
unloadMovie(newThis);
newThis.unloadMovie;
removeMovieClip(newThis._parent["bullet_mc"+nStoredLocation]);
none of them seemed even remotely effective.
I created the movieclip dynamically so the removeMovieClip function should work.
Below is the code for my Movie Clip
**THERE WAS A BUG I EDITED THIS CODE POST**
Code:
//seperates this movieclip from the parent from which it is duplicated from (now bRequestRotation)
//var bBulletActive:Boolean = new Boolean(false);
//dynamically changes the bullet velocity.(not in use)
//var nBulletVelocity:Number = new Number(5);
//a number that is set by the parent mc.
var nBulletAngle : Number;
//starting value for the timer
var nTimer : Number = new Number (0);
//timer function based on 12fps about a sec.
var nTimerMax : Number = new Number (15);
var newThis = this;
//stores the movieclips number which is also the clip's depth
var nStoredLocation;
//boolean which is activated by a parent movieclip
var bRequestRotation;
function fRequestRotation ()
{
//trace("fRequestRotation Running")
//trace("Bullet: "+ newThis);
if (bRequestRotation == true)
{
//mathematical function run for the duration(AKA, the bullets movement)
if (nTimer < nTimerMax)
{
//converts degrees to radians which is handled by flash
nBulletRadian = (nBulletAngle / 180) * Math.PI;
//calculates the speed
dy = (15 * Math.sin (nBulletRadian));
dx = (15 * Math.cos (nBulletRadian));
//pointer to this clip; moves it horizontally and vertically
newThis._x += dx;
newThis._y += dy;
//["bullet_mc"+nStoredLocation]
//trace("dx: "+dx +" Loaction X: "+this._x);
//trace("dy: "+dy+" Loaction Y: "+this._y);
//progresses the timer variable
nTimer ++;
if(nTimer>nTimerMax)
{ //removes this interval
clearInterval(iRequestRotation);
//removes movieclip
newThis.removeMovieClip();
newThis.unloadMovie();
unloadMovie(newThis);
newThis.unloadMovie;
//trace("Location: "+newThis._parent["bullet_mc"+nStoredLocation])
removeMovieClip(newThis._parent["bullet_mc"+nStoredLocation]);
//setTimeout an undocument Function calls the function once after a time delay
//setTimeout(fUnloader,1000);
trace("Movie Unloaded");
}
trace(newThis);
}
}
//sets an interval that is activated on startup
var iRequestRotation = setInterval(fRequestRotation, 1000 / 12);
i've tried everything i can think of any help at all would be greatly appreciated.
AS Not Functioning In Buttons
I'm following this tutorial link . I got to about page 5 when the codes provided stopped working for me. If you look at the finished site, there's an animation for each button and the animation is detailed in the actionscript. However, I only get the "opening" animation, where all of the buttons fly into the center so that they are clickable. None of the other buttons seem to work. If you can offer any advice on how to get those navigation animations working, I'd be wonderfully pleased. I have all of the given codes in the proper places, so I'm not sure what could cause the issue. I can provide any other information that you need, as well as my .fla files. Thank you for helping with my first flash site.
Buttons Not Functioning~
I had the buttoms working but as soon as i converted them into movie clips to spice them up they don't seem to excecute the button anymore, im using the code from voetsjoba tutorial transitions between external swf's
can anyone help me out with this???
the links is www.a2-media.cjb.net
Thanks!
Function() Not Functioning
Hi,
When I try to call function from MC by using on(release) it doesn't work. Why?
Ex:
function navi(){
trace(_currentframe);
}
//========Calling from MC======
on(release){
navi();
}
//=======doesn't work=========
//========Calling from button object======
on(release){
navi();
}
//======it work=====================
WHY?
Calculation Not Functioning
Hey. . I am trying to get a simple calculation going in flash....
I have created an input text box (variable name: ageVAR) and a dynamic text box (variable name: LuckyNumVAR) on the first frame of the same layer. Also there I have put a button and in the 'action button' section my code is:
Actionscript Code:
on (release) { LuckyNumVAR = Number (ageVAR) + 2;}
however when I test the movie, rather than doing the calculation it reads
Quote:
NaN
in the dynamic text box. I cannot figure out why - does anyone have any ideas>?
OnLoad Not Functioning
i've got a tween that is supposed to occur right when the movie clip loads. If i call it with an onRelase it works...but when i call it with onLoad it just sits there...what am i doing wrong?
ActionScript Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
box_mc.onLoad = function(){
myMoving(box_mc)}
myMoving = function (anything) {
var myMove:Tween = new Tween(what, "_x", Strong.easeIn, 320, 100, .8, true);
};
My Button Is Not Functioning .. What's Wrong With Me ..?
ok here's the situation ..
i have a mainpage.swf with several other files links to it ..
every files have its own BACK button to allow the user to go back to the mainpage.swf ..
on the mainpage.swf, i embedded a looping sound to play continuously ..
my problem is ..
my BACK button is not functioning everytime i click it to go back to the mainpage.swf ..
does it because of the level i used on the actionscript ..
fyi, on the mainpage.swf .. i used this :
on (release) {
loadMovieNum("one.swf", 0);
}
to link the mainpage.swf to one.swf file ..
on the BACK button, i used :
on (release) {
loadMovieNum("mainpage.swf", 4);
}
for the sound played, i called it from external swf which is :
on (release) {
loadMovieNum("soundtrack.swf", 20);
}
pls help to clarufy my problem ..
OnEnterFrame Is Not Functioning As Expected
I have been trying to figure out what is wrong with this code that's on frame 1 of the main timeline since yesterday =>
code:
loader_mc.onEnterFrame = function(){
var loadedPercent = Math.ceil(_parent.getBytesLoaded()*100/_parent.getBytesTotal());
trace("Percent loaded => "+loadedPercent);
//Continue to load movie and move loader_mc frame according to percent loaded
this.gotoAndStop(loadedPercent);
//SWF has completed loading, fade preloader out and move playhead to "main"
if(loadedPercent >= 100){
trace("Loading completed...");
_parent.gotoAndStop("transition");
delete this.onEnterFrame;
}
}
in my movie, i have a 100 frame preloader and the preloader instance(loader_mc) is supposed to play its corresponding frames while the main movie is loading. After loading has completed, the main timeline is supposed to go to the frame labeled "transition".
However, what's happening now is that the preloader "supposedly" plays through its 100 frame sequence and goes straight to the last frame (frame 5) where all the content are. The traces are also not showing up at all...
If the FLA is required to get a better understanding of the problem, i'll gladly provide it.
thanks
Secondary Menu Not Functioning...
I have a movie clip that consists of 5 buttons at the start of the time line. If one of the buttons is hovered over it does at gotoAndPlay to active 3 more buttons.
The code below has been striped to show only the Processes button for simplicity. When I hover over processes, it does display the Processes submenu in the timeline, but none of the Sub Menu events seem to fire off.
The hand cursor does not show up when you go over the submenu items.
You can see the actual swf "Not Work" at acuform.johnswidorski.com.
Thanks, John
Code:
stop();
// trace("-" + _root.NextMenu + "-" + _root.CurrentMenu + "-");
btnProcesses.onRelease = function()
{
_root.CurrentMenu = "Processes";
_root.NextMenu = "";
_root.gotoAndPlay('Processes');
}
btnProcesses.onRollOut = function() {
_root.NextMenu = "";
gotoAndPlay('Processes');
};
btnProcesses.onRollOver = function() {
if (_root.CurrentMenu != "Processes") {
_root.NextMenu = "Processes";
gotoAndPlay('Processess');
}
};
//=================================
// Processes SubMenu Events
//=================================
btnSpinning.onRelease = function() {
_root.CurrentMenu = "Spinning";
_root.NextMenu = "";
_root.gotoAndPlay('Spinning')
};
btnMachining.onRelease = function(){
_root.CurrentMenu = "Machining";
_root.NextMenu = "";
_root.gotoAndPlay('Machining');
};
btnRoundBlanks.onRelease = function(){
_root.CurrentMenu = "Round Blank Production";
_root.NextMenu = "";
_root.gotoAndPlay('Blanks');
};
btnSpinning.onRollOut = function() {
_root.NextMenu = "";
};
btnMachining.onRollOut = function() {
_root.NextMenu = "";
};
btnRoundBlanks.onRollOut = function() {
_root.NextMenu = "";
};
btnSpinning.onRollOver = function() {
if (_root.CurrentMenu != "Spinning") {
_root.NextMenu = "Spinning";
}
};
btnMachining.onRollOver = function() {
if (_root.CurrentMenu != "Machining") {
_root.NextMenu = "Machining";
}
};
btnRoundBlanks.onRollOver = function() {
if (_root.CurrentMenu != "Round Blank Production") {
_root.NextMenu = "Round Blank Production";
}
};
[F8] GotoAndStop() Not Functioning Properly
I have a flash project where there is an introduction scene, followed by a scene which contains a simple quiz. On the quiz scene, there is a question, an input box to type the answer, a Submit button to check correctness, and a Next button, to go to the next frame which contains the next question.
On the Next button, I have the following code:
PHP Code:
on(release){
if(correct){
gotoAndStop(2);
}
}
This should take me to frame 2, which contains question 2 of the quiz. However when I test this out... it does not take me to frame 2.. it takes me to the last frame of the scene and stops, wherever the last frame is.. if there are 8 frames, it will goto and stop on frame 8. I have no idea why it is doing this. I have also tried using:
PHP Code:
gotoAndStop("quiz", 2);
Since the name of the scene is "quiz", but this does the exact same thing. I cannot use _root.gotoAndStop(2) because that will stop it on frame 2 of the previous introduction scene... does anyone have any idea why this would be happening?
Stop Functions Functioning
I want a set of functions to apply ONLY when a MovieClip is on frame 1.
If the MovieClip is on frame 2, I want to functions to stop functioning.
Here is my fla and I have no idea why what I have doesn't work!
Any help would be greatly appreciated!
thanks again guys
here's the code:
ActionScript Code:
onEnterFrame= function(){
if(toggler._currentframe==1){
controller.onRollOver=function(){
over=1
}
controller.onRollOut=function(){
over=0
}
controller.onEnterFrame= function(){
if(over && controller._alpha<100){
controller._alpha += 10
}else if(!controller.over && controller._alpha>40){
controller._alpha -=5
}
}
controller.onPress=function(){
toggler.gotoAndStop(2)
}
}
}
ClearInterval Not Functioning Properly Help
Hey all,
The problem I'm having is with fading my movieclip in and clearing it with clearInterval.
When I load my xml file my output box displays text from my xml file and the movieclip is suppose to fadeout showing my text, it does, then fade back in hiding my text, it does.
The problem is it doesn't clear and the movieclip suddenly disappears, showing the text, then fades back in again, hidding the text. Over and over and over!
I need it to clear so that I could set it up to loop to the next childNode and repeat the process.
I hope I'm making sense!
Could anyone help me on this topic!
AS code:
PHP Code:
load_xml = new XML();
load_xml.ignoreWhite = true;
load_xml.onLoad = function(success)
{
if (success)
{
process(load_xml);
}else{trace("Something is wrong, we're not opening!");}
};
//Load up the XML file into Flash
load_xml.load('images.xml');
//---Function that will be called when xml loads succesfully
//xmlDoc_xml is now a reference to the XML object where our information is stored
item_arr = new Array("img", "startdate", "enddate", "url");
function process(xmlDoc_xml)
{
for (var n = 0; n < xmlDoc_xml.firstChild.childNodes.length; n++)
{
if (xmlDoc_xml.firstChild.childNodes[n].nodeName == "promo")
{
for (var i = 0; i < xmlDoc_xml.firstChild.childNodes[n].childNodes.length; i++)
{
if (xmlDoc_xml.firstChild.childNodes[n].childNodes[i].nodeName == item_arr[i])
{
trace(xmlDoc_xml.firstChild.childNodes[n].childNodes[i].firstChild.nodeValue);
}
}
trace("Is it working " +xmlDoc_xml.firstChild.childNodes[0].childNodes[0].firstChild);
output=xmlDoc_xml.firstChild.childNodes[0].childNodes[0].firstChild;
}
//trace("Come to poppa " +xmlDoc_xml.firstChild.childNodes[n].childNodes[0].childNodes.length);
}
}
MovieClip.prototype.fade = function (endAlpha, speed) {
trace("called11");
if(this._alpha > endAlpha) speed *= -1;
this.onEnterFrame = function () {
if (Math.abs(endAlpha - this._alpha) > Math.abs(speed)) {
this._alpha += speed;
myInterval = setInterval(beginFadeOut,time());
this.clearInterval(myInterval);
} else {
this._alpha = endAlpha;
}
}
}
MovieClip.prototype.fadeIn = function(begalpha,speed){
trace("called22");
this._alpha=0;
if(this._alpha<begalpha) speed *= -1;
this.onEnterFrame=function(){
if(Math.abs(begalpha-this._alpha)>Math.abs(speed)){
this._alpha -= speed;
}else{
this._alpha=begalpha;
}
}
}
mc.fade(0,7);
function beginFadeOut() {
mc.fadeIn(100, 7);
}
function time(){
sec = ((30/5)*1000);
trace("seconds called");
return sec;
}
Anyone's help is greatly appreciated!
cbs
|