LoadVars() Extar Carraige Returns ... It Worked Before
Hello my name is Mike I allready have Flash to PHP to mySQL working fine but, here is my "simple" problem..
Here is the code
Code: var c = new LoadVars(); c.onLoad = function() { returnvals.text = "returned from PHP: "; for (i in this) { returnvals.text += i + " = " + this[i] + ""; } }; c.load("passvars.php");
and here is the PHP passvars.php
<? $name = "mike"; $phone = "222-4444"; echo "Name = ".$name."&Phone =".$phone; ?>
The outpu in returnvals text field is this...
returned from PHP:
Name = mike
<----------
Phone = 222-4444 onLoad = [type Function]
Whats with all these carrage returns, this is right out of an EASY tutorial. I'm doing some complicated things now and I was running into a problem so I went back to the bsics and got this. I have done this with the exact same script and it's worked fine.. rrggggggg.. I even reinstalled Flash, uploaded the new player/debuger ect. no deal... any visions greatly appriciated
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
LoadVars Returns Undefined
en.txt:
introHead=Headline here.&introBody=Body copy here.
The Flash 8 Stage:
- Text Field instance named "head_txt"
- Text Field instance named "body_txt"
- Both set to Dynamic
The ActionScript:
Code:
// default language //
loadText("en");
// load all site text from file //
function loadText(language:String) {
siteText = new LoadVars();
siteText.load(language + ".txt")
}
// populate headline and body copy text fields for this page //
function populatePage(pageName:String) {
siteText.onLoad = function() {
head_txt.text = siteText.pageName + "Head";
body_txt.text = siteText.pageName + "Body";
}
}
populatePage("intro");
stop();
Since I'm using "pageName" twice, it seems obvious to declare it as a variable and have the function dynamically retreive it. But it's not working. The text being displayed in those two boxes returns as "undefinedHead" and "undefinedBody" instead of the real content from the text file. This does work, however:
Code:
head_txt.text = siteText.introHead;
body_txt.text = siteText.introBody;
i.e., if I "hard code" it, it works fine. But as a variable, it doesn't.
Other random piece of info: if I declare the LoadVars with strict data typing it doesn't load the text file at all:
Code:
var siteText:LoadVars = new LoadVars();
I'm guessing it's scope-related, but I've run out of ideas. Any thoughts?
LoadVars With PHP Returns Literal Name Of PHP Var
So, I'm trying to use LoadVars to get a result from a MySQL query with a PHP script. The only problem is that when the variable comes back to flash it's the literal name of the variable and not the contents. Can someone tell me what I'm doing wrong?
PHP Code:
$id = $_POST['vidID'];
$query = "SELECT address FROM Videos WHERE id = '$id'";
$results = mysql_query($query);
$address = mysql_fetch_array($results);
$addrString = '&addr='.$address[address].'&';
echo $addrString;
ActionScript 2.0 Code:
Code:
var myLoadVarOut:LoadVars = new LoadVars();
var myLoadVarIn:LoadVars = new LoadVars();
filepath = "../getvidaddress.php";
myLoadVar.vidID = _root.vidID;
myLoadVarOut.sendAndLoad(filepath, myLoadVarIn, "POST");
myLoadVarIn.onLoad = function(info) {
if (info) {
_root.vidAdd = this.addr;
trace(_root.vidAdd);
}
else {
trace("Error");
}
}
LoadVars.load(); Returns And Array?
Hi. When loading variables from an external file... are they returned to actionscript as an array? If so, I am trying to figure out how to loop through them and have them all print to a textbox. How would this be done? Thanks.
Carraige Return In Text File?
I'm loading in some text from an external text file. What code do I use to do a one line carraige return?
Thanks
Graeme
Loaded Text File -> Carraige Return And Scrollies?
Im loading a text file... what is the code for a carraige return?
And second, I cant seem to get the scroll component to scroll my dynamic text box... it has the target correct, what else do I need?
-Tyler
Sending Text With "RETURNS" Through A Button To A Dynamic Textfields With "RETURNS"
I have a dynamic textfield which I am loading text into through a button. Here is the button code
on (press) {
_root.about = "this is my text that is loaded into a dynamic text field named about";
}
I'm trying to make returns appear in the dynamic textfield
HERE is what I would like the text to look like in the dynamic textfield
this is my text
that is loaded into a
dynamic textfield named about
I tried using /n in the button script but nothing appeared.
n (press) {
_root.about = "this is my text /n
that is loaded into a /n
dynamic text field named about";
}
It Worked
I tried the codes you guys sent me. They worked!!! Thank you so much to both of you.. I there's something i could help you with, please, don't you doubt to ask!!!
Mariana
[F8] It Worked Before But Not Now
I have this mc ( cloud) that I want to to be able to dragged and let go and the speed is depending on when how long You drag and for how long. It worked very well, but then I needed to have more than one cloud so I made it but then the speed doesn´t work or doesn´t stop when the speed is going towards zero. Tried a few things but no I am stuck.
I think this is the part of the code where the bug is:
-----
temp.onEnterFrame = function(){
//here the code for the speed of the car_mc. It will slow//
//down and hopefully stop inside the candle-light.//
_root.temp._x-=speed;
speed *=.9;
temp._alpha = speed;
trace("speed:"+speed);
if((speed <= 1 )&&(speed >= 0)){
speed = 0;
trace("stopped");
}
if((temp.hitTest(hit_mc)) && speed == 0 ){
trace("the light was hit");
}
-----
but I enclose the file as well. I guess it´s some small change that has to be done.
It Worked So Well I Think Ill Try It Again
Okay last time a asked for help it worked out so well that im going to try it again......
So here is my problem.
i want a movie clip to play a movie when its value = true..... but here’s my problem, i only want it to play it once, but i cant make it stop playing.
Code:
onClipEvent (load) {
stop();
this._visible = false;
}
onClipEvent (enterFrame) {
if (this._visible == true) {
play();
}
}
so what do i need to do to make it stop.
Thanks
-Meeshai-
Worked Once
Hi
I am putting in a collection of animated gifs into my first flash project.
The first animated gif when I dropped it in automatically keyframed for 100 frames
but now all the other gifs i drop in dont do that and I dont know why, any ideas.
Okay This Worked In Flash 5
i was testing out the scrollbar UI and decides to use some html in my dynamic text box. now everything works but my hmtl tags show up, i have the "<>" button down for rendering as html but still no go. do i have to format the text different or am i just over looking something simple?
Script Worked In 6 Not In 7
Hello,
I'm using this script to load 4 images through an XML file then navigate them using two buttons (back/next). The script works fine when exporting as Flashplayer 6 format.
But when exporting as Flashplayer 7 it just loads the first image and stops there.
Navigation buttons aren't working anymore. I can't find what's wrong but maybe you guys could have a look at the code. Thank you.
PHP Code:
weergave_txt.text = "Loading XML data...";
my_xml = new XML();
my_xml.ignoreWhite = true;
my_xml.load("inhoud_woon.xml");
my_xml.onLoad = function(status) {
if (status) {
data_xml = this.firstChild.childNodes;
createEmptyMovieClip("mc", 1);
loadMovie(data_xml[0].attributes.datei, "mc");
mc._x = 15;
mc._y = 15;
weergave_txt.text = data_xml[0].attributes.titel;
delete my_xml;
} else {
weergave_txt.text = "Error!";
}
};
volgende.onRelease = function() {
if (beeld<data_xml.length-1) {
beeld++;
loadMovie(data_xml[beeld].attributes.datei, "mc");
weergave_txt.text = data_xml[beeld].attributes.titel;
}
};
terug.onRelease = function() {
if (beeld>0) {
beeld--;
loadMovie(data_xml[beeld].attributes.datei, "mc");
weergave_txt.text = data_xml[beeld].attributes.titel;
}
};
Fscommand Has It Ever Not Worked?
Howdy I was wondering if anyone has ever encountered a situation where they can't get the fsCommand to function? I've been using this command on all my standalone projects and it has never let me down, all the sudden on this one file it doesn't create the full screen for the projector. I got sudtrated and created a test clip to do the exact thing and it works... therefor it must be the specific file.... Now there's quite abit of coding and crazy tweens that I would prefer not to try and recreate. Has anyone encountered this problem?
123
Worked Before, Now It Doesn't
Hey now.
I made a Flash music player for a band I know a few months back, in Flash MX. I am now using Flash MX 2004 Pro and I have added some new songs to the playlist. I haven't changed anything except where the playback head goes to play songs. The actionscript I am using is
on (release) {
empty.loadMovie("song.swf");
gotoAndStop("Frame Number");
}
Frame number obviously is replaced with actual frame numbers....
But anyway, before it would load the song swf's into the empty clip, now it just stalls and doesn't do anything. Is there a minor difference between the two Flash's that I am just not picking up?
What The Hell? It Worked Before
So in a scene, I have a layer just for actions. The last frame of the scene has the following AS attached to it:
Code:
_root.gotoAndPlay("Main", 1);
It does nothing but replay the current scene. BIZARRE. What's wrong?!
(I also tried it as
Code:
gotoAndPlay("Main", 1);
)
It Worked Before... What Happened?
Hey everyone.
I have a wierd problem here.
This code worked perfect before. But now I am trying to use it again and it simply wont work. Whats the deal? Was this code only good in MX. I am in 8 now.
Take a look and if you have any idea, I would love to hear it. You can see what this code does by going to safeandsoundaudio.com ,and clicking on the satellite nav button, then rollover the logos in the middle.
Thanks a ton!!
Here is the code:
// Elasticity on a Square
onClipEvent (enterFrame) {
// Speed
var speed = 5;
// Elasticity
var viscosity = 1.2;
// Percentage to scale to
xscale = 80;
yscale = 80;
// X Scale Script
difference = xscale-this._xscale;
xvelocity = (xvelocity+(difference)/speed)/viscosity;
this._xscale += xvelocity;
// Y Scale Script
difference = yscale-this._yscale;
xvelocity = (xvelocity+(difference)/speed)/viscosity;
this._yscale += xvelocity;
}
.
It Worked In Firefox..but IE?
Hi - I hope someone can help me...
I have one day left to complete my monster dynamic flash site (demo at http://www.offonone.com/carey), which i am very proud of, (being a total Flash Bodger) ...and it was working fine.
Then my client told me that on IE it wasnt working ( I was happily testing away on Firefox with no probs). So I try making it version 7 (it was 8)...no joy so I try making it AS v1. Ooops - error:
**Error** Scene=Main, layer=functions, frame=5:Line 136: '{' expected
listener.onLoadProgress = function(target:MovieClip, bytesLoaded:Number, bytesTotal:Number):Void {
so its the ":Void" that the compiler doesnt like - what to do? If I take it out nothing loads. I dont even know what it does.
Someone please explain - I have searched the net to no avail.
XML Script Worked In 6 Not In 7
Hello,
I'm using this script to load 4 images through an XML file then navigate them using two buttons (back/next). The script works fine when exporting as Flashplayer 6 format.
But when exporting as Flashplayer 7 it just loads the first image and stops there.
Navigation buttons aren't working anymore. I can't find what's wrong but maybe you guys could have a look at the code. Thank you.
Code:
weergave_txt.text = "Loading XML data...";
my_xml = new XML();
my_xml.ignoreWhite = true;
my_xml.load("inhoud_woon.xml");
my_xml.onLoad = function(status) {
if (status) {
data_xml = this.firstChild.childNodes;
createEmptyMovieClip("mc", 1);
loadMovie(data_xml[0].attributes.datei, "mc");
mc._x = 15;
mc._y = 15;
weergave_txt.text = data_xml[0].attributes.titel;
delete my_xml;
} else {
weergave_txt.text = "Error!";
}
};
volgende.onRelease = function() {
if (beeld<data_xml.length-1) {
beeld++;
loadMovie(data_xml[beeld].attributes.datei, "mc");
weergave_txt.text = data_xml[beeld].attributes.titel;
}
};
terug.onRelease = function() {
if (beeld>0) {
beeld--;
loadMovie(data_xml[beeld].attributes.datei, "mc");
weergave_txt.text = data_xml[beeld].attributes.titel;
}
};
InteliCart MX - Anyone Worked With It?
I found script for e-commerce (extentions for Dreamweaver MX) but not sure if is worth to get it. Below is link to that cart.
Intelicart MX
There is no working demo but owner of this company wrote couple php books.
I am working with DW (php & mySQL).
Does anyone knows any good extentions for e-commerce?
Aaggh CGI @%*^$ Has Never Worked In This Form
I'm very frustrated, I've been stumped for over a month...no solution!
Anyone see why this won't work?
initForm();
function initForm() {
_global.form_mc = this;
varData = new LoadVars();
}
function submitForm() {
varData.formInput += escape("&first_name=" + first_name.text);
varData.formInput += escape("&last_name=" + last_name.text);
varData.formInput += escape("&email=" + email.text);
varData.formInput += escape("&workphone=" + workphone.text);
varData.formInput += escape("&comments=" + comments.text);
trace("Sending " + varData.toString());
varData.send('/cgi/common/form-mail.pl?PTCcode-email=yes&PTCcode-flatfile=yes&PTCcode-database=job_description&PTCcode-recipient=casting@xxxx.com&PTCcode-subject=Comments_Submission', 'POST');
gotoAndStop("Sent");
}
Thanks, Rob
It Worked Before, No It Doesn't AHHHHH
Ok I have a nav bar that is a rectangle with 6 buttons across it. The nav bar sits at the top of the stage and if the user has their mouse within 55 pixels of the top the nav bar follows the mouse up and down. And if the users mouse is within a certain range of the buttons they follow the mouse left and right. If the mouse is outside of the area for either the bar or the buttons they both retrun to they're normal positions. My problem is that all the buttons worked fine when I had 5 buttons, I recently added the 6th button. now after i added the 6th the last button which worked previously no longer moves, even though it has the exact same code as the other buttons. What the #$%@ is going on here? Am I blind and missing something?
The file is made on a MAC but should open without problems on a PC if you open Flash first and then select open file. At least it worked for me. Thanks everyone for your help in advance.
Drop Target Worked Not A Second Ago...
I had a drop target work good and it was all workin, and it just randomly stopped workin.
Heres the file:
http://geocities.com/forkinbob/College2.fla
The target is a clear circle in the middle of the donut thing, if u click in there it's called werd and the symbol number is 90.
The code to drop target is a lil harder, on frame 107 theres a little trapezoid on the bottem, go in that and on frame 72 in that theres more of the same type trapezoid, the code is in those...I've been known to make confusing code, so i dont suspect it to be easy and im sorry in advanced. THis is makin me mad so any help would be appreciated
PS All this is in scene 2.
Thanx Much
It All Worked Fine Untill
I am using swish lite and have created a little intro
www.uspfilms.com/wargames.swf
but when it loads everything it is meant to type on screen is all garbled ?? and the sound dosn't play!?
any suggestions?
Robbie
Loading CSS Worked, But Fails Now.
Loading CSS format in dynamic text field worked, but not anymore, why?
i put in main timeline frame 1:
PHP Code:
// ------------------<Load CSS>---------------------- \
var cssStyles:TextField.StyleSheet = new TextField.StyleSheet();
cssStyles.load("stylesheet/markup.css");
cssStyles.onLoad = function (success:Boolean) {
if (success) {
this.webDesign_txt.styleSheet = cssStyles;
_level0.myLV.load("text/webDesign.txt");
} else {
webDesign_txt.text = "Please e-mail the web master to set the path to the CSS file correctly.";
}
}
// ------------------</Load CSS>---------------------- \
_level0.myLV.load("text/webDesign.txt");
And then if finely this code works, i want each button load its own .txt file using:
PHP Code:
this.ourHistoryMC.onRelease = function() {
_level0.myLV.load("vars/ourHistory.txt");
}
Again, this code works in another .fla file, why not in this one?
Downloadable at:
http://www.fzvastgoed.nl/pcxpert/Programming.zip
Root Of AttachMovie. Never Worked, Know Why?
hi,
i have never got this to work, any ideas how is should be done?
ActionScript Code:
_root.content.holder.attachMovie("id", "newName", 5)_root.content.newName._x = 500
i've only ever got it to work if there is no object before the attachmovie (it always attaches alright but then i cna't use the target _root.content.newName._x ).
sure it's something easy but it's causing me a headache.
thanks in advance
kd
Root Of AttachMovie. Never Worked, Know Why?
hi,
i have never got this to work, any ideas how is should be done?
ActionScript Code:
_root.content.holder.attachMovie("id", "newName", 5)_root.content.newName._x = 500
i've only ever got it to work if there is no object before the attachmovie (it always attaches alright but then i cna't use the target _root.content.newName._x ).
sure it's something easy but it's causing me a headache.
thanks in advance
kd
Aaggh CGI @%*^$ Has Never Worked In This Form
I'm very frustrated, I've been stumped for over a month...no solution!
Anyone see why this won't work?
initForm();
function initForm() {
_global.form_mc = this;
varData = new LoadVars();
}
function submitForm() {
varData.formInput += escape("&first_name=" + first_name.text);
varData.formInput += escape("&last_name=" + last_name.text);
varData.formInput += escape("&email=" + email.text);
varData.formInput += escape("&workphone=" + workphone.text);
varData.formInput += escape("&comments=" + comments.text);
trace("Sending " + varData.toString());
varData.send('/cgi/common/form-mail.pl?PTCcode-email=yes&PTCcode-flatfile=yes&PTCcode-database=job_description&PTCcode-recipient=casting@xxxx.com&PTCcode-subject=Comments_Submission', 'POST');
gotoAndStop("Sent");
}
Thanks, Rob
Aaggh CGI @%*^$ Has Never Worked In This Form
I'm very frustrated, I've been stumped for over a month...no solution!
Anyone see why this won't work?
initForm();
function initForm() {
_global.form_mc = this;
varData = new LoadVars();
}
function submitForm() {
varData.formInput += escape("&first_name=" + first_name.text);
varData.formInput += escape("&last_name=" + last_name.text);
varData.formInput += escape("&email=" + email.text);
varData.formInput += escape("&workphone=" + workphone.text);
varData.formInput += escape("&comments=" + comments.text);
trace("Sending " + varData.toString());
varData.send('/cgi/common/form-mail.pl?PTCcode-email=yes&PTCcode-flatfile=yes&PTCcode-database=job_description&PTCcode-recipient=casting@xxxx.com&PTCcode-subject=Comments_Submission', 'POST');
gotoAndStop("Sent");
}
Thanks, Rob
It Should Be Worked...? Full Screen Script
I have tried to make a Full Screen trick in Flash 5 with some script...
Yes... It was worked.
By the way, there is a small problem in indicating...
When I use Javascript language between <HEAD> and </HEAD>
in .html, everything works rightfully execept Scollbar.
Here's the description...
When making a new window browser(Full Screen trick) with a right script is right in action, the browser always have the scrollbar even if I edited 'scrollbar=no' in .html file.
Can anybody help me to find the script of Full Screen trick that is not showed the scrollbar...? Please~
Wouldn't It Be Great If It Worked (loop)
Any idea or this will never work (for some reason)?
onClipEvent (load) {
loadMovieNum("http://www.domain.com.br/test/mov1.swf", 1);
loadMovieNum("http://www.domain.com.br/test/mov2.swf", 2);
levels = ["1", "2"];
for ( i = 0 ; i < levels.length ; i++ ) {
myLevelBytesTotal = eval("_level"+levels[i]).getBytesTotal();
myLevelBytesLoaded = eval("_level"+levels[i]).getBytesLoaded();
}
}
onClipEvent (enterFrame) {
trace(myLevelBytesTotal);
//it constantlly shows undefined
trace(myLevelBytesLoaded);
// same thing
if (myLevelBytesTotal == undefined) {
_root.gotoAndStop(1);
} else if (myLevelBytesTotal == myLevelBytesLoaded) {
_root.gotoAndStop(2);
}
}
Thx
Gea
I Worked Out The Code To Go Forward...how Do I Go Back?
Hello, I'm new to this so please excuse the basic question.
I have a photo slide show and a button to press for the next image and then one to go back to the previously viewed image. The following is the code I have on the next button:
on (release) {
_root.link = _root.link+1;
_root.play();
}
so I thought that logically to go back I would replace the plus sign with a minus sign but this isn't working...any ideas???
Thanks in advance,
[F8] Flash Remoting Worked In MX But Not In Flash8
Maybe it should have been in the NEWBIES section, but ..
Some time ago I did a project for a client with Flash Remoting. My FLA was done in Flash MX and everything worked just fine! Now I revisit the project and find that even with NO changes to my script it doesnt work anymore when I export with Flash8.
My code for setting up the Remoting:
#include "NetServices.as"
// initialize your Flash Remoting connection
if (inited == null) {
inited = true;
NetServices.setDefaultGatewayUrl("client gateway");
gateway_conn = NetServices.createGatewayConnection();
// establish your CFC as a service
myService = gateway_conn.getService("path to forhandler.cfc", this);
// call that service once a connection has been made to start getting the dealer info
myService.getForhandlere();
}
function getForhandlere_Result(result) {
//my function that gets data from a query in forhandlere.cfc
}
Anyone??
Real Simple (if You've Worked With Flash B4)
I'm sure this will be laughably simple for the pros out there...
I'm working in Flash MX 2004. All I want to do is have a key press (the alt or tab key) result in the swf skipping to an assigned frame. I want to assign the script to either the initial frame or a movie clip.
//edit is there an ascii code for the alt key or a way I can specify it in the following code?
Code:
myListener = new Object();
myListener.onKeyDown = function(){
if(Key.getCode() == 32){
gotoAndPlay(490);
}
}
Key.addListener(myListener);
...and also how do I stop this code from working in subsequent frames or is there better code I should be using?
Help.
JavaScript That Worked In MX Isn't Working In MX 2004
I have a project that I originally did a few years back in Flash MX. I'm redoing it to include in a portfolio I'm putting together and without thinking about the consequences, I saved it as MX 2004 instead of the legacy save. Then I proceeded to do about 8 - 10 hours of work on redesigning the site. Everything seemed to be working fine on the new site, but there's a section that uses JavaScript to open some new windows. In the new window, there are links where you can click to play (an MP3) or right click to download. The original site works just fine but in the new site, the JavaScript doesn't open the new windows. I don't know if the links on the new window would work or not because I can't get to them. I'm worried that it may be a difference between MX and MX 2004 which would mean my 8 - 10 hours are down the drain and I'd have to start all over with a legacy save (at least I still have a copy of the original). However, I'm also wondering if it's just a targeting issue or some other issue with the ActionScript and/or the JavaScript.
The part I'm talking about is here. On the left nav, click on "Music" and then on the "Downloads" page, click on any of the links to the Suites. This is the original version so the windows should open. Anyone have any idea why the windows wouldn't be opening in the new version? The HTML is like this:
Code:
<HTML>
<HEAD>
<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
<TITLE>The French Suites of J.S. Bach</TITLE>
<script language="JavaScript">
function openNewWindow(URLtoOpen, windowName, windowFeatures) {
newWindow=window.open(URLtoOpen, windowName, windowFeatures); }
</script>
</HEAD>
<BODY bgcolor="#660000">
<div align="center"><OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
WIDTH="740" HEIGHT="540" id="index" ALIGN="">
<PARAM NAME=movie VALUE="index.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#660000> <EMBED src="index.swf" quality=high bgcolor=#660000 WIDTH="740" HEIGHT="540" NAME="index" ALIGN=""
TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>
</OBJECT></div>
</BODY>
</HTML>
And a sample of the pertinent ActionScript is here:
Code:
_root.music_mc.frste1.onRelease = function() {
getURL("javascript:openNewWindow('http://www.anopenspace.com/school/audio/frsuite1.html','thewin','width=320, height=330, toolbar=no,scrollbars=no')");
};
You have no idea how much I'm REALLY hoping someone can figure out what's wrong and tell me that I don't have to start all over. For sure. Help?
HTML Text Not Working - Worked Before
This html text was working previous, and now it's not and I have no idea why.
Here's a sample of the code in flash:
clients.textfield.text="CLIENTS"
clients.onRelease = function (){
textLoader("clients.txt");
Here's the txt file:
theTitle=Clients
&theDescrip=<font size='24'>gogoBaby<br/>MaRGie Jewellery<br/>Northcott Communications<br/>Mommies that Work<br/>NYC Midnight Movie Making Madness<br/>- The Toronto Film Race 2007<br/>Maven Marketing Communications</font size>
Here's the website:
http://www.instigatorcommunications.com/
Pause Fram Code Worked In MX But Not CS3?
I have a 1 Scene Movie with a dozen or so layers, i am try to have it play the whole thing on a contuines loop and have it pause on certain frames. I had a script that worked when i was using Flash MX but since i have moved to CS3 for some reason it no longer works. This is the code i am using, i didn't write it, i actually got it from one of the people on here (I apologize i have forgotten their name).
Code:
// Loop frames 5
pauseDuration = 5*1000;
framesInLoop = 10;
if (startTime == null) {
startTime = getTimer();
gotoAndPlay (_currentframe-framesInLoop);
} else {
lapsedTime = getTimer()-startTime;
if (lapsedTime < pauseDuration) {
gotoAndPlay (_currentframe-framesInLoop);
} else {
startTime = null;
}
}
it gives me am "Access of undefined property" Error for every line.
I am unable to figure out why it worked in MX but not for CS3, hopefully one of you know better then me. Thank you!!
JavaScript That Worked In MX Isn't Working In MX 2004
I have a project that I originally did a few years back in Flash MX. I'm redoing it to include in a portfolio I'm putting together and without thinking about the consequences, I saved it as MX 2004 instead of the legacy save. Then I proceeded to do about 8 - 10 hours of work on redesigning the site. Everything seemed to be working fine on the new site, but there's a section that uses JavaScript to open some new windows. In the new window, there are links where you can click to play (an MP3) or right click to download. The original site works just fine but in the new site, the JavaScript doesn't open the new windows. I don't know if the links on the new window would work or not because I can't get to them. I'm worried that it may be a difference between MX and MX 2004 which would mean my 8 - 10 hours are down the drain and I'd have to start all over with a legacy save (at least I still have a copy of the original). However, I'm also wondering if it's just a targeting issue or some other issue with the ActionScript and/or the JavaScript.
The part I'm talking about is here. On the left nav, click on "Music" and then on the "Downloads" page, click on any of the links to the Suites. This is the original version so the windows should open. Anyone have any idea why the windows wouldn't be opening in the new version? The HTML is like this:
HTML Code:
<HTML>
<HEAD>
<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
<TITLE>The French Suites of J.S. Bach</TITLE>
<script language="JavaScript">
function openNewWindow(URLtoOpen, windowName, windowFeatures) {
newWindow=window.open(URLtoOpen, windowName, windowFeatures); }
</script>
</HEAD>
<BODY bgcolor="#660000">
<div align="center"><OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
WIDTH="740" HEIGHT="540" id="index" ALIGN="">
<PARAM NAME=movie VALUE="index.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#660000> <EMBED src="index.swf" quality=high bgcolor=#660000 WIDTH="740" HEIGHT="540" NAME="index" ALIGN=""
TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer"></EMBED>
</OBJECT></div>
</BODY>
</HTML>
And the pertinent ActionScript is here:
Code:
_root.music_mc.frste1.onRelease = function() {getURL("javascript:openNewWindow('http://www.anopenspace.com/school/audio/frsuite1.html','thewin','width=320, height=330, toolbar=no,scrollbars=no')");
};
_root.music_mc.frste2.onRelease = function() {getURL("javascript:openNewWindow('http://www.anopenspace.com/school/audio/frsuite2.html','thewin','width=320,height=330, toolbar=no,scrollbars=no')");
};
_root.music_mc.frste3.onRelease = function() {getURL("javascript:openNewWindow('http://www.anopenspace.com/school/audio/frsuite3.html','thewin','width=320,height=330, toolbar=no,scrollbars=no')");
};
_root.music_mc.frste4.onRelease = function() {getURL("javascript:openNewWindow('http://www.anopenspace.com/school/audio/frsuite4.html','thewin','width=320,height=330, toolbar=no,scrollbars=no')");
};
_root.music_mc.frste5.onRelease = function() {getURL("javascript:openNewWindow('http://www.anopenspace.com/school/audio/frsuite5.html','thewin','width=320,height=330, toolbar=no,scrollbars=no')");
};
_root.music_mc.frste6.onRelease = function() {getURL("javascript:openNewWindow('http://www.anopenspace.com/school/audio/frsuite6.html','thewin','width=316,height=320, toolbar=no,scrollbars=no')");
};
You don't know HOW much I'm REALLY hoping someone can figure out what's wrong and tell me that I don't have to start all over. Really. Help?
SetMask - Worked A Minute Ago, But Something Changed
Hi, hope whoever is reading this is having a great day. I was, up till an hour ago.
I can't figure out what I did to my script to make the text-masking effect not working. I was literally jumping for joy an hour ago. Then I changed something and I'm no longer jumping.
Can somebody please take a look at my script to see what it is that I've done to make this happen? I'm sure I've embedded the font and like I said, it was working not too long ago.
The simplified version of the .fla file is attached.
.swf
file is HERE
(fixed broken link)
Thanks in advance.
Popup Worked Fine, Not Anymore
Hi,
I've a project made a couple of years ago. It is on Cd Rom, with a main Flash movie embeded in an HTML page which give the users the possibility of opening some popup HTML windows embedding some Flash videos.
It was all working fine at the moment of release but now, testing it on Windows XP, the pop up windows don't work anymore. I've tested it on IE6 and IE7 on Windows XP SP2.
It works fine on a Mac OS X running Safari.
The project works perfectly running it locally or through the network on the same machine with the same settings where it doesn't work from cd rom.
It has to do with some security setting regarding playing dynamic contents from a cd rom, but I can't make it work.
Can anyone help please?
Thanks
paolo
ActionScript That Worked In Studio 8 Fails In CS3
I have three lines in my code that worked just fine using the Flash/Java Integration Kit when the movies I'm creating were built using Studio 8. I upgraded to CS3 and now I can't publish. The three lines are:
import com.macromedia.javascript.JavaScriptProxy;
var proxy:JavaScriptProxy = new JavaScriptProxy();
var proxy:JavaScriptProxy = new JavaScriptProxy(_root.lcId, this);
The error is that the JavaScriptProxy can't be loaded, but it exists on the server(s) where the final SWF will live. I'm desperate for help. Anyone?
Thank you so much,
-Benjamin
Web Services Worked Fine Until They Were Uploaded
The title says it all. I had some web services that I used with the WS components and everything worked SPLENDIDLY in flash, but as soon as I uploaded the files to my website... I get nothing...
Anyone know what might cause it? Or heard of something liek this before?
Thanks very much.
Kirupa Tute Worked Great Until...
Hi,
I just used Kirupa's tutorial, "Launching a Centered Pop-Up Window"
http://www.kirupa.com/developer/mx/centered_popup.htm
with great success.
It worked just like it was supposed to--in a test-page situation.
But when I tried to transfer it to my real-life situation, it refused to work.
My reality involves the test-page being called into a situation like this:
/*
_root.createEmptyMovieClip("loadExternalSwiffs_mc" , 1);
loadExternalSwiffs_mc._x = 0;
loadExternalSwiffs_mc._y = 103;
_root.loadExternalSwiffs_mc.loadMovie("introSplash Page.swf")
*/
Only it's even more complicated than that because the test-page isn't that introSplashPage, it's one (called "aaronCreditsList.swf) that's being loaded into that level from a button inside the root document, like this:
/*
on (release) {
_root.loadExternalSwiffs_mc.loadMovie("aaronCredit sList.swf")
gotoAndStop("collapsed2");
gotoAndStop("collapsed");
}
*/
I guess what I need to know is where--now--to put this Kirupa copy:
/*
_root.openWinCentre = function (url, winName, w, h, toolbar, location, directories, status, menubar, scrollbars, resizable) {
getURL ("javascript:var myWin; if(!myWin || myWin.closed){myWin = window.open('" + url + "','" + winName + "','" + "width=" + w + ",height=" + h + ",toolbar=" + toolbar + ",location=" + location + ",directories=" + directories + ",status=" + status + ",menubar=" + menubar + ",scrollbars=" + scrollbars + ",resizable=" + resizable + ",top='+((screen.height/2)-(" + h/2 + "))+',left='+((screen.width/2)-(" + w/2 + "))+'" + "')}else{myWin.focus();};void(0);");
}
*/
And/or how to modify it slightly so that it can "find" its way to Kirupa's button copy:
/* on (release) {
//customize the window that gets opened
// 0 equals NO.
// 1 equals YES.
address = "aaronCreditsActor.html";
target_winName = "mainWindow";
width = 700;
height = 350;
toolbar = 0;
location = 0;
directories = 0;
status = 0;
menubar = 0;
scrollbars = 1;
resizable = 0;
//sends data back to the function
openWinCentre(address, target_winName, width, height, toolbar, location, directories, status, menubar, scrollbars, resizable);
}
*/
I've tried a bunch of things but, so far, nothing has worked.
TIA
Include Worked Previously...not Anymore
My swf file is located in /images/fla/.
My includes are located in /includes/viewer/.
Now, early yesterday morning it was working fine. I was calling the includes by:
#include "../includes/viewer/file.as"
;
stop();
I took a break and when I came back, it didn't work anymore. Is there a shortcut key or anything that would make this cause problems? I didn't move the files, I didn't relocate the program. Nothing changed!!! So why the sudden error?
I'm going to make this a two-question thread.
I get that Flash likes to cache and you have to put headers into your HTML to not cache. I've added No-Cache, Pragma, and Expires tags. However, my program still wants to load the previous version.
If I make a change to one of the actionscript file mentioned above, I have to republish the swf file in order for the new changes to take affect. Is this normal? Is there a way around it? NOTE: I'm not making changes inside the FLA file, but inside the included as files, so why do I have to republish?
Thanks.
Tim
Include Worked Previously...not Anymore
My swf file is located in /images/fla/.
My includes are located in /includes/viewer/.
Now, early yesterday morning it was working fine. I was calling the includes by:
#include "../includes/viewer/file.as"
;
stop();
I took a break and when I came back, it didn't work anymore. Is there a shortcut key or anything that would make this cause problems? I didn't move the files, I didn't relocate the program. Nothing changed!!! So why the sudden error?
I'm going to make this a two-question thread.
I get that Flash likes to cache and you have to put headers into your HTML to not cache. I've added No-Cache, Pragma, and Expires tags. However, my program still wants to load the previous version.
If I make a change to one of the actionscript file mentioned above, I have to republish the swf file in order for the new changes to take affect. Is this normal? Is there a way around it? NOTE: I'm not making changes inside the FLA file, but inside the included as files, so why do I have to republish?
Thanks.
Tim
Variable Script That Worked In Flash6 Stops In 7
Bear in mind this code has been working perfectly published as flash 6, but when published as flash 7 it seems not work anymore.....
simple timeline variable stuff for documenting the position of a menubar thingy.
I set variable on _root.mainmovie timeline...
musicmenu = 0;
then when a menu drops down at different times in clip called "music"
and i set variable with....
_root.mainmovie.musicmenu = 1;
then....
if (_root.mainmovie.musicmenu == 1) {
_root.mainmovie.music.gotoandPlay("close");
} else if (_root.mainmovie.musicmenu == 2) {
_root.mainmovie.music.gotoandPlay("stopper");
} else {
gotoAndPlay("ender");
}
now - all target paths etc should be ok since it all works as flash 6.
the code is so simple that i just can't see why it's changed in flash 7.
i mean - all the "if" statements are the same aren't they and from what i read setting timelime variables is the same.
when i debug i can see it seeting the variable ok, just the "if" statement bit seems now not to work.
I'm pretty sure my frame names of "close" "starter" "stopper" "ender" etc aren't now flash 7 reserved names...
but when of course i re-publish as flash 6 and test - it works again == weird!!
must be a simple answer here i think...........hmmm
any tips appreciated
Created Flash Form In 3.0 Worked Ok Then Tried 2.0 It Doesn't
I created a form in AS3 and it worked ok except the tab order of the form field when the email returned was not correct. So I thought maybe I needed to create it in AS 2 to make it easier and more to what I am used to which is not much. I am trying to understand and I thought if someone could look at what is working and compare it to what is not well then I could fix my problem. I tried getting some help with the tab order in the AS 3 but nobody has been able to help me. I do not get an error with the AS 2 but the e-mail does not come through. I am validating the fields in the AS 2 script and it actually gets to the welcome screen in my flash but for some reason it does not get to the server. I will be going over it again.
Any help would be appreciated.
Thanks,
Hugo
Attach Code
AS2
stop();
this.contactForm.userName.tabIndex = 1;
this.contactForm.userAddress.tabIndex = 2;
this.contactForm.userCity.tabIndex = 3;
this.contactForm.userState.tabIndex = 4;
this.contactForm.userZip.tabIndex = 5;
this.contactForm.userPhone.tabIndex = 6;
this.contactForm.userEmail.tabIndex = 7;
this.contactForm.userComments.tabIndex = 8;
//----------------<send form load vars>--------------------\
var gatherForm:LoadVars = new LoadVars();
function sendForm() {
gatherForm.recepient = "invtech@drmammano.com";
gatherForm.visitor_name = contactForm.userName.text;
gatherForm.visitor_address = contactForm.userAddress.text;
gatherForm.visitor_city = contactForm.userCity.text;
gatherForm.visitor_state = contactForm.userState.text;
gatherForm.visitor_zip = contactForm.userZip.text;
gatherForm.visitor_select = contactForm.userSelect.text;
gatherForm.visitor_phone = contactForm.userPhone.text;
gatherForm.visitor_email = contactForm.userEmail.text;
gatherForm.visitor_comments = contactForm.userComments.text;
gatherForm.send("../cgi-bin/formmail.pl", "_blank", "POST");
}
//----------------</send form load vars>--------------------\
_global.style.setStyle("fontFamily", "Arial");
_global.style.setStyle("fontWeight", "bold");
_global.style.setStyle("fontSize", 12);
_global.style.setStyle("color", 0x660000);
//----------------<submit button AS>--------------------\
this.contactForm.submitBtn.btnLabel.autoSize = "center";
this.contactForm.submitBtn.btnLabel.text = "SUBMIT";
// onRollOver
this.contactForm.submitBtn.onRollOver = function() {
contactForm.submitBtn.gotoAndStop (2);
}
// onRollOut
this.contactForm.submitBtn.onRollOut = function() {
contactForm.submitBtn.gotoAndStop (1);
}
//onRelease
this.contactForm.submitBtn.onRelease = function() {
if (contactForm.userName.text == "" || contactForm.userPhone.text == "" || contactForm.userEmail.text == "") {
gotoAndStop("error");
} else {
sendForm();
gotoAndStop("correct");
}
}
//----------------<submit button AS>--------------------\
AS3
var address:String = "../cgi-bin/formmail.pl";
var url:URLRequest;
var variables:URLVariables = new URLVariables();
variables.subject = "Information Request";
variables.recipient = "invtech@drmammano.com";
function sendForm(event:MouseEvent):void{
variables.name = name_txt.text;
variables.email = email_txt.text;
variables.address = address_txt.text;
variables.city = city_txt.text;
variables.state = state_txt.text;
variables.list = list_txt.text;
variables.zip = zip_txt.text;
variables.phone = phone_txt.text;
variables.comments = comments_txt.text;
url = new URLRequest(address);
url.method = URLRequestMethod.POST;
url.data = variables;
navigateToURL(url);
}
submit_btn.addEventListener(MouseEvent.CLICK,sendForm);
Variable Script That Worked In Flash6 Stops In 7
variable script that worked in flash6 stops in 7
Bear in mind this code has been working perfectly published as flash 6, but when published as flash 7 it seems not work anymore.....
simple timeline variable stuff for documenting the position of a menubar thingy.
I set variable on _root.mainmovie timeline...
musicmenu = 0;
then when a menu drops down at different times in clip called "music"
and i set variable with....
_root.mainmovie.musicmenu = 1;
then....
if (_root.mainmovie.musicmenu == 1) {
_root.mainmovie.music.gotoandPlay("close");
} else if (_root.mainmovie.musicmenu == 2) {
_root.mainmovie.music.gotoandPlay("stopper");
} else {
gotoAndPlay("ender");
}
now - all target paths etc should be ok since it all works as flash 6.
the code is so simple that i just can't see why it's changed in flash 7.
i mean - all the "if" statements are the same aren't they and from what i read setting timelime variables is the same.
when i debug i can see it seeting the variable ok, just the "if" statement bit seems now not to work.
I'm pretty sure my frame names of "close" "starter" "stopper" "ender" etc aren't now flash 7 reserved names...
but when of course i re-publish as flash 6 and test - it works again == weird!!
must be a simple answer here i think...........hmmm
any tips appreciated
|