"POST" Not Working Correctly With Form
I've looked through all kinds of Flash tutorials on-line but none really answered what probably is an easy fix for this form that I'm making for users to join an email list. I've been trying to do a quick translation from an html form to a flash form but it doesn't seem to be working...It submits fine but I don't think the correct info is getting to the website where I set up an email list. It works perfectly with the html form (code pasted below), now I just have to get it running with flash.
My .fla file is attached
(the .swf as it is now is here: http://filebox.vt.edu/users/jirwin/bombit/mail.swf)
the form html that I used for my html page is here: <!-- Start Bravenet.com Service Code --> <form action="http://pub12.bravenet.com/elist/add.php" method="post" style="margin:0px;"> Name (First and Last):<br> <input type="text" name="ename" size="25" maxlength="60" /><br> Email:<br><input type="text" name="emailaddress" size="25" maxlength="100" /> <input type="radio" name="action" value="join" checked style="border: 0px;"/>Subscribe <br> <input type="hidden" name="usernum" style="border: 0px solid black; height: 0px; width: 0px;" value="950300127" /><input type="hidden" name="cpv" style="border: 0px solid black; height: 0px; width: 0px;" value="1" /> <br><input type="submit" name="submit" value="JOIN" />
</form>
It's that value number of "950300127" that I don't think is going through but hopefully someone can enlighten me.
FlashKit > Flash Help > Flash ActionScript
Posted on: 01-31-2006, 07:22 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Form Submit Script Not Working Correctly
good day everyone!
I have a form validation script that does validate the fields but does not for to the "thank" frame after the validation.
any suggestions, thanks
CODEon (press) {
if (!name.length) {
tellTarget ("n") {
gotoAndPlay(1);
}
} else if (!email.length) {
tellTarget ("e") {
gotoAndPlay(1);
}
} else if (!company.length) {
tellTarget ("c") {
gotoAndPlay(1);
}
} else if (!phone.length) {
tellTarget ("p") {
gotoAndPlay(1);
}
} else if (!comments.length) {
tellTarget ("m") {
gotoAndPlay(1);
}
} else {
loadVariablesNum("form.asp", 0, "POST");
gotoAndStop("thank");
}
}
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>---------------------\
E-mail Form Isn't Sending Correctly
Yes another email form thread.
I've done some searching around on here and pieced together some knowledge and code from other people and came up with the following.
(I'm in a As 3.0 class right now, but teacher doesn't teach how to code he just reads stuff so my AS skills is not that good )
It keeps giving me the error message of error sending in my dynamic text box that displays ... well if it has been sent correctly or not.
I've got 4 fields ...
1. name_txt (user's name)
2. email (user's email)
3. findSite (how they found my site)
4. message_txt (their message)
Then submit_btn as my sending button.
Sample is uploaded here ...
*removed because ppl can't stop sending me blank e-mails*
Anyways here is my AS 3.0 code ..
Code:
//Import Classes
import flash.net.URLLoader
import flash.net.URLRequest
import flash.text.TextField;
import flash.text.TextFormat;
//Formatting text fields
name_txt.borderColor=0x000000;
name_txt.border=true;
name_txt.backgroundColor=0xFFFFFF;
name_txt.background=true;
//
email_txt.borderColor=0x000000;
email_txt.border=true;
email_txt.backgroundColor=0xFFFFFF;
email_txt.background=true;
//
findSite_txt.borderColor=0x000000;
findSite_txt.border=true;
findSite_txt.backgroundColor=0xFFFFFF;
findSite_txt.background=true;
//
message_txt.borderColor=0x000000;
message_txt.border=true;
message_txt.backgroundColor=0xFFFFFF;
message_txt.background=true;
////////////////////////////
submit_btn.addEventListener( MouseEvent.CLICK, submitClick );
// Send the form
function submitClick( e:MouseEvent ):void {
sendData();
}
//Passing Variables
function sendData():void {
var variables:URLVariables = new URLVariables();
variables.nameBox = name_txt.text;
variables.emailBox = email_txt.text;
variables.findSiteBox = findSite_txt.text;
variables.messageBox = message_txt.text;
variables.sendresponse = "SENDING"
status_txt.text = variables.sendresponse;
var _request:URLRequest = new URLRequest("contact.php");
_request.data = variables;
_request.method = URLRequestMethod.POST;
var loader:URLLoader = new URLLoader();
loader.dataFormat = URLLoaderDataFormat.VARIABLES;
loader.addEventListener( Event.COMPLETE, sendComplete );
loader.addEventListener( IOErrorEvent.IO_ERROR, sendIOError );
loader.load( _request );
}
//Form sent successfully
function sendComplete( e:Event ):void {
status_txt.text = "E-mail Sent";
clearForm();
var tmr:Timer = new Timer( 5000, 1 );
tmr.addEventListener( TimerEvent.TIMER, clearMessage );
tmr.start();
}
//Error in sending form
function sendIOError( e:IOErrorEvent ):void {
status_txt.text = "Error sending e-mail";
var tmr:Timer = new Timer( 5000, 1 );
tmr.addEventListener( TimerEvent.TIMER, clearMessage );
tmr.start();
}
//Clear form
function clearForm( ):void {
name_txt.text = "";
email_txt.text = "";
findSite_txt.text = "";
message_txt.text = "";
}
//Clear status message
function clearMessage( e:Event ):void {
status_txt.text = "";
}
Here is my contact.php code.
PHP Code:
<?php/* Pull POST data from Flash */$nameBox=$_POST['nameBox'];$emailBox=$_POST['emailBox'];$findSiteBox=$_POST['findSiteBox'];$messageBox=$_POST['messageBox'];/* Title of the E-mail */$subject = 'Ryan O. Hicks - Portfolio Site';/* E-mail to send to*/$toaddress='email removed for security reasons';/*Defining the body for formatting purposes*/$body = "From: $nameBox
E-Mail: $emailBox
How did you find the site: $findSiteBox
Message: $messageBox";(mail($toaddress,$subject,$body))//////////////////////////////////////////*Can't get to work so forget this code*///////////////////////////////////////////* Error check all data being sent from Flash. Simple formatting*///$nameBox=trim($nameBox);//$emailBox=trim($emailBox);//$subject=stripslashes($subject);//$findSiteBox=stripslashes($findSiteBox);//$messageBox=stripslashes($messageBox);/* Send our e-mail If mail() succeeds, respond with success message If mail() fails, send with failure message*///if//{//echo 'response=passed';//} else {//echo 'response=failed';//}/////////////////////////////////////////?>
Why Is This Not Working Correctly?
I have been successful in making this script work with another movie but I just can't get it to work with this one. It's basically a set of images that I want to horizontally scroll when mouseOver and follow the direction of the mouse. Here's the link to the file:
http://www.pixelwhip.com/thumbs.zip
I want the movie to open with the images centered on the stage then scroll left w/mouse, and right w/mouse.
Any help is greatly appreciated.
Thanks,
Help, Why Is This .fla Not Working Correctly?
Flash 5.
Attached is a .fla for a game of Top Trumps that I have written.
At first it appears that the game runs correctly. However upon closer inspection I found out that when the ai kicks in (and chooses a category), instead of returning values for the current cards, it instead returns the values for the last cards shown. And yet this isn't a problem when the user picks a category (by pressing the relevant category).
(In the AS, "my" refers to the user, and "your" refers to the computer.)
When running the movie, choose one of the categories on the card on the left. If the value you choose is higher than the card on the right, then you go again, if not the computer takes a turn. (For the sake of tracking numbers, the code currently shows the faces of the cards at all times, but when the game is complete, I will hide the inactive players card from view.)
Can anyone shed some light onto this problem? Why is it happening? How can I reslove the problem, so that the computer takes the value from the correct card?
Thanks for your time.
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!
MC Not Working In Stage Correctly
I made a movie clip of a simple mask job and when I preview the MC in the library menu it works great but as soon as I put the clip on stage and test the movie... it just shows the bar from the mask. As you may be able to tell, Im trying to get a matrix code thing going for a background.
FLA with problem
Function Not Working Correctly, Please Help
the following function is returning a single value when multiple items are selected. Can anybody see why? I'm using flash mx if that matters.
function Subscribe(){
var selectedItems = new Array();
selectedItems = Subscribe_lb.getSelectedItems() ;
for ( var i = 0 ; i < selectedItems.length ; i++ ){
formData.Subscribe = selectedItems[i].label;
}
}
thanks,
Howard
Flash/ASP Not Working Correctly
I have a main movie that loads 2 other movies - works fine but the form on one of the loaded movies does not work yet it does work 100% when you play the movie by itself what am i not doing correctly?
current code on the button to send the variables to the asp page are as follows
PHP Code:
on (release) {
loadVariablesNum("flashmail.asp", 0, "POST");
nextFrame();
}
LoadMovie Is Not Working Correctly
when loading into a parent movie the child movie is not displaying all of its contents. specifically dynamic text box with linked .txt file. the scroll buttons and other text is displaying but the dynamic text box is not loading the .txt file this child movie works great by itself, however when loaded as a child into the parent, thats when the problem arrises.
here is the script so far:
In Parent movie: home.swf at frame 44 where empty MC target (mainMovie) appears
button script to load child movie:
on (release) {
loadMovie("MenuSpaPkgs.swf", "_root.mainMovie");
}
in child movie menuspapkgs.swf
frame 1 script is:
loadVariablesNum("SpaPkgs.txt", 0);
TIA
MIke
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
My Button Is Not Working Correctly
Hello,
This is my first post to this fine forum. I am also working on my first Flash project, an interactive map with a rollover effect. The little red button is supposed to be hot; when I am done I will have over 100. However, not only is the button is hot, so is the picture that is supposed to be displayed. You can see the work in progress at:
http://www.westland.net/venicemap/
I also have the source there too:
http://www.westland.net/venicemap/small_map_test.fla
Any assistance would greatly appreciated.
LoadVariablesNum Not Working Correctly
I am making a dynamic menu for a flash website, and in the main timeline, I have this code:
Code:
// loads up initial variables
loadVariablesNum("menuvars.txt", 0);
// this trace comes up as undefined
trace(prob_count);
// this trace comes up as undefined
function loadProblem(prob_number) {
loadVariablesNum("prob"+prob_number+".txt", 0);
// these traces comes up as undefined
trace(prob_title);
trace(prob_text);
trace(prob_author);
}
loadProblem(1);
// Load the menu item variables from the text file.
All of the trace functions come up as undefined, however it appears in the dynamic text boxes in my movie if I set their variables to the txt documents variable. Any way I can fix this?
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!
Rollover Not Working Correctly
I just started used flash for the first time this week as part of my work-study job at college. Anyway, I used it to create a food pyramid that would allow information to pop up whenever a user rolled over one of the elements. The problem is, whenever the mouse goes over the spot where the text pops up on a rollover, the text pops up again. I published this and put it on the web, you can see it at http://www.messiah.edu/offices/dining/lottie/hours.html . Hopefully you'll be able to see whats wrong with it. Any help or advise would be appriciated. Thank you VERY much.
XML File Not Working Correctly
Hey all I have an aspx page that is making a xml file to put an image in to a swf but the problem is as I debug it I see it step though the code
figure.setMask(PicMask);
var photo_xml:XML=new XML();
photo_xml.load("photo.xml");
photo_xml.onLoad=function(success){
if(success){
var newXml:XML=new XML;
newXml.ignoreWhite=true;
newXml.load(photo_xml.firstChild.firstChild.firstC hild.nodeValue);
newXml.onLoad=function(success){
if(success){
figure.createEmptyMovieClip("pic",this.getNextHigh estDepth());
figure.pic.loadMovie(newXml.firstChild.firstChild. firstChild.nodeValue);
lilfigure.createEmptyMovieClip("fig",this.getNextH ighestDepth());
lilfigure.fig.loadMovie(newXml.firstChild.firstChi ld.firstChild.nodeValue);
lilfigure._xscale=20.2;
lilfigure._yscale=20;
}else{
trace("doesn't load");
}
}
}else{
trace("loading failed");
}
}
lines 9-12 does show the data like its suppose to but then at line 13 the child nodevalue changes to "�Exif" from what its suppose to be which is a URL string.
can anyone help out with this one?
Things Not Working Correctly
Here is the site I am working on right now...
http://www.sportridersnetwork.net
Anyways, what is happening is when you click on the featured bike link, the movie covers up the body area with a blue background which is what I wanted to achieve, but the link is still active behind it, and when I click on the home button it reloads the site, but still keeps the body covered up with the blue background. How do I get rid of the blue background like a refresh basically and also how would I make that link behind the blue background not there once clicked?
Buttons Not Working Correctly On IE
I have buttons with movie clips on the overstate - They work correctly when previewwd in Firefoix on the Mac but on IE on the PC they are not active until you click on them once then if you click again they work - so they movie clips that I have in the over state don't work until you click on the buttons - Any Ideas???
LoadVarNum Not Working Correctly?
Quick question. Does anyone have a clue as to why when I follow the loadvarnum statement with a getURL statement, it doesn't save my variable to the text file. I've tried creating a wait function, putting the loadvarnum block elsewhere, but for some reason, if there is a getURL call it seems to cancel out my variable save. Here is the code I would like to use. If anyone has an idea, please let me know. Thanks
if(buttonName == "submit"){
var url = "http://localhost/store.php?total="+total+"&total="+escape(total);
loadVariablesNum (url, 0);
getURL("Http://localhost/anychart/gallery/upload.html","_self");
}
like I said above, everything works fine for saving the file if I delete the getURL statement.
[F8] Variables Not Working Correctly?
Any help would be much appreciated, the script below is meant to hide/show a movie clip depending if it is activated or not, but the variables in the function at the bottom don't seem to be working correctly as they don't update with each click, etc. Does anyone have any suggestions?
Many thanks in advance!
Jon
Quote:
/*
var groupinfo:Array = [newsbox];
var GROWSTART:Number = 10;
var GROWSTOP:Number = 19;
var SHRINKSTART:Number = 20;
var SHRINKSTOP:Number = 29;
function doOn() {
if (this._currentframe > SHRINKSTART && this._currentframe < SHRINKSTOP) {
this.gotoAndPlay(GROWSTART + SHRINKSTOP - this._currentframe);
} else {
this.gotoAndPlay(GROWSTART);
}
}
function doOff() {
if (this._currentframe > GROWSTART && this._currentframe < GROWSTOP) {
this.gotoAndPlay(SHRINKSTART + GROWSTOP - this._currentframe);
} else {
this.gotoAndPlay(SHRINKSTART);
}
}
function init() {
for (var mc in groupinfo) {
if (activated == false) {
groupinfo[mc].onRelease = doOn;
activated = true
} else if (activated == true){
groupinfo[mc].onRelease = doOff;
activated = false
}
}
}
init();
[F8] Buttons Not Working Correctly...
I am having the strangest problem... and I'm really hoping someone can help me out...
The Site is here: http://www.littleolemedesigns.com
I call the flash by calling a js file that calls the swf file by using this:
<script src="http://www.littleolemedesigns.com/includes/templates/LittleOleMeSite/jscript/LOMD_Header_Animation.js"></script>
The fla file can be downloaded here if anyone needs to look at it: http://littleolemedesigns.com/includ...Animation2.fla
Here's my problem:
In IE6, all the buttons work correctly... (the free stuff and tutorials buttons aren't linked yet).
In IE7, when you first go to the site, only one button will work and only one time. Doesn't matter which one. When you close the browser and open it again and go the site again, you get the one button that will work one time again.
In Firefox, none of them are working.
I've tried clearing my flash cache, and clearing my browser cache and it still doesn't work.
Does anyone have any idea??
[F8]IF Statement Not Working Correctly ?
Hi guys im not sure whats going on here??
But the basics users clicks register it sends information to PHP page , PHP page returns a value either OK or RegError and depending on the retrieved value output a message.I have been rattling my brains for the past 3 hours trying to see where the problem is but for the life of me i cant see it :S
NOTE : I have block commented the functions in the hope it will help some people read the sections in the code.
Sorry for the long posts here guys but i thought i should post all my AS code for you guys to check.
BTW crms.no-ip.info is a locally hosted domain , So if my computer isnt on you wont be able to access that address, Just thought i should let you guys know.
Here is the AS code
Code:
stop();
_global.LoginScript;
_global.LoginScript = "http://crms.no-ip.info/flash/functions/login.php";
loginTxt.text = "";
///////////LOGIN SCRIPT CURRENTLY WORKING///////////////////////////////////
varReceiver = new LoadVars();
var AttemptCounter:Number = 0;
myBtn_btn.onRelease = function() {
ConnectionInfo.addItem("Attempting Login");
varReceiver.Age = age.selectedIndex+1;
varReceiver.Action = "ProcessLogin";
varReceiver.Username = username.text;
varReceiver.Userpassword = userpass.text;
varReceiver.sendAndLoad(_global.LoginScript,varReceiver,"POST");
loginTxt.text = "Processing Variables";
varReceiver.onLoad = function(){
//errormsg.text = this.login;
myTrace.text = unescape(this);
_global.UserCheck;
_global.UserCheck= this.login;
ConnectionInfo.addItem("Login Authorisation is : "+this.login);
AttemptCounter++;
LoginAttempts.text = "Logins Attempted "+AttemptCounter;
if(this.login == "YES"){
gotoAndPlay(10);
}else{
username.text = "";
userpass.text = "";
loginTxt.text = ("Your details could not be found, " +newline+ " Please either register yourself or " +newline+ "choose forgotten password.");
}
}
}
///////END LOGIN SCRIPT///////////////////////
///START NEW USER REGISTRATION CURRENTLY NOT WORKING PROPERLY//////////////////
varNewUser = new LoadVars();
register.onRelease = function() {
ConnectionInfo.addItem("Sending Registration Request");
varNewUser.Action = "ProcessRegister";
varNewUser.Username = username.text;
varNewUser.Userpassword = userpass.text;
varNewUser.sendAndLoad(_global.LoginScript,varNewUser,"POST");
//trace(varNewUser);
//getURL(_global.LoginScript);
varNewUser.onLoad = function(){
ConnectionInfo.addItem("Received response from Server");
ConnectionInfo.addItem ("Server Responded: "+this.newusers);
if(this.newusers == "OK"){
username.text = "";
userpass.text = "";
loginTxt.text = ("Registration Success"+newline+"Please proceed to login.");
}else{
trace("Entered Error");
trace("Value returned by server is "+this.newusers);
username.text = "";
userpass.text = "";
loginTxt.text = ("We were unable to process your registration this time");
}
}//End OnLoad function
}//end onRelease of register
//END NEW USER REGISTRATION/////////////////////////////////
The PHP code :
PHP Code:
$Username = ucfirst($_POST['Username']);$Userpassword = md5($_POST['Userpassword']);$Action = $_POST['Action'];$login = "";//What is the user trying to do ? switch($Action){case "ProcessLogin"://Search for user in DB $sql = ("SELECT * FROM `users` WHERE `Username` = '".$Username."' AND `Userspassword` = '".$Userpassword."'");$query = mysql_query($sql); $result = mysql_fetch_array($query); if($result == ""){ $login = "NO"; echo ("&login=$login"); }else{ //write back to flash YES user is registered $login = "YES"; echo ("&login=$login&"); /////// }//break;case "ProcessRegister": $sql = "INSERT INTO `users` (`Username`,`UsersPassword`) VALUES ('".$Username."', '".$Userpassword."')"; echo "The value of SQL is <br>".$sql."<br> END SQL <br>"; $query = mysql_query($sql); if (!$query){ $login = "RegError"; echo ("&newusers=$login"); }else{ $login = "OK"; echo ("&newusers=$login"); }break;}
Now as you can see the PHP contains a switch to find out what the user wants to do either login or register and perform the relevant switch statement
Now what is puzzling me is that the this.newusers is always ok , I mean it inserts new data into the database but it doesnt display the ok message always says we cant process your registration in the flash window even though the insert worked fine :S Even when i "trace" this.newusers into the connection info listbox control it says Server Responded : OK So why is flash completely ignoring that and displaying the error message instead ?
The problem code i believe is this
Code:
if(this.newusers == "OK"){
username.text = "";
userpass.text = "";
loginTxt.text = ("Registration Success"+newline+"Please proceed to login.");
}else{
trace("Entered Error");
trace("Value returned by server is "+this.newusers);
username.text = "";
userpass.text = "";
loginTxt.text = ("We were unable to process your registration this time");
}
Once this is fully working i will comment it out and upload it as a Zip file in the tutorials section as a help me for people new to flash like myself. In the hope that others can benefit from it , Just need to get it working properly first lol.
Sorry for the epic post again guys and a BIG thank you for who ever takes the time out to read it.
LoadMovie Not Working Correctly
I have a movie that is loading an external swf via loadMovie:
ActionScript Code:
_root.createEmptyMovieClip("quiz_holder", this.getNextHighestDepth());
quiz_holder._x = 13;
quiz_holder._y = 13;
quizbtn.onRelease = function() {
quiz_holder.loadMovie("quiz.swf");
}
When I load it, it loads and plays the first scene after that nothing on the external swf works. I attached the external swf so you guys can see how it was built...It was built using scenes unfortunatly (I didn't build it) and I think that might be why. Any explanations?
_visible Not Working Correctly
html: http://roscoecreations.com/main_flash_help.html
fla: http://roscoecreations.com/main_flash_help.fla
Go to the html page and click on the manager and you will see the bullet points appear but if you go where the sihouettes used to be they will reappear. If i take out the bullets movieclip this wont happen so it has to be something to with that clip but i cant figure it out. Any help?
HitTest Not Working Correctly
I'm trying to get my character to rotate when he goes up and down slopes, but for some reason it isn't hit testing correctly. I've tried different methods of rotating the character - using the standard movieclip.rotation and also the matrixtransformer and rotateAroundExternalPoint to rotate the character, but it simply isn't recognising when the character is hitting the floor, which I can't make sense of!
The hit test is performed in the upper left of the screen in a 3x3 tile bitmap which is called hitTestBitmap. I'm hit testing the duplicateCharBitmap object against this but it simply isn't working correctly.
If anyone has the time could you look at my code (sorry its rather messy at the moment) and see what's going wrong with it?
Thanks a lot for ANY help as I am completely stuck!
Code download: Link
Script Not Working Correctly
Hi! I am new to as3 and having a bit of a problem. I have to make a dynamic icon movie which reads file source, url, and title from xml and makes icons. So far so good but when I try to make a transition (alpha tween) when going over the icon its always the last icon that changes alpha, no matter which button I go over. I tried many things but always get errors. I am stuck and without ideas and would really appreciate help.
Here is the script:
ActionScript Code:
import fl.containers.ScrollPane;
import fl.containers.UILoader;
import fl.transitions.Tween;
import fl.transitions.easing.*;
var xmlKoncnica = "xml";
// Load xml
var xmlIkone = "ikone." + xmlKoncnica;
var xmlIkoneLoader:URLLoader = new URLLoader();
var xmlKatURL:URLRequest = new URLRequest(xmlIkone);
xmlIkoneLoader.addEventListener(Event.COMPLETE, xmlIkoneLoaded);
xmlIkoneLoader.load(xmlKatURL);
var novIkoneXML:XML = new XML();
novIkoneXML.ignoreWhitespace = true;
function xmlIkoneLoaded(evt:Event):void {
novIkoneXML = XML(xmlIkoneLoader.data);
var i = 0;
var y = 0;
var x = 0;
for (var item:String in novIkoneXML.ikona) {
//spisek.addItem({label:novIkoneXML.ikona[item].slika, URL:novIkoneXML.ikona[item].@url});
i = i + 1;
if (i == 1 || i == 5) {
y = 0;
} else {
y = y + 80;
}
if (i > 0 && i < 5) {
x = 0;
} else {
x = 200;
}
// ozadje
var ikonaKvadrat:MovieClip = new MovieClip();
//var ikonaKvadrat:Sprite = new Sprite();
//ikonaKvadrat = new Sprite();
ikonaKvadrat.graphics.beginFill(0x827d81);
ikonaKvadrat.graphics.drawRoundRect(x,y,170,73,10);
addChild(ikonaKvadrat);
// belo ozadje
var ikonaKvadratBelo:Sprite = new Sprite();
ikonaKvadratBelo.graphics.beginFill(0xFFFFFF);
ikonaKvadratBelo.graphics.drawRoundRect(x+2,y+2,166,69,9);
ikonaKvadrat.addChild(ikonaKvadratBelo);
// slika maska
var ikonaKvadratMaska:Sprite = new Sprite();
ikonaKvadratMaska.graphics.beginFill(0xFFFFFF);
ikonaKvadratMaska.graphics.drawRoundRect(x+2,y+2,166,69,9);
ikonaKvadrat.addChild(ikonaKvadratMaska);
var ikonaKvadratMaska1:Sprite = new Sprite();
ikonaKvadratMaska1.graphics.beginFill(0xFFFFFF);
ikonaKvadratMaska1.graphics.drawRoundRect(x+2,y+2,166,69,9);
ikonaKvadrat.addChild(ikonaKvadratMaska1);
var ikonaKvadratMaska2:Sprite = new Sprite();
ikonaKvadratMaska2.graphics.beginFill(0xFFFFFF);
ikonaKvadratMaska2.graphics.drawRoundRect(x+2,y+2,166,69,9);
ikonaKvadrat.addChild(ikonaKvadratMaska2);
// slika url
var slikaURL = novIkoneXML.ikona[item].slika;
// slika
var scrollerSlika:UILoader = new UILoader();
scrollerSlika.move(x,y+1);
scrollerSlika.setSize(170,73);
scrollerSlika.source = "pic/ikone/" + slikaURL;
scrollerSlika.mask = ikonaKvadratMaska;
//scrollerSlika.alpha = 0.4;
ikonaKvadrat.addChild(scrollerSlika);
//scrollerSlika.addEventListener(Event.COMPLETE, nalaganjeKoncano);
// napis ozadje
var ikonaKvadratNapis:Sprite = new Sprite();
ikonaKvadratNapis = new Sprite();
ikonaKvadratNapis.graphics.beginFill(0xffaf5e);
ikonaKvadratNapis.graphics.drawRect(x,y,170,17);
ikonaKvadratNapis.mask = ikonaKvadratMaska1;
ikonaKvadrat.addChild(ikonaKvadratNapis);
// crta ozadje
var ikonaKvadratNapisCrta:Sprite = new Sprite();
ikonaKvadratNapisCrta.graphics.beginFill(0x827d81);
ikonaKvadratNapisCrta.graphics.drawRect(x,y+17,170,1);
ikonaKvadratNapisCrta.mask = ikonaKvadratMaska2;
ikonaKvadrat.addChild(ikonaKvadratNapisCrta);
function AlphaIn(evt:MouseEvent):void{
var AlphaTween:Tween = new Tween(this.scrollerSlika, "alpha", Strong.easeOut, 1, 0.3, 2, true);
}
function AlphaOut(evt:MouseEvent):void{
var AlphaTween:Tween = new Tween(scrollerSlika, "alpha", Strong.easeOut, 0.3, 1, 2, true);
}
// Gumb
var ikonaKvadratGumb:Sprite = new Sprite();
ikonaKvadratGumb.graphics.beginFill(0xFFFFFF);
ikonaKvadratGumb.graphics.drawRoundRect(x+2,y+2,166,69,9);
ikonaKvadratGumb.alpha = 0;
ikonaKvadrat.addChild(ikonaKvadratGumb);
ikonaKvadratGumb.addEventListener(MouseEvent.MOUSE_OVER, AlphaIn);
ikonaKvadratGumb.addEventListener(MouseEvent.MOUSE_OUT, AlphaOut);
}
}
RemoveMovieClip Isn't Working Correctly.
Hi,
I've written some code and i'm having troubles getting an animation that's currently being shown to completely be removed from memory when I use the removeMovieClip clip. For all intents and purposes it looks like it works when first invoked (i.e. it is removed form the screen and I can't find it in the debugger), but when I try to reshow or recreate the animation it gets stacked on top of its previous copy. I've played with different depth, delete verses removeMovieClip and I need some help! Is anyone out there able to assist?
ActionScript Code:
//circle vars
var circle_radius:Number = 4;
var circleColor:Number = 0x3C7BBB;
var circleAlpha:Number = 10;
var yPos:Number = 0;
var xPos:Number = 0;
//layout vars
//how many cirlces do you want in your ring?
var circleCount:Number = 12;
var layout_radius:Number = 25;
//calculates how much to increment the angle by
function setupLayout() {
delay_view = this.createEmptyMovieClip("delay_view_mc", this.getNextHighestDepth());
delay_notice = delay_view.createEmptyMovieClip("delay_notice_mc", delay_view.getNextHighestDepth());
delay_notice.drawLayout();
}
MovieClip.prototype.drawSimpleCircle = function(xPos:Number, yPos:Number, radius:Number, fillColor:Number, fillAlpha:Number) {
trace("drawSimpleCircle called, target ="+this);
var x:Number = radius;
var y:Number = radius;
with (this) {
clear();
beginFill(fillColor,fillAlpha);
moveTo(x+radius,y);
curveTo(radius+x,Math.tan(Math.PI/8)*radius+y,Math.sin(Math.PI/4)*radius+x,Math.sin(Math.PI/4)*radius+y);
curveTo(Math.tan(Math.PI/8)*radius+x,radius+y,x,radius+y);
curveTo(-Math.tan(Math.PI/8)*radius+x,radius+y,-Math.sin(Math.PI/4)*radius+x,Math.sin(Math.PI/4)*radius+y);
curveTo(-radius+x,Math.tan(Math.PI/8)*radius+y,-radius+x,y);
curveTo(-radius+x,-Math.tan(Math.PI/8)*radius+y,-Math.sin(Math.PI/4)*radius+x,-Math.sin(Math.PI/4)*radius+y);
curveTo(-Math.tan(Math.PI/8)*radius+x,-radius+y,x,-radius+y);
curveTo(Math.tan(Math.PI/8)*radius+x,-radius+y,Math.sin(Math.PI/4)*radius+x,-Math.sin(Math.PI/4)*radius+y);
curveTo(radius+x,-Math.tan(Math.PI/8)*radius+y,radius+x,y);
endFill();
_x = xPos-this._width/2-this._width;
_y = yPos-this._height/2;
}
updateAfterEvent();
};
MovieClip.prototype.drawLayout = function() {
this.clear();
var angleIncrement:Number = Math.PI*2/circleCount;
for (var i:Number = 0; i<circleCount; i++) {
//create a movieclip that contain a small circle
var temp_mc:MovieClip = this.createEmptyMovieClip("circle_mc_"+i, this.getNextHighestDepth());
temp_mc.drawSimpleCircle(xPos,yPos,circle_radius,circleColor,circleAlpha);
circleAlpha += 6;
//calculates the angle at which to place the movieclips
var theta:Number = angleIncrement*i;
//position the MovieClips
temp_mc._x = Math.cos(theta)*layout_radius-(temp_mc._width/2);
temp_mc._y = Math.sin(theta)*layout_radius-(temp_mc._height/2);
trace(temp_mc+"("+temp_mc._x+","+temp_mc._y+") | circleAlpha="+circleAlpha);
}
this._y = Stage.height/2;
this._x = Stage.width/2;
this.onEnterFrame = function() {
//temp animation
this._rotation += 30;
};
};
function launch_kill() {
trace("launch_kill called "+"enable = "+enable);
if (enable == true) {
//delay_view._visible = true;
setupLayout();
enable = false;
} else {
//delay_view._visible = false;
delete delay_notice.onEnterFrame;
delay_view.removeMovieClip();
enable = true;
}
}
this.onEnterFrame = function() {
//temp animation
debug_control(onEnterFrame,delay_notice);
};
//testing code
debug_control = function (event_handler:String, temp_mc:MovieClip) {
//creates a toggle button, that will show and hide the delay notice (supposed to atleast).
if (event_handler != onEnterFrame) {
var debug_com_mc:MovieClip = this.createEmptyMovieClip("debug_com_mc", this.getNextHighestDepth());
var toggle_mc:MovieClip = debug_com_mc.createEmptyMovieClip("toggle_mc", debug_com_mc.getNextHighestDepth());
debug_txt = debug_com_mc.createTextField(instanceName="debug_text", debug_com_mc.getNextHighestDepth(), 11, 288, 218, 30);
toggle_mc.drawSimpleCircle(xPos,yPos,circle_radius*2,0xA8C631,80);
toggle_mc._x = (Stage.width-toggle_mc._width)/2;
toggle_mc._y = Stage.height-50;
toggle_mc.onPress = function() {
launch_kill();
};
}
debug_txt.text = "ver: pa7 (cleanup) , _rotation="+temp_mc._rotation;
};
//launches movie
setupLayout();
debug_control();
My Mc.onPress Not Working Correctly?
I create a menu dynamically. When I click on the menu button it takes me to the correct frame label the first time, but when I click on the same button again it doesn't it jumps to the next frame label on the time line. So my question is, why doesn't it take me to the correct frame label each time?
Here is part of my code with the first two menu options shown:
ActionScript Code:
//creates new array "myMenuClips"
myMenuClips = [];
// "remember last Xpos"
lastXPos = 50;
// the space between 2 elements
mySpaceVar = 5;
for (var i = 0; i<labels_array.length; i++) {
var but = _root.attachMovie("btnMC", "btn_"+i, i);
myMenuClips.push(but);
but._y = 585;
but.tf.text = labels_array[i];
but.tf.autoSize = true;
// lastXPos is the left border of the element
but._x = lastXPos;
// so do.....for the next left border
lastXPos = lastXPos+but._width+mySpaceVar;
but.num = i;
///////////////////////////////////////////////////////////////////////////////
but.onPress = function() {
//trace("name of Movie "+this.tf.text);
if (this.tf.text == "ABOUT RIVERSIDE") {
stopAllSounds();
for (var i in _root) {
if (typeof (_root[i]) == "movieclip") {
var isMenu = false;
for (var c in myMenuClips) {
if (myMenuClips[c] == _root[i]) {
isMenu = true;
}
}
if (!isMenu) {
_root[i].removeMovieClip();
}
}
}
_root.gotoAndPlay("about2");
}
/////////////////////////////////////////////////////////////////////////////////////////////////
if (this.tf.text == "MEET YOUR TEAM") {
stopAllSounds();
for (var i in _root) {
if (typeof (_root[i]) == "movieclip") {
var isMenu = false;
for (var c in myMenuClips) {
if (myMenuClips[c] == _root[i]) {
isMenu = true;
}
}
if (!isMenu) {
_root[i].removeMovieClip();
}
}
}
_root.gotoAndPlay("team2");
}
};
}
SoundObject Is Not Working Correctly
Guys,
I'm stuck trying to fix some bugs in my paddle game assignment.
Three bugs;
- setVolume() controling only the loseSound variable
- initBricks() fucntions with the attachMovie() method
- brick moveclip not replace itself with explode movie clip.
I've tried a few steps in controling only one sound var but it ends conrtoling all sound var gobelly. Can't figure out where to add this function.
Can anyone help me?
Mask Not Working Correctly In Swf
Hai Friends,
I am trying to do a simple masking which works correctly in fla but when viewed in swf the text which is masked is not seen..What i did is first i wrote some text converted it to movieclip then in another layer i did draw a rectangle with some color and right clicked the rectangle and masked it When viewed in fla the masked text is viewable but when converted to swf the text is not seen Is it some problem with Flash Can you please help me...
ComboBox Not Working Correctly
Hi there,
I am developing a small Flash (AS2) application, using Flash CS3, and have run into a problem with the ComboBox componet.
I am loading another movie into the main movie with the following code:
var container = _level0.createEmptyMovieClip("ui_slider", _level0.getNextHighestDepth());
trace("On last frame");
container.loadMovie("ui-sliderv2.swf");
ui_slider._x = 60;
ui_slider._y = -382
everything works fine, but none of the comboBoxes are working. I can see the first item that can be selected, but the pull-down selection is not working. Nothing happens when I click it.
the ui-sliderv2.swf movie works as expected when run on its own.
Here are the links to the SWF.
http://www.rmp-consulting.com/chomonicx/Chomonicx.html
The menu SWF on it's own:
http://www.rmp-consulting.com/chomonicx/ui-sliderv2.html
Any suggestions?
Edited: 06/13/2008 at 09:22:34 AM by Rowan
Variables Not Working Correctly..
Im loading variables via loadvariablesnum and im checking the debug and they successfully getinto the _level0
now for some reason in the next frame its not reading that vari .. IE Below
if(_level0.FID != "")
{
_root.gotoAndPlay(6);
}
in the debug tho under _level0 it chose FID correctly in... doesnt make sense
[AS3] Scroll Bar Not Working Correctly :(
I have created a simulated control panel (knobs ,switches and text to explain the functions of the knob's & switches). it works really good on most computers but on some the "component" scroll bar flashs and does not work correctly is this a bug or?
2 users with the excat same version of flash player 9 one works correctly one does not. any ideas i'm stuck :(
thank you in advance for your help.
My Component Is Not Working Correctly
I'm working on a Gallery component for work, and I've just about finished. So to test it out, I created the SWC and installed it. I created a test file with the necessary elements, created the XML file, copied the images. When I test the movie, it works. However, if I view it outside of the authoring program, I see no gallery.
What could be causing this?
Also, when the component is placed in the authoring program, my place holder graphic is not shown.
List Box Not Working Correctly.
Hello everyone,
I am going to be dynamically loading .swf files into a listbox to display them on my main page. My listbox populates fine, and proceeds to display the .swf files correctly when selecting the appropriate ones in my listbox. When I export in flash (by export I mean pressing [ctrl] + [enter]), everything works great. So pretty much everything is working good at this point. I then wrote the html page to display my flash file and now my event listener isn't working and I can't get the maps (.swf files) to change on my main page any more. I tested it in IE7 and FireFox, both with the same result. Here is the code that currently works when you export in flash 8, but fails when I embed the .swf file into an html page. My actionscripts (2.0) are as follows:
//initialize listener and set mapMenu labels and data
var myListener:Object = new Object();
mapMenu.addItem("Garage","Garage.swf" );
mapMenu.addItem("Floor 1","Floor1.swf");
mapMenu.addItem("Floor 2","Floor2.swf");
mapMenu.addItem("Floor 3","Floor3.swf");
mapMenu.addItem("Roof","Roof.swf");
mapMenu.addItem("Perimeter","Perimeter.swf");
svgMovie.loadMovie("images/Floor1.swf"); //default to floor 1
myListener.change = function(obj) {
svgMovie.loadMovie("images/" + obj.target.selectedItem.data);
trace("images/" + obj.target.selectedItem.data);
};
mapMenu.addEventListener("change", myListener);
I also tried:
function displayMap(c){
svgMovie.loadMovie("images/" + c.getSelectedItem().data);
trace("images/" + c.getSelectedItem().data);
}
mapMenu.setChangeHandler("displayMap");
which wont even work when I export it from flash.
Has anyone heard of a problem like this? I have been searching with little to no success. Any help would be greatly appreciated. Thanks. ~Scot
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.
Fadeout Not Working Correctly
Hi,
I have been working on this flash8 file for a little while now and am at my end - I have all the internals working the right way - but the images are supposed to fade in and out -- on (release) -- the fade starts to work then stops - I've also added a text overlay - it too (kinda) shows.
Could someone look at this and tell me where I went astray? It's about 87% complete - it just needs these little "fixes"
Zip file here
Drop Down Menu Not Working Correctly
hi,
i'm trying to get a drop down menu to work correctly but there seems to be some error... any help is appreciated! Thank you in advance.
i've attached the fla file for you to look at.
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...";
Fullscreen Not Working Correctly In Loaded Swf
I have a swf loading an external SWF which is a video player. The video player loads fine into the SWF, but if I hit full screen it goes full screen but I cant see anything. Its all black. I can still see the "hit escape to exit" bubble thing.
If I embed the video player by itself(ie. ISNT loaded into a swf) the full screen function works fine.
Any ideas?
Flash Login Isn't Working Correctly
Hello, i'm trying to build a very simple flash login -- and i've followed the bulk of the tutorials to a tee, but it still isn't working and i'm about to lose my mind!
The page I created can be found here:
http://www.parkthevan.com/pass/
The login info should be "letmein77"
This is my AS (2.0):
Code:
loginbutton.onPress = function() {
if (password == "letmein77") {
gotoAndPlay("correct");}
else {
gotoAndPlay("ready");
incorrect.gotoAndPlay(2);}
};
Currently, all it does is go back to 'Ready' and start the incorrect login movie clip, I cannot get it to land on the 'correct' timeline.
The source can be downloaded here:
http://www.parkthevan.com/pass/ptv_pass.fla
I don't need the source back, just some help coding this sucker -- I don't work much with input variables (my focus is more in animation/design than forms and scripting) in my flash movies and i've been scratching my head for days now. Any help would definitely be appreciated!
Walls In My Game Not Working Correctly
Hi, I'm making an RPG in Flash. The walls of buildings work but if you walk diagonally in a corner and wait like 5 seconds you walk out of the wall. This is the code I use for a wall in the right:
Code:
onClipEvent (enterFrame) {
if (hitTest(_root.user)) {
_root.bg3._x += 10;
}
}
Where "user" is the instance name of the player and "bg3" is background number 3. You may wonder why the background moves instead of the user, that's because when you press the key "RIGHT" the player faces to the right and plays the walking animation but doesn't move, that's just a way of scrolling the background. Anyway here's the code for a wall in the left:
Code:
onClipEvent (enterFrame) {
if (hitTest(_root.user)) {
_root.bg3._x -= 10;
}
}
I know there's a much easier and effective way to do this, can anyone tell me a way?
Thanks
Flash Button Not Working Correctly
Hello i am a graphic designer for Resolution Systems and I am updating our website. I have add a flash intro to display some of the things we do for our customers. I have animated all of the text and images with no problems, However... I am trying to create a button to allow our potential clients to click on the flash animation and be directed to our Contact page. I have followed a tutorial on creating buttons and setting actions through action script.
( The Basics of Flash Buttons and Navigation Bars )
but for some reason the button does not link to the page correctly???
here is the script code
directly relating to the button:
on (release) {
getURL("http://www.resolution.com/pages/contactus.htm");
}
when i check the script syntax it shows "This script contains no errors"
it does not work in the firefox browser nor IE.
i am looking for the quickest solution to this meticulous problem, but as long as i can get it to link correctly i will be extremely happy...
Also time is of the essence and this site should have been done yesterday. so if you can help me i would really appreciate it.
thanks
GotoAndPlay Not Working Correctly In Firefox
I have a few simple gotoAndPlay actions pointing to different places on my time line. It seems whenever a function is called to go back on the time line, behind where the playhead is, the whole movie restarts.
This only happens in Firefox and I have never used AS 1.0. Just wondering if this is common.
Any help would be appreciated.
External SWF Not Working Correctly In Original Swf
Got an external swf linked into my main file. The swf plays fine on its own, is clickable & moves to different frames. When I play the main swf, the external loads when prompted but buttons inside don't work correctly like it does on its own. What the heck? lol... help please!
Score Code, It's Working, But Not Correctly
if (Key.getAscii() == 102)
if (hitline_mc.hitTest(fbar1_mc)==true) {
_root.perfectscore = _root.perfectscore + 1;
}
I have a line of code like this that points to a text box with a var name of "perfectscore"
The text box is updating when this occurs, but instead of getting 1, 2, 3, 4, 5, etc. it is displaying as 1, 11, 111, 1111, 11111, 111111, etc.
What's wrong here?
Menu System Not 100% Working Correctly
Hi,
I have asked to create a website in flash however I have hit a slight issue with my menu system I am building. The code to me looks fine. I'll try and explain the issue. There is a _global variable called currentpage, and when the site first loads this variable is populated with the value of 'home'. When the user clicks a button on the menu lets say 'Changing' the menu system is supposed to look at the value of the _global.currentpage and then play a particular label (called 'normalin') within that instances mc. Then it is meant to play a particular label (called 'down')within the 'changing' instance mc and then finally got back to the root and play the label for the changing page. When this label set is played the _global.currentpage is updated with 'changing'.
Unforuntalety this is not happening. Everything is working fine apart for it playing the normalin frame label. I have attached the code for the menu mc in the hope someone will be able to identify why this is not working. If you would like to help then I can also upload the fla on request.
I look forward to hearing from someone soon and hope this is just a small issue and I am overlooking something.
CODE:
Attach Code
if(_global.startup == "true")
{
_root.menu_mc.home_mc.gotoAndPlay("down");
_global.startup = "false";
};
var r:String = ""
r = _global.currentpage +"_mc";
// ----- MENU CODE -----
// ----- HOME BUTTON -----
home_btn.onRollOver = function()
{
if(_global.currentpage != "home")
{
home_mc.gotoAndPlay("over");
}
else
{
break;
}
}
home_btn.onRollOut = function()
{
if(_global.currentpage != "home")
{
home_mc.gotoAndPlay("normalin");
}
else
{
break;
}
}
home_btn.onRelease = function()
{
if(_global.currentpage != "home")
{
home_mc.gotoAndPlay("down");
trace("Home button was presssed and the value of r is " + r)
_parent.r.gotoAndPlay("normalin");
_root.gotoAndPlay("home");
}
else
{
break;
}
}
// ----- CHANGING BUTTON -----
changing_btn.onRollOver = function()
{
if(_global.currentpage != "changing")
{
changing_mc.gotoAndPlay("over");
}
else
{
break;
}
}
changing_btn.onRollOut = function()
{
if(_global.currentpage != "changing")
{
changing_mc.gotoAndPlay("normalin");
}
else
{
break;
}
}
changing_btn.onRelease = function()
{
if(_global.currentpage != "changing")
{
changing_mc.gotoAndPlay("down");
trace("Changing button was presssed and the value of r is " + r)
_parent.r.gotoAndPlay("normalin");
_root.gotoAndPlay("changing");
}
else
{
break;
}
}
Action Button Not Working Correctly
I have a website file that out of the blue decided not to work when someone clicks on the about tab. The three main pages are loaded as the same scene, and the other two work, but not that about page. Any ideas?
Edited: 12/02/2008 at 10:42:51 AM by fareforce
Frame Jumping Does Not Working Correctly.
Here's the situation: I have a webpage that has 5 links. Each link goes to a seperate frame (gotoAndPlay). The problem is that if you are one page 3 (for instance) and you click the button that would normally send you to page 3, it now sends you to page 4!
Here is a page that I am currently working on:
http://vagrantaesthetic.com/tests/the4thd/fmakers.swf
Don't mind the scaling, it's supposed to be nested in another movie. Anyway, click on any of the guys' name. One you get to his page, click on his link again and see the problem.
|