SWF Not Working Properly ONLINE >>
Hi there,
I am "slowely" getting frustrated over this problem I have encountered lately. Publishing SWFs from Flash MX 2004 seems to be very troublesome for some weeks. I have done it before and sites I made were online. But when I needed to make a change and upload the new version over the existing one the new one doesn't work! This eventhough I only removed three buttons from the old FLA.
I did this site a while ago and my skills have improved a lot, still I need the updated version working.
View the Site here... -> then click on 'ENTER'
The old version consisted of two scenes. One with the preloader and the second with the site and possibly I did have progressive/interlaced images (which I know now don't work properly in flash). The movies don't contain any fancy AS (some gotoAndPlay that's it).
I changed all this set the preloader on frame one (all in one scene) - changed all the images - yet it still doesn't work online!!!
NOTE: All versions of the site work perfectly when tested in Flash (with preloader testing).
I have tried to export in Flash player 6, 7 - AS 1.0, 2.0 and so on -- yet still no success.
The site loads and then I get a black screen, or currently it preloads to a certain percentage. When I right-click, I either get the full menu or sometimes "movie not loaded...". The path is correct and it works in all browsers when tested offline. I am pretty sure the HTML embed tags are correct but please feel free to check.
I would greatly appreciate all your help, as this problem drives me insane. This happens with other movies I had to change.
Please help me...anyone?
ActionScript.org Forums > Flash General Questions > Other Flash General Questions
Posted on: 06-20-2005, 11:18 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
External Swfs Won't Work Properly Online
Hi there,
Thanks for taking time to read this.
I have almost finished building my site and it works like a dream on my local drive. It has one main swf file that loads in other external swfs.
The problem I'm having is some of my Flash files won't load online. There are all in the same directory and the weird thing is that some of the files will load while others won't. It also tends to ignore my 'wmode transprency' when viewed on a PC?
Check it out at www.gbsquared.com
Any help would be much appreciated.
Cheers
AS 2 Button Not Working Not Working Properly
I've got a problem with a button dynamically attached to an mc within an as 2 class script. This is the button code:
ActionScript Code:
this.mc.butt.onRelease = function(){
current=true;
this._parent.checkFocus();
}
this code is inside the class constructor while current is declared at the start of the class and set to false previously in the constructor. The mc is the movieclip attached to the class and butt is the button attached to that. checkFocus is called ok but i'm confused how cos the "this._parent" should reference the "mc" movieclip but this has not got a checkFocus method on it. If i use "this._parent._parent" however, which should be correct, it does not work. I don't know what's up there. Anyway, checkFocus is here:
ActionScript Code:
public function checkFocus(){
for(var mcname:String in _root){
if(_root[mcname] instanceof Layer){
if(_root[mcname].focus==true){
//_root[mcname].gainFocus(20);
_root[mcname].loseFocus(20);
} else {
if(_root[mcname].current==true){
trace("waaahhhhh");
_root[mcname].gainFocus(20);
}
}
}
}
}
the aim of this code is to unfocus the Layer object (this is the name of the class) currently in focus, denoted by its focus attribute being true, and focus the new Layer object that has been clicked on - denoted by its current attribute being true. The currently focused layer is unfocused ok, but the new layer is not focused because, it seems, the change in the current attribute has not happened - there is no waaaaaahhhh coming up! I think this is because i am not reference it properly from within the button event. How can i reference properly from within the button? I've tried using _target and targetPath() but i'm not getting anywhere. I'm pretty sure this is the problem cos things work fine when i declare button events from outside the class, inside the fla. But i'd much rather do things dynamically within the calss if possible. Anyone got any ideas? I've been staring tooooo long at this.
My Swf Is Not Working Properly Can You Plz Help?
when i play the movie in flash by pressing the regular play button everythign plays but when i export it or test the scene and play the swf half of the sounds arent there.... is there any logical reason for this.... its never happened to me before
While() Not Working Properly
i tried following the duplicate mc tutorial, however the part on putting the code in a frame to get it to duplicate on load doesn't seem to work for me
here's my code in the frame:
stop();
amount = 5;
while(amount>0) {
duplicateMovieClip (_root.arrow, "arrow" + i, i);
i = i + 1;
amount = amount-1;
}
apparently the clip only gets duplicated once where's the problem?
XML Not Working Properly...
Hi all,
I have followed this tutorial (http://www.kirupa.com/developer/mx2004/thumbnails.htm) and got it to work the way I want. I exported this file as "Market.swf"
I uploaded the files to my server and when I go directly to Market.swf via the address bar, it plays perfectly! (at last!!).
However when I got to the main SWF and and click the link to load Market.swf it doesn't display the thumbnail or the dynamic text (both from the xml) but it does display the buttons and roll overs. This link to load Market.swf from Main.swf is correct, I've checked it 50 times.
The xml is in the same folder as the SWF's so I just used xmlData.load("images.xml"); as sepecified in the tutorial.
Does anyone know what the problem is?
Thank you.
p.s.
Sorry for the re-post but I thought this explanation was a little clearer, I tried to delete the old thread but I couldn't.
CSS Not Working Properly
In my movie ive got my css working with xml data but theres one thing that wont work, Margin spacing.
My xml looks a bit like this
<timetable>
<day>Monday</day>
<group><span class="one">group</span></group>
<hours><span class="two">hours</span></hours>
</timetable>
The span is so that 'group' and 'hours' will stay on the same line in the text box.
This is my css...
.one {
margin-left:20px;
}
.two {
margin-left:100px;
}
But only the class 'one' margin space will work. class 'two' just stays directly next to 'one'
ive tried margin0-right on one still wont work ive tried padding neither does that.
Can anyone please help??
While() Not Working Properly
i tried following the duplicate mc tutorial, however the part on putting the code in a frame to get it to duplicate on load doesn't seem to work for me
here's my code in the frame:
stop();
amount = 5;
while(amount>0) {
duplicateMovieClip (_root.arrow, "arrow" + i, i);
i = i + 1;
amount = amount-1;
}
apparently the clip only gets duplicated once where's the problem?
Decrementing Not Working Properly
I've got this script:
on (release) {
_root.stepNumber = int(_root.stepNumber - 1);
_root.textField = _root.stepNumber;
}
Well, when my movie starts, it assigns 1 to _root.stepNumber and _root.textField shows the value 1. The problem is that when I first click my button (it should decrement to 0) _root.textField keeps the value of 1. I have to actually hit my button twice for it to decrement down to zero. This is screwing up calculations in other parts of my movie, so I need to figure out why it's doing this. Anyone have an idea? Thanks.
Oh, No, Preloader Is Not Working Properly...why?
hi everyone
i am facing aproblem making a preloader
I have followed this tutorial
http://www.dissymmetry.com/tutorials/preloader.html
but the problem is that the bar works well untill about 5 percent and then doesn't jump to 100% , i mean before it loads it goes to the next scene....
I just made everything they did 'but' i changed something in the code coz i have 2 scenes while i have only one scene.
this is my code:
"initialize section"
Set Variable: "NumberOfScenes" = 3
// Variable = String, Value = Expr.
Set Variable: "iCount" = 0
// Variable = String, Value = Expr.
Loop While (iCount < NumberOfScenes)
// Condition = Expr.
Set Variable: "TotalFrames" = TotalFrames + GetProperty("_level" & iCount, _totalframes)
// Variable = String, Value = Expr.
Set Variable: "iCount" = iCount + 1
// Variable = String, Value = Expr.
End Loop
Set Variable: "iCount" = 0
// Variable = String, Value = Expr.
progress section
Set Variable: "FramesLoaded" = 0
// Variable = String, Value = Expr.
Loop While (iCount < NumberOfScenes)
// Condition = Expr.
Comment: Loop totals the number of frames loaded from all scenes in the movie into the variable FramesLoaded
Set Variable: "FramesLoaded" = FramesLoaded + GetProperty("_level" & iCount, _framesloaded)
// Variable = String, Value =Expr.
Set Variable: "iCount" = iCount + 1
// Variable = String, Value = Expr.
End Loop
Set Variable: "Progress" = Int (FramesLoaded * 100 / TotalFrames)
// Variable = String, Value = Expr.
Set Variable: "iCount" = 0
// Variable = String, Value = Expr.
loop section
If (Progress <100)
Begin Tell Target ("/PreloaderBar")
// Target = String
Go to and Stop (../:Progress)
// Expression = Expr.
End Tell Target
Go to and Play ("Progress")
// The second frame label
Else
Begin Tell Target ("/PreloaderBAr")
// Expression = Expr.
Go to and Stop (100)
End Tell Target
Go to and Play ("Change")
// The final frame label
End If
& finally the change section
nextScene ();
can any one help?
plz,
i appreciate any help
Link Not Working Properly
HI, I am working on a website for my company and one of our links justs isnt working at all. I checked the code and it is all correct. What can i do.
ClearInterval Not Working Properly
Hey,
The problem I'm having is with fading my movieclip out. 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. Over and over and over!
Could anyone help me on this topic!
as code:
PHP Code:
imageload_xml = new XML();
imageload_xml.ignoreWhite = true;
imageload_xml.onLoad = function(success)
{
if (success)
{
processImg(imageload_xml);
}else{trace("Something is wrong, we're not opening!");}
};
//Load up the XML file into Flash
imageload_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");
img_arr = new Array();
startdate_arr = new Array();
enddate_arr = new Array();
url_arr = new Array();
function processImg(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])
{
this[item_arr[i] + "_arr"].push(xmlDoc_xml.firstChild.childNodes[n].childNodes[i].firstChild.nodeValue);
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;
}
If anyone could help me it would be greatly appreciated!
cbs
LoadMovie Not Working Properly
I have posted two movies below, one of which is supposed to load the other on loading. The second works fine alone, but when i open the original movie and it loads the second, the second is there but is not behaving the way it is supposed to, with motion. Any ideas/suggestions?
Please Help, Can't Get Preloader Working Properly
Been trying to get this working for about a week now, with no luck. It seems to work when I test it, but when i upload the file, which you can see here:
exalt homepage
seems to stop at 2 or 3%, the bytes are not counting like they should, and the bar doesn't grow.
If you have time, I would greatly appreciate it if someone can view my file which you can download in MX format here: Color420 Exalt Homepage
This is for a client, and is time sensitive. I thought I could fix it, and it felt so close, but not quite there! So thanks to whomever can help solve this, I appreciate your time.
Valerie
Masks Are Not Working Properly
Can anyone help me understand why my masks seem to work on the development stage, but not in the animation?
The masks that are not working are in "pt 2" within the "hbda_intro1" symbol. Any help would be appreciated. Thanks.
I'm attaching the zipped .fla, saved in MX format, but I can upload MX 2004 version if it would help.
Scrollpane Not Working Properly
Hi,
I am having major problems with the scrollpane component in Flash MX Professional 2004. If the content in my movie clip that the scrollpane is scrolling is too large, it just shows part of the content and then scrolls white space after that. Also movie clips that have less content scroll the entire content and then keep scrolling white space after that.
Is it a loading issue with my movie clip?
Any help would be greatly appreciated.
Thanks in advance for your time!!!
Textfield Not Working Properly
Hi,
I've been experimenting with a textfield. What I want to do, is to resize a rectangle movieclip that I'm using as a background for the textfield, according to the amount of text in the textfield. The text in the textfield is dynamic and can come in through external sources, but for the purposes of the test, I simply assigned a string value to the textfield through actionscript.
The size of the text can be determined through the textfield.textHeight and .textWidth properties, but the problem is that they don't function properly. The movieclip, though resized, is consistently smaller than the size of the text.
Has anyone had similar problems? Suggestions? I tried uploading the .fla, but the size (432 kb) was beyond the 300k limit. I'm adding a link if anyone wants to take a peek.
http://www.aura-blue.com/workfiles/textfield.fla
Thanks .
Buttons Not Working Properly
hi guys
i'm using flash MX after 2 years so i am starting from scratch...
i have create a new scene with a movie file and the button inside the movie..
i'm animating my button and on the button i have added the following script
Code:
gotoAndPlay(67);
unfortunately when i play the movie... the button doesn't react to anythin...
if i click on it... nothing happens...
i have also added another button where i tell it to
Code:
on (release) {
gotoAndPlay("Scene 1", 1);
}
how do you tell a button to go and play from the beginning?
[F8] Function Not Working Properly?
Hi Ive made a function which I call - but nothing seems to happen?
Its supposed to move a movieclip - but it just dissapears?
Heres the code:
function MoveMe() {
startCoordinate = 100;
Speed = 1;
for (var i:Number = 0; i < 400; i++) {
UpCoordinate = (-Speed) * i + 0.6 * i;
MyMC._y = startCoordinate + UpCoordinate;
}
}
I guess It'smoving too fast? for me to see - but how do i slow it down?
Cheers!
[F8] LoadVariablesNum Not Working Properly
Hello All,
When I use this:
loadVariablesNum("portfolioitem.php", 0);
It loads the php (which is just a text file for testing purposes) with no problem.
But when I use this:
loadVariablesNum(["portfolioitem.php?dummyVar="+random(2100)], 0);
Even though the expression resolves properly, I get an error and Flash doesn't load the text file anymore:
Error opening URL "file:///E|/clients/pathname/portfolioitem.php?dummyVar=1823"
Any ideas?
Thank you
RemoveChildAt Cant Get It Working Properly
Hi guys i did search this to get my answer but still now joy.
code:
function logout() {
trace("holderc:"+holderc.numChildren);
var i:Number=holderc.numChildren;
while (i--) {
holderc.removeChildAt(i);
trace("holder i:"+i)
}
}
It only removes one child from the stage and not all of them.
Anyone got any idea what i am doing wrong?
thanks
[F8] Links Not Working Properly
I've created a scrolling menu that should link to separate pages on the site, but when I click on the item nothing happens. This is pretty basic stuff and should work, but I'm at a loss.
An example of a link would be:
on (release) {
getURL("http://localhost/golf/golf.aspx");
}
Any ideas?
The scrolling menu looks similar to this, but is contained within a site created in HTML, not Flash:
http://www.wynnlasvegas.com/#homepage/
When I check the links on a local machine I get a browser window message that indicates it's looking for a page. But when I upload the files to the server and test the links in the functioning site nothing happens.
AS2 Code Not Working Properly
I have some AS2 code that I am trying to have move the image across the screen, but not sure what I am missing that is not telling it to do so. Any help is greatly appreciate.
import mx.transitions.Tween;
var startHere = 0;
var endHere = -2000;
var speedAt = 10;
function moveClouds() {
var cloud1:Tween = new Tween(this.clouds_mc, "_x", startHere, endHere, speedAt, true);
}
moveClouds();
5 Arg LoadVars Not Working Properly I Think
Any guess as to why this isnt working? This should work!
on (release, keyPress "<Enter>") {
// Make sure the user filled in all the required fields.
if (email ne "") {
// Check to make sure the email address includes and @.
i = "0";
validmail = 0;
while (Number(i)<=Number(length(email))) {
if (substring(email, i, 1) eq "@") {
validmail = 1;
}
i = Number(i)+1;
}
// If there's no @ in the email go to the error page.
if (Number(validmail) == 0) {
gotoAndStop("End", "end_error");
} else {
// The line below assumes the script is in the same directory as the HTML page.
loadVariablesNum("processEmail.jsp", 0, "GET");
// Go to the confirmation frame.
gotoAndStop("End", "end_success");
}
} else {
// if the user left required fields blank, show them an error
message.
gotoAndStop("End", "end_error");
}
//Goto Webpage Behavior
getURL("processEmail.jsp","_blank");
//End Behavior
loadVariablesNum("processEmail.jsp", 0, "GET");
}
UnloadMovie Not Working Properly?
in the flash 8 pro application, when I run my movie it loads/unloads an external mc fine...but when I run in the browser, it doesn't stop playing.
I load it like this:
mc.loadMovie("http://www.domain.com/test.swf");
and unload:
mc.stop();
mc.unloadMovie();
it continues to play. what am I doing wrong?
thanks in advance.
STOP() Not Working Properly
Hi all,
try to click on a few buttons rapidly and you will see my problem
CLICK MY PROBLEM
I have stop(); placed in the first frame(preloader) and last frame, my frame rate is 40fps
I don't even know where to begin on debugging, really beats me
Can anyone help? many thanks!
RemoveChildAt Cant Get It Working Properly
Hi guys i did search this to get my answer but still now joy.
ActionScript Code:
function logout() {
trace("holderc:"+holderc.numChildren);
var i:Number=holderc.numChildren;
while (i--) {
holderc.removeChildAt(i);
trace("holder i:"+i)
}
}
It only removes one child from the stage and not all of them.
Anyone got any idea what i am doing wrong?
thanks
Tween Not Working Properly
Hi,
I just started the conversion from AS2 to AS3 and running into a problem. I'm trying to make an image-cross-fader, using dynamically loaded images. Although the traces say the tween is started, images are switched instantly the odd numbers and are tweened on the even numbers. And on the even numbers the onStart is triggered, but the tween starts later.
Can anyone tell me what I'm doing wrong here?
Here's the code:
Code:
/*
* imagefader script voor crossfaden van fotomateriaal
*/
/*
* import standard Tween and Easing classes for fade
*/
import caurina.transitions.*;
var fadeInterval:Number = 10; // 10 In seconden
var crossFadeSpeed:Number = 4; // 4 In seconden
var imgLoaderA = new Loader();
imgLoaderA.contentLoaderInfo.addEventListener(Event.COMPLETE, imgLoadedA);
var imgLoaderB = new Loader();
imgLoaderB.contentLoaderInfo.addEventListener(Event.COMPLETE, imgLoadedB);
//var xmlPath = "_xml/";
var xmlPath = "../_PUBLISHED/menuInfoBoard/_xml/";
//var imgPath = "_images/";
var imgPath = "../_PUBLISHED/menuInfoBoard/_images/";
var p:Number = 0;
var loader:URLLoader = new URLLoader();
var imagesXML:XML;
var nodes:XML;
var url:String = xmlPath + this.xmlFile;
var myRequest:URLRequest = new URLRequest(url);
var imgItemA;
var imgItemB;
var curPic;
pictureA.alpha = 100;
pictureB.alpha = 0;
loader.load(myRequest);
loader.addEventListener(Event.COMPLETE, onLoaded);
function onLoaded(e:Event):void{
nodes = new XML(e.target.data);
var imgList:XMLList = nodes.children();
images = new Array();
// fill images array with nodes from XML file
for (i=0;i<imgList.length();i++){
images.push(imgPath + imgList[i]);
}
imgLoaderA.load(new URLRequest(images[p]));
curPic = 0;
p++;
imgLoaderB.load(new URLRequest(images[p]));
// Start fading function on intervals
fadeImages = setInterval(crossFade,fadeInterval*1000);
}
function crossFade(){
if(curPic == 0){
Tweener.addTween(pictureA, {alpha:0,
time:crossFadeSpeed,
transition:"easeOutSine",
onStart:function(){trace("PictureA TWEEN STARTED")} });
Tweener.addTween(pictureB, {alpha:100,
time:crossFadeSpeed,
transition:"easeOutSine",
onComplete:MotionFinishedA,
onStart:function(){trace("PictureB TWEEN STARTED")} });
}else{
Tweener.addTween(pictureB, {alpha:0,
time:crossFadeSpeed,
transition:"easeOutSine",
onStart:function(){trace("PictureA TWEEN STARTED ON B")} });
Tweener.addTween(pictureA, {alpha:100,
time:crossFadeSpeed,
transition:"easeOutSine",
onComplete:MotionFinishedB,
onStart:function(){trace("PictureB TWEEN STARTED ON B")} });
}
}
function MotionFinishedA(){
curPic = 1;
p++;
if(p>=images.length){
p=0;
}
imgLoaderA.load(new URLRequest(images[p]));
}
function MotionFinishedB(){
curPic = 0;
p++;
if(p>=images.length){
p=0;
}
imgLoaderB.load(new URLRequest(images[p]));
}
function imgLoadedA(e:Event):void{
trace("IMAGE A LOADED " + pictureA.alpha);
if(pictureA.numChildren>0){
pictureA.removeChildAt(0);
}
imgItemA = pictureA.addChild(imgLoaderA);
}
function imgLoadedB(e:Event):void{
trace("IMAGE B LOADED " + pictureB.alpha);
if(pictureB.numChildren>0){
pictureB.removeChildAt(0);
}
imgItemB = pictureB.addChild(imgLoaderB);
}
Button Not Working Properly
Sorry, I posted this thread in the AS3 forum, but it's actually an as2 issue.
I have a flash template that I am working on and I can't figure out how to properly code the home button. When you click any other tab than the home tab it opens the page up properly. The home button does not work until you have opened up at least two tabs. And then when you click another tab after clicking the home tab it goes to the contact page every time. Very weird but I am not at all versed in actionscript so I don't know what to look for in the functions that it is calling. I'll paste the button actionscript and I don't know where to look for the script that the functions are calling. Maybe someone can help me figure this out. I have read through some of the threads and there are some really smart people helping out! I thank you in advance for any advice you can give me! Here is the button actionscript.
on(release){
if(_root.animation == 1 and _root.ttr == 0){
gotoAndPlay("s1");
menu[("item" + _root.link)].gotoAndPlay("s2");
_root.link = 50;
_root.tt = 1;
}
}
Preloader Not Working Properly
Hey guys. I've been learning Flash AS3 over the past month and finally decided to start a small beginners practice project. I start the game out with a simple preloader/splash screen/logo movie clip on the first frame and say:
ActionScript Code:
stop();
if (preloader_mc.currentFrame == 136) //the final frame in the mc animation
{
gotoAndPlay("start") //the start menu of my game
}
There are no errors but instead of going to frame 2, it goes back to the first frame of the movie clip and stays there. Does anyone have some trouble shooting tips?
My AI Isnt Working Properly...
Right,
So im making this platform game and everything is set up apary from enemys.
This is what im trying to do.
When enemy spawns, moves left or right.
Affected by gravity.
When it hits a wall it turns around.
This is what i have so far...
When it hits a wall it turns around.
Gravity works.
The floor hiTest sometimes works.
Here is my code (which is in the enemys frame).
ActionScript Code:
stop();
var health:Number = 25;
var give:Number = 5;
var speed:Number = 4;
var dir:String = "";
var l:Number = Math.ceil(Math.random() * 2)
var falling:Boolean = true;
var canmove = false;
onEnterFrame = function() {
if(l == 1) {
dir = "left";
} else if(l == 2) {
dir = "right";
}
if(dir == "left" && canmove == true) {
this._x -= speed;
} else if(dir == "right" && canmove == true) {
this._x += speed;
}
if(falling) {
this._y += speed;
canmove = false;
}
for (_root.i = 0; _root.i < _root.maxbox; _root.i++) {
if((hit.hitTest(_root["platform"+_root.i])) && (hit._y <= (_root["platform"+_root.i]._y)))
falling = false;
canmove = true;
}
}
for (_root.i = 0; _root.i < _root.maxbox; _root.i++) {
if (this.hitTest(_root["wall"+_root.i])) {
if(l == 1) {
l = 2;
} else if(l == 2) {
l = 1;
}
}
}
Thanks in advance.
Tween Not Working Properly
hai all,
i'm new to AS3 and i've got some problem using Tween. here is my code:
import fl.transitions.Tween;
import fl.transitions.easing.*;
var btn:BTN = new BTN;
var inTween:Tween;
var outTween:Tween;
btn.x = 100;
btn.y = 100;
btn.alpha = .3;
addChild(btn);
btn.addEventListener(MouseEvent.ROLL_OVER, roll_over);
btn.addEventListener(MouseEvent.ROLL_OUT, roll_out);
function roll_over(event:MouseEvent):void
{
inTween = new Tween(btn,"alpha",None.easeNone,.3,1,.2,true)
}
function roll_out(event:MouseEvent):void
{
outTween = new Tween(btn,"alpha",None.easeNone,1,.3,.5,true)
}
PROBLEM:
when i test the code, everything works fine... except sometimes the "btn" object's alpha tween up and then down even if the mouse pointer is on the object.
there is no problem if i carefully rollover and rollout, but if i rollover and then shake the mouse pointer inside the object, it shows me the rollout effect.
pls let me know wat i'm doing wrong and if there is a work around.
thanx in advance...
Function Not Working Properly
Hi, this should be an easy one but I just can´t find where´s my mistake.
PHP Code:
scaleIt = function (mc) {
if (mc._xscale < 400) {
mc.growing = true;
mc._xscale = mc._yscale += 2;
updateAfterEvent();
} else {
clearInterval(this.intrvl);
}
};
scaleItDown = function (mc) {
if (mc._xscale > 100) {
mc.growing = false;
mc._xscale = mc._yscale -= 2;
updateAfterEvent();
} else {
clearInterval(this.intrvl2);
}
};
Movieclip.prototype.startScale = function() {
this.onRelease = function() {
mc = this;
if (!mc.growing) {
mc.intrvl = setInterval(scaleIt, 10, mc);
} else {
mc.intrvl2 = setInterval(scaleItDown, 10, mc);
}
};
};
mc1.startScale();
When I click on the MC it executes scaleIt function. When I click it again, instead of executing scaleItDown function it executes scaleItDown-scaleIt-scaleItDown-scaleIt...... etc.
Any ideas?
Thanks in advance.
Buttons Not Working Properly In AS
My AS script is not functioning properly for three buttons that are supposed to send the MC to three respective scenes. I've used this script before and it works fine. Could the software be corrupted? Or am I just an idiot?! Below is the script I used for each button (with a different scene name of course. Somebody help! Thanx!!
ActionScript Code:
on (release)
{
gotoAndPlay("Scene 4");
}
Autosize Not Working Properly, Please Help
Hi Guys.
I have spent hours searching the forums for a solution to my autosize problem. What I have found in the forums, I have not been able to get to work for me.
I have a dynamic, scrollable text box with text loaded from external (.txt) source. The first text file has a link to the second text file, which opens up in the same box. I need the text box to autosize.
Here is the code for the scrollbar:
fscommand("allowscale", "false");
bar.useHandCursor = dragger.useHandCursor=true;
space = 20;
friction = .9;
speed = 4;
speed = 4;
y = dragger._y;
top = main._y;
bottom = main._y+mask_mc._height-main._height-space;
dragger.onPress = function() {
drag = true;
this.startDrag(false, this._x, this._parent.y, this._x, this._parent.y+this._parent.bar._height-this._height);
dragger.scrollEase();
};
dragger.onMouseUp = function() {
this.stopDrag();
drag = false;
};
bar.onPress = function() {
drag = true;
if (this._parent._ymouse>this._y+this._height-this._parent.dragger._height) {
this._parent.dragger._y = this._parent._ymouse;
this._parent.dragger._y = this._y+_height-this._parent.dragger._height;
} else {
this._parent.dragger._y = this._parent._ymouse;
}
dragger.scrollEase();
};
bar.onMouseUp = function() {
drag = false;
};
moveDragger = function (d) {
if ((dragger._y>=y+bar._height-dragger._height && d == 1) || (dragger._y<=y && d == -1)) {
clearInterval(myInterval);
} else {
dragger._y += d;
dragger.scrollEase();
updateAfterEvent();
}
};
up_btn.onPress = function() {
myInterval = setInterval(moveDragger, 18, -1);
};
down_btn.onPress = function() {
myInterval = setInterval(moveDragger, 18, 1);
};
up_btn.onMouseUp = down_btn.onMouseUp=function () {
clearInterval(myInterval);
};
MovieClip.prototype.scrollEase = function() {
this.onEnterFrame = function() {
if (Math.abs(dy) == 0 && drag == false) {
delete this.onEnterFrame;
}
r = (this._y-y)/(bar._height-this._height);
dy = Math.round((((top-(top-bottom)*r)-main._y)/speed)*friction);
main._y += dy;
};
};
Here is the code for the text and autosize:
_parent.Box.main.maininfo.html=true;
_parent.Box.main.maintitle.html=true;
mylv = new LoadVars();
mylv.onLoad = function(success) {
if (success) {
_parent.Box.main.maininfo.htmlText=this.mainnurser y;
_parent.Box.main.maintitle.htmlText=this.maintitle ;
}
};
mylv.load("mainnursery.txt");
mylv.load("mainTitle.txt");
this.main.maininfo.autosize = "left";
( I have two dynamic text boxes in this movie clip)
I am unable to upload a zip file it is too large.
Please help!
Thank you so much.
Function Not Working Properly
I have this function that goes to the next frame every 1000 ms. It works fine the first time. But the next time It runs it plays faster. I have no idea why but it looks like it plays twice as fast.
ActionScript Code:
function bombslide() {
_root.purple.bomb.nextFrame();
stop();
}
setInterval(bombslide, 1000);
SetInterval And If Not Working Properly
Hi everyone;
Please help me solve this problem. I am working on a matching game. For each card I have created a movie clip with two frames. One is the cover and the other is the graphic. When the user clicks on the cover, the graphic is displayed.
I declared variables for each card, for example:
var a:Boolean= false;
var b:Boolean=false;
var c:Boolean= false;
var d:Boolean= falese;
Each card has its own button. When each button is pressed, a variable becomes true.
Here is the code for the first button, which is an instance of the movie clip cover.
on(press){
a=true;
_root.cover.gotoAndStop("two");
}
I would like to use setInterval to wait for the matching card to be displayed. If the matching graphic is displayed, both (for example, cover and cover_1) movie clips would be reduced to 50%. If the next card IS NOT the matching card, I would like each movie clip go back to its frame one, which is the cover.
Here is the code in the second frame of COVER .
function one() {
if(b==true){
_root.cover._xscale=50;
_root.cover._yscale=50;
}
else {
_root.cover.gotoAndStop("one");
}
clearInterval (pause);
}
pause = setInterval(one, 5000);
COVER_1
button
on(press){
b=true;
_root.cover_1.gotoAndStop("two");
}
Here is the code in the second frame of COVER_1 .
function one() {
if(b==true){
_root.cover_1._xscale=50;
_root.cover_1._yscale=50;
}
else {
_root.cover_1.gotoAndStop("one");
}
clearInterval (pause);
}
pause = setInterval(one, 5000);
The setInterval works, BUT THE CONDITIONAL IS NOT RECOGNIZING THE VARIABLES.
Please tell me how to fix the script.
German
Tablet Isn't Working Properly
There is no place in the properties menu or anywhere else I can find to set pressure sensitivity, so it operates as though it were a mouse. Pressure does work in photoshop, illustrator and everything else, just not flash. What can I do to fix this? It's frustrating that I can find no solutions anywhere online, and have no idea what the issue might be. I am using the latest driver for my tablet, it's a wacom intuos2, and I am using Flash CS3.
Do you folks have any ideas?
Edited: 12/03/2007 at 10:43:40 AM by Alexandria Gist
Preloader Is Not Working Properly
I have a preloader that is not supposed to play unless the file hasn't been downloaded before. The preloader is in the first frame, and it functions properly on initial download, but not after the file is cached. Any help will be greatly appreciated.
--edit--
After some experimentation I noticed that this only occurs when embedded in an html document and viewed in Firefox. The movie behaves as expected in IE6 (IE7 not tested) and when viewing just the .swf file.
--edit--
Here is the code on my preloader.
Attach Code
onClipEvent (load) {
var loaded = Math.ceil(_root.getBytesLoaded()/_root.getBytesTotal() * 100);
if (loaded == 100) {
_root.gotoAndStop(2); }
}
onClipEvent (enterFrame) {
var loaded = Math.ceil(_root.getBytesLoaded()/_root.getBytesTotal() * 100);
if (_currentframe == 16) {
_root.gotoAndStop(2); }
else if (loaded == 10) {
play(); }
}
Edited: 04/10/2007 at 07:32:07 AM by User-1
GetPixel Not Working Properly
I'm working on some code to output jpegs and am having some issue with
getPixel - it is returning #FFFFFF on all pixels of certain movieClips. I
don't get it and I've not been able to find any info about getPixel not
returning correct values on some clips. It's quite frustrating since it does
work just fine on a couple of clips, and on others I get all white. Anyone
seen this, or can point me in the right direction?
--
Dave -
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/
NavigatetoURL Is Not Working Properly
I am using a single command getURL in my project It is a simple Menu template that has some animated buttons.On clicking they will get the required URL.I am using Flash 9 that is AS 3.0 version.
At first the Links are not working in IE and working best in Mozilla.I found that a tag in OBJECT embed statement.allosripaccess= always.then It was solved.Now It is causing problem in Mozilla new version 3.0.The animation is working.But that navigateToURl is not fetching the required Web pages.The Links are silent.No action is there.I am unable to scratch the Mystery.
If Anybody could solve it, i am so thanfull.From the begening the getURL is a rough function in flash ActionScript Kit.Now in As 3 only name is changed.I don't know Why the developrs of ActionScrip Left it with such ambigous functionality.
Button Not Working Properly
Hi, this is my first post, but i've been browsing the forums for a while now, and I thought that maybe someone could help me with this problem. I've just started using flash: this is my first site. The problem I have is that every time I press the same button something different happens. I am trying to move a semi-transparent rectangle across the screen to cover an image, but each time the button is clicked, the rectangle travels a different distance. The swf file can be found here (temporarily):
http://www.geocities.com/mothersarcy/main.html
and the source file is here:
http://www.geocities.com/mothersarcy/main.fla
The button I am referring to is the 'About' button. I've been stuck on this little problem for several hours now, and really have tried to work it out myself, so any help would be greatly appreciated.
Thanks
Insomniac
Scrollbar Not Working Properly
ive been loading data using loadVars() into a dynamic textfield with html redering on so that i get basic flash html. now ive loaded pics with (with <img>) and have had to surround it by black text on a black background (so that its hidden) because the pics dont show without text surrounding them for some strange reason. now the stupid UIScrollBar that i put on the textfield isnt showing the full bar size so that now i cant scroll alway down, its like its not refreshing properly when different data files are loaded into it, arggggggggggggh, someone help me please
Recurisve SWF Not Working Properly
I am loading an external .swf file and when I load it nothing happens in the .swf file. Basically all the .swf is just a simple recursive deal. Any ideas why this doesnt work?
GetFullDate: Not Working Properly
i was using one of kirupa's tutorials to display the date in one of my swf. The date and the year are working fine but the month is displayed wrong, ie january=month 0 and december=month 11. Is there anyway to fix this?
thankyou!
my code:
mydate = new Date(year, month, date, hour, min, sec, ms);
code = mydate.getDate()+"/"+mydate.getMonth()+"/"+mydate.getFullYear();
Why One Scroller Is Not Working Properly..
hi all....
i have a problem with scroller.... i have 2 scrolling mc in a fla and 1 of which is working properly when i rollover on it but the second one is giving trouble... help need from u guyes... thanx in advance...
regards
surya....
Transition Not Working Properly
help...
the following lines of code are in the 1st frame of the main stage...
Code:
stop();
_root.currMovie = "home";
function firstRun() {
clearInterval(eightSeconds);
container.loadMovie(_root.currMovie+".swf");
}
eightSeconds = setInterval(firstRun, 8000);
This line of code is in on a button in a Movie clip on the main stage
Code:
on (rollOver) {
_parent.btntxt_mc.gotoAndPlay("text_1");
}
on (rollOut) {
_parent.btntxt_mc.gotoAndPlay("back_1");
}
on (release) {
if (_root.currMovie == undefined) {
_root.currMovie = "designfolio";
_root.container.loadMovie("designfolio.swf");
} else if (_root.currMovie != "designfolio") {
if (_root.container._currentframe >= container.midframe) {
_root.currMovie = "designfolio";
_root.container.play();
}
}
}
if the file designfolio.swf is situated in the same folder as the main stage swf, then why does it continue to open home.swf after its transition.?? its the same with the other 4 buttons which should open seperate swf's - they all open the file 'home.swf' help!!
My Actionscript Is Not Working Properly
I have some actionscript that starts off great, but then when the second image starts to come in the image starts to slow down till it stops, then after a second or two the image starts up again the way it should. Then after the images exit the screen after several seconds the images start going in reverse. Why in the world would my actionscript cause that to happen? I am using the class TweenLite.
import gs.TweenLite;
import gs.easing.*;
var clouds = 0;
var clouds2 = 2000;
this.logo_mc._alpha = 0;
function moveClouds():Void {
TweenLite.to(this.clouds_mc, 10, {_x: clouds - 2000, onComplete: moveClouds, onCompleteScope: this});
TweenLite.to(this.clouds2_mc, 100, {_x: clouds2 - 2000});
(clouds < -2000) ? (clouds = 2000) : (clouds - 2000);
(clouds2 == -2000) ? (clouds2 = 2000) : (clouds2 - 2000);
updateAfterEvent();
}
moveClouds();
TweenLite.to(this.logo_mc, 5, {_alpha: 100, ease: Normal.easeIn});
LoadMovie Not Working Properly
Hi lot!
I have been working on a site of mine, and I wanted to make a 360 rotation view thing with some pictures (12 shots all from different angels around the same axis). I need to make a preloader load everything up front, so there wont be any legging.
My best guess was making a slide show kinda thing, with an rotation and zoom bar. And before the slide show, a frame that holds the preloader. But the preloader doesn't loads the right images. I load my images from an XML file, and then parse them into an array (something I got from here I believe). That parts seems to work all fine, but when I load the images using a "container.loadMovie(image[i]);" code, it isnt loading anything, except for an error :s
Here is the code:
Frame 1 : Preloader/ XML parser;
Code:
stop();
var p = 0;
trace (p)
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
totali = xmlNode.childNodes.length;
for (i=0; i<totali; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
}
Preloading();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
function Preloading() {
trace(image[p])
var pic = image[0];
trace(pic)
container._alpha = 0;
container.loadMovie(image[p]);
preloader();
}
function preloader() {
total = container.getBytesTotal();
loaded = container.getBytesLoaded();
if (loaded != total) {
preloader1._visible = true;
preloader1.preload_mask._xscale = 100*loaded/filesize;
} else {
if (p<totali) {
p++;
Preloading();
} else {
p = 0;
preloader1._visible = false;
container._alpha = 100;
gotoAndPlay(2);
}
}
}
Frame 2 : Slideshow
Code:
stop();
delay = 500;
this.onEnterFrame = function() {
slideshow();
};
function slideshow() {
MyInterval = setInterval(slide, delay);
function slide() {
clearInterval(MyInterval);
if (p<totali) {
nextslide();
} else {
slide0();
}
}
}
function nextslide() {
container.loadMovie(image[p]);
slideshow();
}
function slide0() {
container.loadMovie(image[0]);
slideshow();
}
btn1.onPress = function() {
gotoAndPlay(3);
};
There are some loose ends (like the gotoAndPlay(3) things, but that is because I may wanted to add a thumbnail gallery in frame 3... )
Do you see my error? Or is the whole code just a piece of cr*p ? Well let me know will ya?
Buttons Not Working Properly....?
Hola..
I have a web page that is all in flash. Within this movie, I have created a movie with some content to scroll, that includes dynamic text and buttons. For the buttons I have put the following code:
on (release) {
gotoAndPlay("Press", "14");
}
...Press is the name of my page/scene. On the "Press" scene, I have opened an instance of the scrolling content. When I did, I loose the functionality of the buttons. They do not link to the frames they should. Instead, you click the button and nothing happens.
I would post the file, but it is 132k. I believe the max here is 120k.
Any suggestions on how to get my buttons working?
Thanks,
vv
|