Flash NavBar Isn't Working Properly
I have a question about Flash that could possibly be solved very easily, but I have no clue what the problem is. I’ve been looking in forums and in the Flash Bible for days and I can’t seem to figure out what is wrong. Basically, I have created 2 different Flash navbars in Flash 8 (in AS2) and they are both live on two different websites. On various computers, the navbars fail to work (they are buttons and the buttons do no ‘getURL’ like they are supposed to). What is weird is that they work on some computers, and some they do not. I was wondering if maybe it had to do with the version of ActionScript I have used… should I update it to match AS3? It was made in Flash 8.0, and I already tried opening it in Flash CS3 and converting it to a CS3 file but when I uploaded again to the server it still didn’t work. Maybe this has happened to one of yall, or it could be a common mistake!Please help, and if you want to check out the navbars live there is one on http://www.appliedbeckerconsulting.com/andhttp://www.padroneshotguns.com/tell me if it works for you or not! Thank youJake B.
Adobe > ActionScript 1 and 2
Posted on: 04/07/2008 06:09:27 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Navbar Overstate Not Working
Hello I am trying to click on a button on my (just group of buttons)navbar and have it remain in the clicked/over state until I click on a different button. The buttons are just movie clips with 2 frames frame 1 is up state and frame 2 is the over/clicked state. varState is the key to the whole thing but my thinking maybe flawed. I have been stuck on this for at least 2 hours. Code below
ActionScript Code:
var arrBtns:Array = [btn1_mc, btn2_mc, btn3_mc, btn4_mc, btn5_mc, btn6_mc, btn7_mc, btn8_mc];
//--------------Sets event listeners for buttons
var varState:String = "";
for(var i:Number = 0; i < arrBtns.length; i++){
arrBtns[i].addEventListener (MouseEvent.MOUSE_OVER, funcRollOver);
arrBtns[i].addEventListener (MouseEvent.MOUSE_OUT, funcRollOut);
arrBtns[i].addEventListener (MouseEvent.MOUSE_DOWN, funcClick);
}
function funcRollOver (evt:MouseEvent):void
{
this[evt.target.parent.name].gotoAndStop ("2");
}
function funcRollOut (evt:MouseEvent):void
{
//this[evt.target.parent.name].gotoAndStop ("1");
//trace(evt.target.parent.name);
if (varState == this[evt.target.parent.name])
{
this[evt.target.parent.name].gotoAndStop ("2");
}
else
{
this[evt.target.parent.name].gotoAndStop ("1");
}
}
function funcClick (evt:MouseEvent):void
{
varState = "Clicked";
trace(evt.target.parent.name);
this[evt.target.parent.name].gotoAndStop ("2");
}
[CS3] Cant Get Flash Working Properly In Firefox
Hi having a little bit of trouble with my website working properly in firefox. It works in IE fine but in firefox there seems to be a problem with the background as it comes out white not grey.
Please take a look and any suggestions would be highly appreciated. If it looks normal to you please also let me know.
http://djtommyt.streamlinenettrial.co.uk
Thanx Tommy
New Here // Links Not Working Properly In Flash
ok. im not that well versed when it comes to web design and here is my problem. Im using flash to create links to other sites on the net and two of my four links don't work?? They don't work at all in IE, but in Firefox they do, there just is no hand that appears to let you know it's a link.
And to be more specific about the links. I simply created a dynamic text box and highlighted specific words and simply typed the link in the properties panel.
Please help me!!!
Flash Not Working Properly In Firefox
I have created a flash movie with calls to several other sub movies. It works fine in MS-IE and Netscape. It doesn't work in Firefox, but does work in Dreamweaver using Firefox in test mode.
The movie displays a globe and then flattens to a map. It is when clicking on a secondary map the program fails. It is hard to troubleshoot when it works in test mode and other browsers. I have reported this to Firefox, but they don't beleive it is something wrong with thier browser. The web address is http://65.104.36.164/index.html.
Flash Movie Not Working Properly On Pc...ok On Mac.
Hi all, my flash movie (created in MX, exported as flash 6), is not working properly on a PC once uploaded to a server, even though it has worked properly on every mac i've tested it on. Granted, Ive only tested it on one pc (a somewhat busted and virus laden one as well), but is there any reason why there could be a compatibility difference? I noticed that when running the movie on the pc, the title bar in internet explorer would show the frame labels in the url as they were being accessed. weird- is that how it works?
anyway, if anyone has a PC and wants to test it...here's the link (the site is in no way finished, but I cannot get the menu bar drop downs for "artists" and "contact" to work on the pc- not to mention things loading weirdly or sometimes not at all). The other buttons don't work yet- so don't worry about those. BTW, the stage is supposed to load scrollable text and then a random background (out of 2). The site is not yet up for public viewing so any comments as far as loading times / order etc. would also be appreciated.
http://www.soundchron.com/index_2.html
while i'm at it...is 30 fps too fast for most users- what is a good "standard" to shoot for (12 is WAY too slow for what I'm trying to do)?
thanks mucho!
Preloader Not Working Properly [Flash MX]
I'm using the preloader script from http://www.kirupa.com/developer/mx/p...epreloader.htm but have come across a problem. The loader works fine when everything is in the movie from the start, jpegs are imported in the timeline and so on.
The thing is that I load a bunch of externally and other items from the library. In those cases the preloader doesn't run at all, the movie's just blank until everything is loaded and then it starts. It works ok, except for the preloader.
Anyone have a clue on this or an example of another script that works better?
Flash Site Not Working Properly
Ok I'm a complete newb in flash, but slowly and by reading a lot of tutorials and book I bought I'm kind of learning... Still I have an issue that I haven't found a solution to.
I already have a flash site called test.swf, inside I have an empty MC in an action layer inside the area I want the other pages to open. In the buttons I set an action for loading the movie like this
on (release) {
actionformovie.loadMovie("History.swf");
}
I save the page and do a Publish Preview in HTML but when I hit the link nothing happens. . I went through the tutorial in this site even though it's for mx2004... and it basically says to do that command... any help would be appreciated
IE 6 & 7, Flash Sites Not Working Properly
Need help with this. One problem seems to always lead to another in IE. I've all but completed this site, only to discover that IE is being unpredictable (anyone surprised?) IE 6.0.2800, and possibly 6.0.2700 are not (necessarily) loading anything at all. IE7 is causing very deranged problems when I change my loader method to fix the IE 6 problems. Here are the samples:
1) http://www.wrdetasseling.com - should work in IE6+ now, but nav buttons are behaving VERY strangely in IE7.
2) http://www.wrdetasseling.com/index_loader.html - should work in IE7, but may not load in IE6+
WHAT AM I TO DO? This seems to be my only remaining bugs, but they are truly perplexing.
Specifics:
1) uses a preloader in frame 1 and advances to frame 3 where the content begins once the load is complete. Pretty basic.
2) uses a loader component to load the swf file containing the content.
Flash Not Working Properly In Dreamweaver
I'm building a flash based site (Flash MX 2004) with a main swf into which other swfs load. One of the swf's loading into the main one contains an mp3 player I put together with a loading progress bar and a play position bar. The mp3 player loads external Mp3's into the swf. All the flas are set to publish in flash player 6.
My problem is that when I test the main swf or the individual music swf the load and play position progress bars work. But when I embed the main swf in dreamweaver mx 2004 the progress bars dont always work - In Safari and Netscape 7 they work some of the time but in IE they never do. I have removed all layout formatting for the moment as I wandered if the table alignments I was using might have had an impact.
The flash actionscript for the progress bars compare the mp3's bytes loaded with total bytes and track position with hard coded total mp3 duration and function in an onEnterframe action. All other functions within that action including a track timer display work - I just cant figure out why the progress bars dont.
All my files - swfs, mp3's and html are in the same folder. I'm a dreamweaver novice so I've let Dreamweaver sort out the embedding - do I need to change the dreamweaver code so it embeds the other swfs loading into the main one? - not sure where to start and deperate for help on this.
Another issue I have which maybe connected with this is that when I play the music swf in my flash player (7) it loads fine but when I select a track it crashes (but if I select a track either in flash test movie mode or in dreamweaver browser preview they play?).
By the way I'm on Mac OSX
Strange Problem: Flash Not Working Properly In IE
http://avcgroup.golive.titaninternet.co.uk/
This is a link to the webpage where is my flash gallery. When u open the it u will see the gallery on top, little pictures will appear and will slide to the left. When u click on a small picture, a big picture will appear of the same little picture. The problem is that in mozilla firefox and opera for example it works perfectly but when u open it with interner explorer 7, most of the times when u click on a small pic, just the window where the big pic should load shows up, but the pic doesn't load... if u close it and open it second time it opens. The script is the same for all pics. I don't understand why it is not working in IE. Anyone with more experiance should have already faced this problem.. and maybe figured out why this happens... please help !
Thanks in advance.
P.S.
The link is temporarily, so to speak it content changes cuz of testing differnt things so u will see my gallery if the date u read my question is close to the date I've made this post.
Flash Header Not Working Properly Help Needed Asap
I have been struggling with this for a several hours now. My header has this actionscript for the button.
Code:
on (release) {
getURL("gallery.html", "bottom");
}
I named the bottom frame bottom of course. It isn't opening in the bottom frame but it is opening up an entirely new window. Do I point it to the page that contains the frameset?
Help needed ASAP
Flash Player Not Working Properly In IE But Works Fine In FireFox
Flash player has worked fine on my Dell notebook (Vista) until a couple days ago when I had to do a System Restore due to some error in loading. After the system restore, flash doesn't update itself on the sites I most often visit (MLB.com). Each major league baseball team site has a page where you can watch the virtual game (gameday) that shows each pitch, at bat, play, etc. Since my system restore, the page just stays on that point in the game (in a sense) the moment you click to open it up.
I have tried to uninstall and install etc, to no avail. Firefox works fine. Any ideas?
Edited: 06/30/2007 at 07:42:59 PM by ezeric
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.
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?
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
|