Quiz Problem, How To Stop, Uses With Out A Valid Name?
hi guys, im new to flash, an trying to buld a quiz application in flash,,,,
everythings are workin fine, expect few things,,,, take a look at my code:
Code:
stop();
/************************************** here we include the external file with the list of our question and answers **************************************/
/******************************************************************************* correct syntax:
domX=["Question", n° correct answer,["answer1","answer2","answer3",...,"answerN"]
******************************************************************************/ frage = [ dom1=["Wie heißt die Hauptstadt von Ägypten?",3,["Kabul","Thimphu","Asmara","Kairo"]], dom2=["Wie heißt die Hauptstadt von Vietnam?",0,["Hanoi","Honiara","Havanna","Khartoum","Maputo"]], dom3=["Wie heißt die Hauptstadt von Sri Lanka?",1,["Colombo","Sri Jayavardhanapura","Jaffna","Trincomaly"]], dom4=["Wie heißt die Hauptstadt von USA? ",2,["Wellington","Warschau","Washington","New York","Ottawa"]], dom5=["Wie heißt die Hauptstadt von Griechenland?",4,["Astana","Avarua","Antananarivo","Apia","Athen"]] ];
/*************************************/
toDisplay = 5;// how many question to display
// Random generation Questions Object.prototype.nextAnswer = function(){ ranQuestion = random(frage.length) for(var i = 0; i < frage.length; i++){ if(ranQuestion == tempArray[i]){ var prosegui = false; nextAnswer(); break; } var prosegui = true; } if(prosegui){ tempArray.push(ranQuestion); return ranQuestion; } }
// Remove the old points Object.prototype.removePoints = function(what,keep){ for(var clips in _root.box){ if(_root.box[clips]._name.substring(0,_root.box[clips]._name.length -1) == what.substring(0,what.length-1) && _root.box[clips] != _root.box[what]){ _root.box[clips].point._visible = 0 } } }
// remove old answers Object.prototype.removeAllAnswer = function(){ for(var answer in _root.box){ removeMovieClip(_root.box[answer]) } }
// Build the Question Object.prototype.buildQuestion = function() { creaNuovoArray(); countAnswer++; delete myChoice; // call function to generate a random unique question nextAnswer(); numero_domanda = "Hi "+username+" Frage #" + countAnswer;// current Question domanda = (frage[ranQuestion][0])// Assing Question txt removeAllAnswer(); // build answers; for(var i = 0 ; i < frage[ranQuestion][2].length ; i++){ nextRisposta(); duplicateMovieClip("box.answer","answer"+i,i) box["answer"+i].y_fin = answer0._y + (20*i) box["answer"+i].txt = frage[ranQuestion][2][ranAns] if(ranAns == frage[ranQuestion][1]){ box["answer"+i].thisChoice = true } else { box["answer"+i].thisChoice = false } } box.answer._visible = 0 }
// Building random answers function creaNuovoArray(){ delete tempRis; tempRis = new Array(); }
Object.prototype.nextRisposta = function(){ ranAns = random(frage[ranQuestion][2].length) for(var i = 0; i < frage[ranQuestion][2].length; i++){ if(ranAns == tempRis[i]){ var prosegui = false; nextRisposta(); break; } var prosegui = true; } if(prosegui){ tempRis.push(ranAns); return ranAns; } }
in the first frame i let user to put their name in.. so that i can print their name in each questions like a title..
what i now need is i want to block or give an error message if the user clicks on the "Play Quiz" button with out give any name,, in to the input field... i tried many ways,, nothings works,,,,,,,
please help me with this quiz thing,,, i have some other qustions fist is this one,,
many thanks in advance
-stagy
DevShed > Flash Help
Posted on: April 10th, 2005, 07:24 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Drag And Drop Quiz - Why Do Targets Keep Appearing In Subsequent Quiz Questions?
I'm trying to create an e-learning quiz that will be a series of drag and drop questions (one per page). The user will be asked a question and will have 8 images visible, but only one of them is correct. So, there are 8 drags to one target.
When the user drags an incorrect image to the target, a text image appears that says to try again, and the image will return to its original location. When the correct question is dragged to the target, a button appears that will take them to the next question. Everything was working until I started to create question 2. I created new drag and drop instances for question 2, but it seems that the images from question 1 continue to be visible in the subsequent question(s) when testing my movie. Depending on how many choices I try to drag before I pick the correct answer in question 1, I also find that some of the button states are no longer active in question 2. What I am doing wrong?
I'm new to AS3 and actionscript in general. Part of my code is based on this tutorial: http://www.monkeyflash.com/flash/drag-and-drop-in-as3/.
I'm attaching my .fla file in hopes this will help others who are having the same problem.
How To Create A Quiz With Free Quiz Template In Adobe Flash
This article will demonstrate how to create a simple online quiz, complete with options for feedback, scoring and tracking, using free Flash quiz template. Please ensure you can manage to use Adobe Flash MX, Flash 8, Flash CS3, or Flash CS4 (http://www.adobe.com/products/flash/) before attempting this.
The quiz template is included in Flash MX and above versions, and it is designed to automatically track results and send them to a learning management system configured for your quiz. Furthermore, it should be SCORM and AICC compliant for using in Learning Management System (LMS).
If you're not sophisticated with Adobe Flash editing, you might be interested in the Flash quiz tool Wondershare QuizCreator (http://www.sameshow.com/quiz-creator.html) for rapid development as replacement.
First of all, you can download a 30 day trial version of Adobe Flash from the Adobe's official website (http://www.adobe.com/downloads/).
1. Create a new Flash document choosing the existing Quiz template.
File >New > Templates tab > 'Quiz' Category > 'Modern Photo Quiz_style2 ' Template
2. A fully functional quiz with templates for Drag and Drop, Fill in the Blank, Hot Objects, Hot Spot, Multiple Choice, and True or False, will open.
3. Test the movie
Control > Test Movie
4. Save the Flash document, giving it a name.
File > Save
- Customize Quiz Template
For detailed instructions on how to edit the quiz template to your requirements, learn the official Flash quiz template tutorial at http://www.adobe.com/support/flash/a...quiz_tutorial/.
- Adding A Single Quiz in Flash
You can add any question types as a single quiz (e.g. true or false type) into your Flash document at any time, however these standalone quiz interactions, when used outside of the quiz template, are not designed for SCORM tracking in LMS.
1. If you want to insert a single quiz as learning interaction, you can just do like this:
Window > Common Libraries > Learning Interactions
2. A library of the various learning interactions will open up. Drag the one you want onto the stage.
- Alternative Flash Quiz Solution
As we know, not every user can use Flash programming perfectly to create quizzes. So over the market, there's some rapid quiz authoring tool like
Wondershare QuizCreator (http://www.sameshow.com/quiz-creator.html) to help make Flash quizzes in an easier way.
At last, for more knowledge about using Adobe Flash MX, Flash 8, Flash CS3, or Flash CS4, please refer to Adobe Flash Support Center:
http://www.adobe.com/support/flash/.
Valid 3d Equation
Can anybody tell me;
a) If this is a valid method for rendering a 3d shape
b) Does it help anyone understand 3d calculations better
http://www.nlc.net.au/~oceana/3dmenu1.swf
I looking to do a tutorial if this method is correct.
BlinkOk
Is This Valid Code?
Is it valid to do something like the following? Will it cause leaks? Will it actually delete the sndClick sound object?
Code:
setButtons = function()
{
.
. other code
.
var sndClick = new Sound(this);
sndClick.attachSound("idBuildButton");
sndClick.start();
sndClick.onSoundComplete = function()
{
delete this;
}
}
IS This Code Valid?
I am trying get a static HTML page to load into a frame using getURL as below while disabling some buttons/MC. The enabling and alpha works but the page is not loading. The getURL code works when I am not in the loadPage function, but inside it doesn't. Is this not valid?
function loadPage() {
filmMC.enabled = false;
filmButton.enabled = false;
filmMC._alpha = 50;
getURL("http://www.mysite.com/page.html", "content");
}
Is This Actionscript Valid?
I am trying get a static HTML page to load into an html frame on another static html page when a button is pressed. I am using getURL as below while disabling some buttons/MC. The enabling and alpha works but the page is not loading. The getURL code works when I am not in the loadPage function, but inside it doesn't. Is this not valid?
function loadPage() {
filmMC.enabled = false;
filmButton.enabled = false;
filmMC._alpha = 50;
getURL("http://www.mysite.com/page.html", "content");
}
Is This A Valid Statement?
Hi,
I'm trying to get some transition in my scenes but can't seem to work the "if" statement right.
if(scroll_mc._y = 5.9) {
gotoAndPlay(22)
}
When a button is release it sends a scroll pane to the bottom of the stage. I was hoping to get the movie to goto the next frame after the scroll pane had move all the way down.
Can someone shed some light?
Cheers
Schpitz
Valid / Well Formed XML
Hi!
When loading XML files is there any way of checking the file to see if it's both well formed and valid? (AS 2)
Cheers
Valid Syntax?
I have some code but I don't know actionscript, however it does look slightly wrong. Can someone please verify whether this code is valid actionscript?
again_btn.onRelease = function(){
getURL("javascript:dcsMultiTrack('DCS.dcsuri',:/corp/multiplechoice/quiz.html'"WT.ti','PlayAgain')");
}
Thanks in advance.
Valid Form To Php?
The validation of this form is working for me. My question is when all the fields are valid how can I send the form my php ?
MX Pro 2004
Code:
//validate fourm
submit_btn.onRelease = function(){
name_field.text.isEmpty("name",4);
name_field.text.isEmail();
message_field.text.isEmpty("message",10);
}
String.prototype.isEmpty = function(field,min_chars){
var str = this;
if(this == ""){
feedback =("Please fill in the " + field +" field");
return false;
}
else if(this.length < min_chars){
feedback =("The "+ field +" you entered is invalid - not enough characters.");
return false;
}
return true;
}
String.prototype.isEmail = function(){
var invalid_message = "Invalid email address";
var str = this;
var req_chars = new Array("@",".");
var bad_chars = new Array();
if(!(this.isEmpty("email",6))){
return false;
}
for(i=0;i<200;i++){
if((i>=33 && i<=45) || i == 47 || (i>=58 && i<=63) || (i>91 && i<=96)
|| (i>=123 && i<=126) || (i>=161 && i<=199)){
var char = String.fromCharCode(i);
bad_chars.push(char);
}
}
for(i=0;i<bad_chars.length;i++){
if(str.indexOf(bad_chars[i]) != -1){
var char = bad_chars[i];
feedback =(invalid_message);
return false;
}
}
for(i=0;i<req_chars.length;i++){
if(str.indexOf(req_chars[i]) != -1){
index = str.indexOf(req_chars[i]);
if(str.indexOf(req_chars[i],(index+1)) != -1 && req_chars[i] != "."){
feedback =(invalid_message);
return false;
}
}
else{
feedback =(invalid_message);
return false;
}
}
return true;
}
Before I validated the form I had the following on my submit button and it worked fine. But now I need an alternitive.
on (release) {
this.loadVariables("emailChris.php", "POST");
}
I'm fairly new to AS. I would be greatful for any help.
Scotti
Is This Valid Code? (if, Else If...)
This code doesn't seem to be working and I am wondering if I am using the if.. else if.. logic incorrectly:
ActionScript Code:
onEnterFrame = function():Void{ if(this._currentframe > 1946){ _parent.slideTo(slideX[3], slideY[3], 1, "easeInOutQuart"); } if(this._currentframe < 1946){ _parent.slideTo(slideX[2], slideY[2], 1, "easeInOutQuart"); } else if(this._currentframe > 1295){ _parent._parent.footerMC.dialoguePanel(125, -300, 300, 300, "text/tx3-4.txt"); } else if(this._currentframe > 940){ _parent._parent.footerMC.dialoguePanel(125, -140, 350, 125, "text/tx3-3.txt"); } else if(this._currentframe > 434){ _parent._parent.footerMC.dialoguePanel(125, -175, 375, 150, "text/tx3-2.txt"); }}
This code is meant to assist the fast-forward and reverse buttons catch actions that occur on the timeline as they travel along skipping 15 frames at a time, but the actions are not being caught for some reason.
If someone would point out what I am doing wrong...
Valid XML Xmlns?
I got a xmlfile in a project where xmlns xmlns="ns:uri", is this valid xml?
It certainly messes up my e4x, and i cant "grab" the namespace to remove it, since it isnt formatted like all the other xmlns ive seen.
Valid Form To Php?
The validation of this form is working for me. My question is when all the fields are valid how can I send the form my php ?
MX Pro 2004
Code:
//validate fourm
submit_btn.onRelease = function(){
name_field.text.isEmpty("name",4);
name_field.text.isEmail();
message_field.text.isEmpty("message",10);
}
String.prototype.isEmpty = function(field,min_chars){
var str = this;
if(this == ""){
feedback =("Please fill in the " + field +" field");
return false;
}
else if(this.length < min_chars){
feedback =("The "+ field +" you entered is invalid - not enough characters.");
return false;
}
return true;
}
String.prototype.isEmail = function(){
var invalid_message = "Invalid email address";
var str = this;
var req_chars = new Array("@",".");
var bad_chars = new Array();
if(!(this.isEmpty("email",6))){
return false;
}
for(i=0;i<200;i++){
if((i>=33 && i<=45) || i == 47 || (i>=58 && i<=63) || (i>91 && i<=96)
|| (i>=123 && i<=126) || (i>=161 && i<=199)){
var char = String.fromCharCode(i);
bad_chars.push(char);
}
}
for(i=0;i<bad_chars.length;i++){
if(str.indexOf(bad_chars[i]) != -1){
var char = bad_chars[i];
feedback =(invalid_message);
return false;
}
}
for(i=0;i<req_chars.length;i++){
if(str.indexOf(req_chars[i]) != -1){
index = str.indexOf(req_chars[i]);
if(str.indexOf(req_chars[i],(index+1)) != -1 && req_chars[i] != "."){
feedback =(invalid_message);
return false;
}
}
else{
feedback =(invalid_message);
return false;
}
}
return true;
}
Before I validated the form I had the following on my submit button and it worked fine. But now I need an alternitive.
on (release) {
this.loadVariables("emailChris.php", "POST");
}
I'm fairly new to AS. I would be greatful for any help.
Scotti
XHTML Valid SWF
Hey I have this:
Code:
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="800" height="168" id="head-1" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="flash/head-1.swf" />
<param name="quality" value="high" />
<param name="wmode" value="transparent" />
<param name="bgcolor" value="#ffffff" />
<embed src="flash/head-1.swf" quality="high" wmode="transparent" bgcolor="#ffffff" width="800" height="168" name="head-1" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
When I use this it doesn't show up:
Code:
<object type="application/x-shockwave-flash" data="flash/head-1.swf" width="700" height="116">
<param name="movie" value="flash/head-1.swf" />
<img src="images/head-1.jpg" width="700" height="116" alt="header" />
</object>
It needs the Embed tag it seems, i looked on google for this;
im using xhtml 1.0 strict
No Valid HTML Templates Available
Help!
(DISCLAIMER: This is on Mac OSX)
I don't know what I did, but Flash won't let me Publish, nor edit Publish Settings... keeps telling me No Valid HTML Templates available.
I reinstalled Flash 3 times, cleaning everyting I could find, and I even used a utility to reset System Privileges
So, I can use Flash fine, even export swfs just fine, but I can't Publish...
Anyone got any hints?
Cakk
Flash As Valid HTML 4.01
My flash is the last thing I cannot get to validate as valid HTML 4.01 trans. Does anybody know a way to do so?
Herk
A .swf In Valid XHTML Strict
Alright, I'm trying to put a soundloop on my blog, but I want it to remain XHTML 1.0 strict.
'Strict' doesn't allow Iframes, and transitional gives me errors.
I have tried
<iframe name="music" width=75 height=50 src="http://moments.mo.funpic.org/nucleus3.2/skins/stanch/player.html" frameborder=0></iframe>
But I get a SHORTTAG error on transitional.
Is there any way to call a .swf (with defined width and height) while remaining XHTML strict?
Flash Code Not Valid?
Hmm... I've just noticed that the EMBED and OBJECT tags that you use when inserting your flash movie into a webpage are not valid by that W3Validator thing. Does anyone have any "valid" tags??
Well Formed And Valid XML + Flash
I'm aware that using the XML Object in Flash you can fairly easily determine if the XML is well formed, but I'm also looking for a way to determine if the XML data is also "valid" as specified by a DTD - is there any pre-existing way to do this in Flash.
Ie. if my application loads "well formed" xml, but if the data isn't what I'm looking for, bad things can occur.
The help didn't seem to indicate anything along these lines
Valid Domain Names
The rules are 67 characters including the extension (e.g. .com, .net, .org, etc.). The domain name without the extension can be up to 63 characters. Only 0-9, a-z and the dash "-" are valid characters. The domain name cannot start or end with a dash.
How can I write the regular expression for this?
How Do I Refer To The Currently 'valid' Mc In A Loaded Swf
I have a base swf that dynamically loads an external swf 'loaded'swf'. Inside the externally loaded swf is a series of small swfs, only one of which is 'valid' at any time. From the base swf I want to perform an action (eg. resize) on the currently valid swf.
To identify the currently valid swf I thought I would get it to store a reference to itself in a public variable
Code:
public var currentValidMC:DisplayObject;
on the 'root' of the external swf. eg. from the valid swf use the command:
Code:
Object(parent).currentValidMC = this;
Then from the base swf I could call
Code:
loaded.currentValidMC.width = 50;
But it doesn't work, and there maybe a better way to do this (eg events).
Essentially I want a mc or sprite in the loaded swf to identify itself as the target that the base swf should perform actions on. How do I pass that mc value to the base swf so that I can perform actions and call functions on it?
Valid Html Templates
Hi Flash Gurus
I have installed Flash8 on a Mac.
All OK except it won't let me see or open 'publish settings'.
error: 'no valid html templates'
I want to produce standalone flash videos etc.
Anyone tell me how I can open 'publish settings'. I dont want to use an html editor.
Thanks!
No Valid Html Templates
i can't open publish or publish settings without getting the error message, 'no valid html templates available to complete this action'.
uh....help...please?
i have dreamweaver installed. all of my preferences are in the right places. any ideas?
No Valid Html Templates
I can't open publish or publish settings without getting the error message, "no valid html templates available to complete this operation". For some reason this has only happened to me just recently. I am using Macromedia Flash MX2004 and this is the first time I have seen something like this.
I hope this is not the result of me using the same version of Flash on different OS's. I have a PC at home but I use a Mac at school and just recently I work on my projects using both. Is there a way I can get my PC version fixed so I can publish my files?
Thanks a bunch!
How Can I Test If An URL Is Valid In Actionscript 3.0 ?
Hy, everyone!
I`m trying to make a function that tests to see if an URL is valid and return true if it is, false otherwise, so that I can use it in an 'if' statement.
The way I try to do it is by using two event listeners for the 'contentLoaderInfo' proprety of a Loader: one for Event.OPEN(if this event is dispatched, then I know the URL is valid) and one for IOErrorEvent.IO_ERROR(if this event is dispatched, then I know the URL is not valid).
But the problem is that by using the event handler functions, I leave the main URL tester function, and am unable to return a value from it. The way I thought of to get around this problem was to set a returnValue variable, to which to assign the return value of the two event handler functions and then just go 'return returnValue;'. But I don`t know how to return a value from a event handler function, and even if I did I still couldn`t do it that way, because it takes some time to dispatch those events and the 'returnValue' variable would be undefined by the time I try to return it.
I hope you understood what I tryed to explain above... Here`s some code to ilustrate this better(it`s not valid, it`s just so you understand my problem):
private function testUrl(url:String):void {
var returnValue:Boolean;
var loader:Loader = new Loader();
returnValue = loader.contentLoaderInfo.addEventListener(Event.OPEN, onGoodUrl);
// This is a global variable to which I assign the value of 'loader' so that I can close it from onGoodUrl
_testLoader = loader;
returnValue = loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onBadUrl);
loader.load(new URLRequest(url));
// Even if I knew how to make an event handler that returns a value, I`d still have to wait for the loading to start, and I couldn`t return the value here:
return returnValue;
}
private function onGoodUrl(event:Event):Boolean {
_testLoader.close();
// ???
return true;
}
private function onBadUrl(event:IOErrorEvent):Boolean {
// ???
return false;
}
You know any way to go around this problem? Or, for that matter, do you know any other way to test for a valid URL?
Thank you for your time!
No Valid HTML Templates
I have installed CS3 Web Premium on a system running Windows Vista. When I try to access the publish settings or publish a Flash project, I get the following error: 'No valid HTML templates are available to complete this operation'.
I called tech support and they said remove CS3 Web Premium and then reinstall it. I'm trying to avoid that long process. Has anyone else experience this problem and found a solution?
How Can I Test If An URL Is Valid In Actionscript 3.0 ?
Hy, everyone!
I`m trying to make a function that tests to see if an URL is valid and return true if it is, false otherwise, so that I can use it in an 'if' statement.
The way I try to do it is by using two event listeners for the 'contentLoaderInfo' proprety of a Loader: one for Event.OPEN(if this event is dispatched, then I know the URL is valid) and one for IOErrorEvent.IO_ERROR(if this event is dispatched, then I know the URL is not valid).
But the problem is that by using the event handler functions, I leave the main URL tester function, and am unable to return a value from it. The way I thought of to get around this problem was to set a returnValue variable, to which to assign the return value of the two event handler functions and then just go 'return returnValue;'. But I don`t know how to return a value from a event handler function, and even if I did I still couldn`t do it that way, because it takes some time to dispatch those events and the 'returnValue' variable would be undefined by the time I try to return it.
I hope you understood what I tryed to explain above... Here`s some code to ilustrate this better(it`s not valid, it`s just so you understand my problem):
private function testUrl(url:String):void {
var returnValue:Boolean;
var loader:Loader = new Loader();
returnValue = loader.contentLoaderInfo.addEventListener(Event.OPEN, onGoodUrl);
// This is a global variable to which I assign the value of 'loader' so that I can close it from onGoodUrl
_testLoader = loader;
returnValue = loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onBadUrl);
loader.load(new URLRequest(url));
// Even if I knew how to make an event handler that returns a value, I`d still have to wait for the loading to start, and I couldn`t return the value here:
return returnValue;
}
private function onGoodUrl(event:Event):Boolean {
_testLoader.close();
// ???
return true;
}
private function onBadUrl(event:IOErrorEvent):Boolean {
// ???
return false;
}
You know any way to go around this problem? Or, for that matter, do you know any other way to test for a valid URL?
Thank you for your time!
Replay Button - Is This Valid?
I have a replay button which reloads a flash movie and seems to work fine:
<<Begin Button Code>>
rewindButton.addEventListener(MouseEvent.CLICK, rewindClickHandler);
function rewindClickHandler(event:MouseEvent):void {
SoundMixer.stopAll(); // My replay button doesn't appear until all sounds have started so this works fine.
var urlRequest:URLRequest = new URLRequest("ctrmenu.swf");
var urlLoader:Loader = new Loader();
urlLoader.unload(); //<--- Is this even a valid attempt to unload the movie prior to reloading?
urlLoader.load (urlRequest);
stage.addChild (urlLoader);
}
<<End Button Code>>
This seemed a lot easier than placing a replay button at the end of the movie and using gotoAndPlay() considering that I have everything on one frame of the main timeline outside of independent movieclip timelines. However, am I asking for possible recursion trouble loading my movie into itself? I am not even sure my call to UrlLoader.unload(); is even valid since I obviously didn't use UrlLoader to load the first instance of the movie. Also, on another note, I have a question concerning the "import" usage. For instance, all of the examples that I have seen that cover the TIMER class use:
// Import the utils package for the TIMER class
import flash.utils.*;
or something similar to import the TIMER class. However, I can delete this from my movie and my timers still work fine. The same holds true for importing SOUND classes. If so, why use the import? I think I am missing something here.
Check For Valid Email
really simple question: how do i make sure a user has entered a valid email address. i basically just want to make sure the input field contains an "@" sign. this is the code im using but its not working...
ActionScript Code:
submit.onRelease = function() { if (email.indexOf("@") == -1) { formStatus.text = "please enter a valid email address"; } else { formStatus.text = ""; trace("email is valid"); }};
ive been searching the forums for about 45 minutes with no luck. i know this is totallly easy but i guess im just missing something...
any clues?
thanks!
XHTML Valid Source
So I searched around all over the internet and VERY few flash sites are XHTML valid.
I've generated the following code with thanks to Kirupa's flash object generator as well for an XHTML VALID flash page.
Enjoy ( fully commented on what you need to change )
HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>****PUT YOUR PAGE TITLE HERE****</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style type="text/css">
<!--
body,html
{
margin:0px;
padding:0px;
height:100%;
}
-->
</style>
</head>
<body>
<!-- REPLACE FOLLOWING USING http://www.kirupa.com/developer/flash8/flash_fix.htm TO GENERATE CODE AS WELL AS DOWNLOAD THE FLASH OBJECT JAVASCRIPT FILE FROM THAT PAGE -->
<script type="text/javascript" src="flashobject.js"></script>
<div id="flashcontent" style="width: 100%; height: 100%"></div>
<script type="text/javascript">
var fo = new FlashObject("finalIndex.swf", "animationName", "100%", "100%", "8", "#F1F1F1");
fo.addParam("allowScriptAccess", "sameDomain");
fo.addParam("quality", "high");
fo.addParam("scale", "noscale");
fo.addParam("loop", "false");
fo.write("flashcontent");
</script>
</body>
</html>
Is This Tutorial Valid For Flash 8 Pro
Hi
I was just reviewing this tutorial http://kirupa.com/developer/flash5/newwindow.htm which covers opening a page without browser controls, menu bar, etc.
I was wondering if this is valid for Flash 8 Pro. If not could you please direct me to a similar tutorial.
Thanks for you help,
Mark
Checking If A Path To FLV Is Valid
I can't seem to figure out a way to check if a filepath supplied to a FLVPlayer component is valid or not - as in the player will fail, but I don't know how to ACT on it. I tried various try-catch and I tried listening for stuff - nothing seems to work. This is AS2 I'm concerned with.
Any help or hints greatly appreciated.
Flash And Valid Html - Possible?
Hi,
I have read a few posts about this subject, and read the flash satay article at a list apart but to no avail. So here's my questions. Can you embed flash in your web page and still have it validate?
At the moment I am using the code that Flash outputs. I tried the code from A list apart but I didn't understand the whole 'container' movie concept (flash noob here) and couldn't get it to work.
So if anyone can help me out it would be much appreciated, I would really prefer my page to validate (it does without the flash )
Thanks.
[AS3/OOP] Checking Valid Values
If you attempt to set stage.scaleMode to anything other than one of the accepted values Flash will throw an error: "Parameter scaleMode must be one of the accepted values."
Does anyone know how the Stage class checks if the value is valid?
I can think of two obvious ways, the first way would be to check the value within the Stage.scaleMode setter...
ActionScript Code:
public function set scaleMode( value:String ):void
{
switch( value )
{
case StageScaleMode.EXACT_FIT:
case StageScaleMode.SHOW_ALL:
case StageScaleMode.NO_BORDER:
case StageScaleMode.NO_SCALE:
break;
default:
throw new ArgumentError( "..." );
}
// ...
}
...the other way would be to pass the value to a method in the StageScaleMode class that checks the value and passes back a boolean...
ActionScript Code:
public static function isValid( value:String ):Boolean
{
switch( value )
{
case EXACT_FIT:
case SHOW_ALL:
case NO_BORDER:
case NO_SCALE:
return true;
default:
return false;
}
}
...then the setter in the Stage class can use that...
ActionScript Code:
public function set scaleMode( value:String ):void
{
if( StageScaleMode.isValid( value ) )
{
throw new ArgumentError( "..." );
}
// ...
}
After looking at this I think that the first method ( checking the value within the setter ) would probably be the best option, but as usual I would like to hear your thoughts on this. Are there any better methods that you can think of?
I have thrown the StageScaleMode class through the describeType method and couldn't see any validation methods in there, so I guess the checks must be happening with the Stage setter.
Checking Valid Email Address
hey
i'm trying to make a sign up password movie in flash
and i need the code to check if the email address field is a valid email address
eg. bob@bob.com valid
bob@bob not valid
etc etc
thanks
EXECUTE String Into Valid Array?
Howdy,
Trying to load an array from a text file (and later, a data source).
Text file contains:
------------------
quotes=["Flash is cool","Flash roxx"];
------------------
The file gets loaded, but the array does not establish - it just creates a variable "quotes" that contains the string ["Flash is cool","Flash roxx"];.
How do I execute that string into a valid array?
thanx.
Flash: No Valid HTML Templates?
I just tried to export in flash and it says No valid HTML Templates available to complete this operation. Why is it saying that and HOW do I fix it? Id like to be able to publish some of this.
Valid URL -> Xml.load(URL) -> Error Opening URL
Hi all,
I am facing a pretty strange problem. Trying to get Flash 8 connected to a database I am adressing a php script which generates a xml string depending on the sql which is attached to the query.php.
If I open the URL in a browser everything works fine. To show an example:
Code:
sql = "SELECT fo_posts.ID, fo_posts.post_status FROM fo_posts"
xml result looks:
Code:
<?xml version="1.0" encoding="iso-8859-1"?>
<response>
<result><record>
<field name="ID">1</field>
<field name="post_status">publish</field>
</record>
<record>
<field name="ID">2</field>
<field name="post_status">static</field>
</record>
<record>
<field name="ID">3</field>
<field name="post_status">publish</field>
</record>
<record>
<field name="ID">4</field>
<field name="post_status">attachment</field>
</record>
<record>
<field name="ID">5</field>
<field name="post_status">publish</field>
</record>
</result></response>
But everything I get in Flash is:
Error opening URL "http://127.0.0.1/db-flash/
scripts/queryDB.php?sql=SELECT%20fo%5Fposts%2EID%2C%20fo%5 Fposts%2Epost%5Fstatus%20FROM%20fo%5Fposts"
I already searched the forum, tried to upload the stuff and change publish settings to "Access Network only" ... but I didn't work too
The strangest thing is that another project which was built on Flash MX 2004 works fine ... even if it's adressing the same localhost (just another database)
does anybody know how to solve this problem?
many thanks in advance
Linkage Wont Take Subclass As Valid
What I'm trying to do is to have 2 movieclips in the library called Info1 and Info2. Info2 extends Info1.
Info1:bare bones of title, main text, and scrollbar
Info2:extends Info1
adds a picture and links
The problem is in the library, I can't set the linkage to Info2 because I get complier errors saying my instances are undefined. Therefore I have to link to Info1. However, each linkage needs to be a unique identifier, therefore Info1 can't link to Info1.
If that makes sense, can you see my problem and a way to fix it, while maintain the structure I have (or at least a good one)? I could just copy and paste all of Info1 into Info2, but that doesn't seem like very good OO to me.
p.s. I've tried doing what Senocular said here however, it wont let me add superclasses as a base class and have a class path for the linkage ID.
Where And How To Require A Valid Email Address..
Below is the action script I have for my contact form. However, if the user enters only one character in the "email_box," the email can still be sent. I want the email_ box to be forced to have the "@" before it can be sent. Where and how?
Thanks...
Attach Code
stop();
Selection.setFocus("email_box");
email_box.tabIndex = 1;
subject_box.tabIndex = 2;
message_box.tabIndex = 3;
System.useCodepage = true;
send_btn.onRelease = function() {
my_vars = new LoadVars();
my_vars.sender = email_box.text;
my_vars.subject = subject_box.text;
my_vars.message = message_box.text;
if (my_vars.sender != "" and my_vars.subject != "" and my_vars.message != "") {
my_vars.sendAndLoad("mailer.php", my_vars, "POST");
gotoAndStop(2);
} else {
error_clip.gotoAndPlay(2);
}
my_vars.onLoad = function() {
gotoAndStop(3);
};
};
email_box.onSetFocus = subject_box.onSetFocus=message_box.onSetFocus=function () {
if (error_clip._currentframe != 1) {
error_clip.gotoAndPlay(6);
}
};
Checking Valid Paths From Within Flash
Hi,
I'm making a tool for users to enter the filename of a video in an input box. From here the users click a "next screen" button. I'm trying to write some code that will verify if the filename provided will actually find a video on the user's system. I've been trying to load the file into an empty movie clip, and I can get it to load ok. My problem is, I'm having trouble writing a catch statement when the movie ISN'T found. Is there a better way of doing this? I tried using .onData event handlers to see whether or not this could be my control statement, but I haven't figured it out yet. Any bright ideas?
Thanks
Valid Dates Within Flash Without Components? Possible?
Is it possible to ensure valid dates within flash without using the Date components?
I am making a form where the user defines both their date of birth and a reservation date.
Sadly, I have been told that my database spits nuts and bolts if you give it an invalid date.
Have tryed the Date component. It works well for reservations. But when it comes to Date of Birth it wouldn't work cause scrolling 20 odd years month by month would be too painful for a user.
I know its a bit of a big question. I will get someone to do it with ASP if this is too much of a nightmare in Flash.
Cheers for any help or suggestions...
Checking Valid Paths From Within Flash
Hi,
I'm making a tool for users to enter the filename of a video in an input box. From here the users click a "next screen" button. I'm trying to write some code that will verify if the filename provided will actually find a video on the user's system. I've been trying to load the file into an empty movie clip, and I can get it to load ok. My problem is, I'm having trouble writing a catch statement when the movie ISN'T found. Is there a better way of doing this? I tried using .onData event handlers to see whether or not this could be my control statement, but I haven't figured it out yet. Any bright ideas?
Thanks
Valid XHTML Preloader Problems
Hello all,
I have a preloader that isn't working in IE 6.0 Win but works well in the other browsers I've tested it in (Firefox, Opera). In IE the preloader isn't displayed and the movie only starts after the preloader is 100% finished. The other browsers show the preloader fine.
Here's the HTML code for it that works in the other browsers
Code:
<object type="application/x-shockwave-flash" data="images/main.swf" width="600" height="200">
<param name="movie" value="images/main.swf" />
</object>
If I want it to work properly in IE though I need this...
Code:
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="600" height="200" id="intro">
<param name="movie" value="images/main.swf" />
</object>
...but then it doesn't even show up in Firefox. I've done some tests and it's the classid and codebase attributes that make the difference. Is there a way to fix this and keep it XHTML valid?
No Valid HTML Templates Error
Hi,
Okay. Using Flash MX on a G4 running OSX.
On program launch returns the error 'An unknown error occurred while accessing an unnamed file' (I just LOVE that message - soooo helpful).
Program continues to load okay, and everything seems fine until you go to either 'Publish' or 'Publish Settings'. Then we get the 'No valid HTML templates are available to complete this operation' error and will not publish.
Have tried uninstalling/reinstalling (although I get the feeling i may be missing some prefs somewhere - any help on clearing out flash entirely would be useful).
Anyone come across this one before?
Thanks in advance for any help.
c:)
Checking For Valid Email Address
how can i check and see if someone has entered a correct email address, ie someone@someone.com, rather than just random text.
any help would be greatly appreciated.
gkc
|