Flash Save Error Resulting In Total Loss Of FLA
So, you try and save your Flash document, it says it can't do it because the file is read-only, or is open somewhere else or the destination is unavailable or something (when clearly none of these is true). Then you try and save it somewhere else and it won't let you. Meanwhile, it has deleted the original file when you tried to save over it.
So, now there's no document and i can't save the one I have open. What do I do? This isn't the first time this has happened, but it's never been such an issue before now because me and my colleague are about to lose a shedload of work. I think the network drive we work on must've have become temporarily unavailable and now Flash has gone mad. Any ideas? Pleaaaaassssse?
Before you ask, retirieving a server backup is not an option in this particular case.
Anyone else had this? This is such a huge problem surely it must've already been covered, but i've searched the forums and found nothing.
ActionScript.org Forums > Flash General Questions > Flash 8 General Questions
Posted on: 01-17-2007, 02:59 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Error #2048 -- At A Loss
I've got some strange stuff going on. I have a SWF that is hosted on server A. I have a php file on server B that processes forms. My SWF sends form information to server B and expects to get a set of variables returned (form processed successfully or not).
The SWF is built in AS3. The code is written like this:
Code:
// SEND FORM INFO
//-- collect variables
var variables:URLVariables = new URLVariables();
variables.email = txtEmail.text;
//-- set up request for URL
var myRequest:URLRequest = new URLRequest();
myRequest.url = "https://services.processingserver.com/postdata/";
myRequest.method = URLRequestMethod.POST;
myRequest.data = variables;
//-- process loader
var myLoader:URLLoader = new URLLoader();
//myLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
try
{
myLoader.load(myRequest);
}
catch (error:ArgumentError)
{
trace("An ArgumentError has occurred.");
txtPrompt.text = "SERVER ARGUMENT ERROR";
}
catch (error:SecurityError)
{
trace("A SecurityError has occurred.");
txtPrompt.text = "SERVER SECURITY ERROR";
}
myLoader.addEventListener(HTTPStatusEvent.HTTP_STATUS,httpStatusHandler);
myLoader.addEventListener(IOErrorEvent.IO_ERROR,errorHandler);
myLoader.addEventListener(Event.OPEN, openHandler);
myLoader.addEventListener(ProgressEvent.PROGRESS, progressHandler);
myLoader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);
myLoader.addEventListener(Event.COMPLETE,completeHandler);
....
function securityErrorHandler(e:SecurityErrorEvent):void
{
txtPrompt.text = "SERVER SECURITY ERROR - "+e.text;
}
It works fine when I test it from a local file. However, when I post the form SWF to the live server, it returns an Error #2048, triggered by the securityErrorHandler function.
The remote server has a crossdomain.xml file, and the server that the SWF is posted on has the file too. This is the code in the xml file:
Code:
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy
SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-access-from domain="*" secure="false"/>
</cross-domain-policy>
I've tried adding this code to the SWF:
Code:
Security.allowDomain("*");
Security.loadPolicyFile("https://services.processingserver.com/crossdomain.xml");
What am I doing wrong?
Best,
--eric
Total~1.scr File Missing Error
Please help!
I made a flashmovie with flash5 on a mac. Now I'm trying to get it to run on a pc with MX. The movie opens without complains and I can export the movie as well.
BUT when I try to open an exported or published file I get: Cannot find total~1.scr file ... needed to open files with shockwave flash extension...
?!
Does anyone know what the problem is?
thanks
.fla Disapears From Mac After Save Error
you haven't got a clue what just happend to me!
Working on a hugh flash website, saving every 30 min or so. I try to save again...flash cs3 gives me an error about the location of the file, select the file after changing the destination. All ok normally, it says no way im gonna save that file for you. Can't access it! OMFG! what?
Can't save it anywhere..not with another name..on desk or in another file. Changed name..save...Error... and so on.
Only 1 thing left to do. click exit...save (yes please, but cant do).
Now the complete file is gone like....poef!...not even in trash or someting like that...just completely gone...:S
I've seen some crazy moves by flash but this is totally ******.
If somebody can tell me where to go look for the file or if its really gone? i'm gonna try to recover the file with some third party software. not sure if its any good though.
---> File (backup) saved at local folder (httpdocs) --> www/project ( you know what i mean).
---> working on the file (website.fla) ---> located on desk.
Opened website.fla from my desk..worked on it for 5 hours (saving every 30 min).. all ok. But on next save after 5 hours.. It says..cant save wrong directory.. changed directory back to desktop (must have changed it to the httpdocs). press save..error... cant access it..blabla. Changed name website1.fla (press save) same errors...?!?
Exit flash (all files GONE!) also the 1 i was not working on in my http directory. I mean..that's weird?
Please help.
Carel
Edited: 10/22/2007 at 11:23:22 AM by Carel1
Failed To Save Document Error?
This is very frustrating! I have one file open in Flash MX and am trying to save it. Every time I try to save it I get a "failed to save document error". It does not matter whether I try the save command or the save as command. I have no other programs open on my computer at all. Does anyone know how I can save this fla????
thanks in advance!TC
Total Visits/total Sound Plays
How can I get a "total visits"type function but instead of recording the number of visits, it records the number of sounds streamed from that flash movie and makes it visible
Total Visits/total Sound Plays
How can I get a "total visits"type function but instead of recording the number of visits, it records the number of sounds streamed from that flash movie and makes it visible
Total Visits/ Total Sounds Played
How can I get a "total visits" type function that makes the number of times a page has been visited visible, but instead of recording the number of visits, it records the number of sounds streamed from that flash movie and makes it visible. (Not pages but externally loaded and streamed sound.)
tks
ken
Publishing And The Resulting Html File
Why does the html file that is generated (when you Publish a movie) have a section in it for text you used in the movie? What purpose does this serve?
I figured out how it's getting in there (the default.html template), and I can remove it (take out the $MT string from the default.html template), but I am trying to figure out why it's even there in the first place. Same with the $MU, who cares what the movie URL is??
Any ideas?
Thanks,
mark ;)
Array Sorting, Resulting In MC Placement
Hello everyone, I've run into a bit of a problem and I'm pretty stuck. I've searched all over the forum with some luck, but not enough to solve my issue.
What I'm attempting is a simple menu that can be sorted according to three categories, each of which is contained in an array. Name(alphabetically), color(also alphabetic) and date(numeric). The way it's set up thus far is there are 12 instances inside a mc, each adding to 3 separate arrays according to the information they contain.
this code is on a MC with the instance name of floogins:
Code:
onClipEvent(load) {
_root.listSort.name[0] = "floogins";
_root.listSort.type[0] = ["red", "floogins"];
_root.listSort.date[0] = [12, "floogins"];
}
the mc's that follow are basically the same with the exception that they add different info to higher index numbers.
So each of the arrays is filled with 12 bits of data.
// sort by name:
Once the user presses the button to sort the mc's alphabetically, I'm using
_root.listSort.name.sort(); which works great, and I'm able to arrange the data on the screen because the instance name is what's being sorted in the array.
//sort by color:
I'm also sorting these alphabetically using _root.listSort.type.sort(); this puts all the reds together, all the blues together, and so forth and I'm able to reference the instance name since it's contained within the nested array.
//sort by date:
here's the problem, I'm trying the same technique that was used for the color, but when I add a second piece of info to the nested array, AS starts looking at the info like a string instead of a number and using the sort(16); doesn't work correctly. I'm ready to just start using a,b,c etc. instead of numbers, but I'd rather figure this out.
I guess the bottom line is, once the data is sorted, I need to figure an efficient manner of referencing the correct instance that the sorted info came from.
Any ideas would be much help.
Thanks.
Simple Arithmatic Function Is Not Resulting In Zero
This is absolutely bizarre. 2.4 - 1.2 = 1.2 and 1.2-1.2 = 0, or so you'd think, except that Flash keeps telling me 1.2 - 1.2 = -4.44089209850063e-16. Subtract 1.2 once more from -4.44089209850063e-16 and you miraculously get -1.2. Even more bizarre is that this only happens if the starting value is greater than 2.4.
See attached code which began as something much more complex but I've commented out absolutely EVERYTHING except for this little bit of math and yet it keeps telling me that 0 is -4.44089209850063e-16. But only if rpm is greater than 2.4 to start with. If it's 2.4 or less, it does get to zero.
Thanks for any help.
Attach Code
class MotorControl extends ClipButton {
private var rpm:Number = 4.8;
//
public function MotorControl() {
this._parent.rotations_txt.text = String(rpm);
}
//
private function onRelease():Void {
rpm = rpm-1.2;
trace (rpm);
}
}
Recorded A Stream, But Can't Rename The Resulting Flv
I have a simple server-side app that creates a Stream, creates a NetConnection, and then plays a live stream from that NetConnection. I record the resulting stream into a file, say "recordstream.flv"
When I get an UnpublishNotify, I stop recording. When I see NetStream.Record.Stop, I create a File object that points to recordstream.flv, and try to rename it to a different filename with File.renameTo().
This worked in FMS2, but not in FMS3. In FMS3, I get an error that the renameTo() failed. Interestingly, copyTo() the same new filename works, so it is not a directory protection issue or something like that. It appears that FMS3 is forbidding me from fiddling with the file; File.canRead returns false on the file. Is there any way to get FMS3 to release the file? Or should I give up and just use copyTo()?
Array Sorting, Resulting In MC Placement
Hello everyone, I've run into a bit of a problem and I'm pretty stuck.
What I'm attempting is a simple menu that can be sorted according to three categories, each of which is contained in an array. Name(alphabetically), color(also alphabetic) and date(numeric). The way it's set up thus far is there are 12 instances inside a mc, each adding to 3 separate arrays according to the information they contain.
this code is on a MC with the instance name of floogins:
Code:
onClipEvent(load) {
_root.listSort.name[0] = "floogins";
_root.listSort.type[0] = ["red", "floogins"];
_root.listSort.date[0] = [12, "floogins"];
}
the mc's that follow are basically the same with the exception that they add different info to higher index numbers.
So each of the arrays is filled with 12 bits of data.
// sort by name:
Once the user presses the button to sort the mc's alphabetically, I'm using
_root.listSort.name.sort(); which works great, and I'm able to arrange the data on the screen because the instance name is what's being sorted in the array.
//sort by color:
I'm also sorting these alphabetically using _root.listSort.type.sort(); this puts all the reds together, all the blues together, and so forth and I'm able to reference the instance name since it's contained within the nested array.
//sort by date:
here's the problem, I'm trying the same technique that was used for the color, but when I add a second piece of info to the nested array, AS starts looking at the info like a string instead of a number and using the sort(16); doesn't work correctly. I'm ready to just start using a,b,c etc. instead of numbers, but I'd rather figure this out.
I guess the bottom line is, once the data is sorted, I need to figure an efficient manner of referencing the correct instance that the sorted info came from.
Any ideas would be much help.
here's the .fla, this one works but only because I changed the date array's numerical value to be a,b,c etc. but I'd much prefer to use the numerical value to sort.
Thanks.
Array Sorting, Resulting In MC Placement
Hello everyone, I've run into a bit of a problem and I'm pretty stuck.
What I'm attempting is a simple menu that can be sorted according to three categories, each of which is contained in an array. Name(alphabetically), color(also alphabetic) and date(numeric). The way it's set up thus far is there are 12 instances inside a mc, each adding to 3 separate arrays according to the information they contain.
this code is on a MC with the instance name of floogins:
Code:
onClipEvent(load) {
_root.listSort.name[0] = "floogins";
_root.listSort.type[0] = ["red", "floogins"];
_root.listSort.date[0] = [12, "floogins"];
}
the mc's that follow are basically the same with the exception that they add different info to higher index numbers.
So each of the arrays is filled with 12 bits of data.
// sort by name:
Once the user presses the button to sort the mc's alphabetically, I'm using
_root.listSort.name.sort(); which works great, and I'm able to arrange the data on the screen because the instance name is what's being sorted in the array.
//sort by color:
I'm also sorting these alphabetically using _root.listSort.type.sort(); this puts all the reds together, all the blues together, and so forth and I'm able to reference the instance name since it's contained within the nested array.
//sort by date:
here's the problem, I'm trying the same technique that was used for the color, but when I add a second piece of info to the nested array, AS starts looking at the info like a string instead of a number and using the sort(16); doesn't work correctly. I'm ready to just start using a,b,c etc. instead of numbers, but I'd rather figure this out.
I guess the bottom line is, once the data is sorted, I need to figure an efficient manner of referencing the correct instance that the sorted info came from.
Any ideas would be much help.
here's the .fla, this one works but only because I changed the date array's numerical value to be a,b,c etc. but I'd much prefer to use the numerical value to sort.
Thanks.
Flash 8 Color Loss
I have purchased a template for a Flash web site. My problem is that I made a few changes. The test show the screen as I planned it, but when I publush the movie and transfer to the server I lose the bottom half background color. It turns white and makes it hard to see the animation. Any suggestions?
Best Video Results Beginning With FLA ... Eventually Resulting In FLV
Hello All,
My goal is to implement what would appear to be a video animation on my site. My first attempt was by way of a loader component pulling an external SWF (roughly 2MB in size). I had impremented a preloader so the loading wasn't an issue. The issue arose during playback ... it was extremely 'jerky' and it didn't play smooth ... like the original SWF.
So I've chosen to go a different route ... FLV. Please keep in mind the animation that I want to play contains no sound and consists of a series of over 150 PNG images, pulled into Flash (resulting in over a 300 frame FLA). To this point, I've exported to MOV (producing an amazingly high quality video) then used the Flash 8 Video Encoder (with the following settings: Flash 8 - High Quality (700kbps), Video codec: On2 VP6, Quality: HIGH) to produce an FLV. The resulting FLV file quality is terrible.
The MOV file is just under 20MB and the resulting FLV is just under 1MB. I'm very disappointed with the video quality. As mentioned above, the original images are high quality PNG files ... the MOV file produced looked great, but the FLV appears to contain extremely LOW res images. Would you guys have any suggestions to attain better results?
Thanks in advance for your help.
Body Of Text Resulting In High CPU Usage
Hi guys
My problem is that when I place a large body of text in one of my Flash movies (+- 30 lines or more even less), when played the CPU usage goes through the roof, using static or dynamic alias/ant-alias, scrolling/no-scrolling, embedded or system fonts, it's all the same.
I have encountered this issue a number of times before so I'd just like to ask you guys if I'm correct by stating the following:
To keep the cpu load down I should:
1. Save the body of text as a transparent giff, this is not ideal if your text is dynamic
2. use small bodies of text.
3. ??? I have no idea what else to try
So basically is the only way to keep the CPU load down to use a giff?
Thanks very much for your help.
Mac
Xml Image Gallery Loader Resulting In NaN When Online...
So... I'm still no expert at anything AS related, but I'm learning. Here's the problem. I have a listbox pulling images using an xml file. The jpgs are about 90k each, and when you click an item in the listbox there seems to be nothing happening, but really the image is just loading. Then it shows up. Yadda yadda... long story short, I'm putting in a loader to let the user know that there is something happening. When I publish and test locally no problem. When I put it up online you don't see the loader, and if you click through the images you get a NaN. I know that usually means there's an unidentified variable, but why would it work fine when I test? Obviously, I don't have the experience in troubleshooting this type of problem to even know where to start. I'm on my 3rd revision of the code, all ending up with the same results. Here's a link to the online version, and below is my code.
FYI - the images are gross... sorry.
Click "Images" then "Pedigree Selection" The rest of the sections are not available yet.
Code:
var xml:XML = new XML();
xml.ignoreWhite = true;
xml.onLoad = function () {
var photos = this.firstChild.childNodes;
for (i=0; i<photos.length; i++){
photoList.addItem({label:photos[i].attributes.desc, jpg:photos[i].attributes.jpg, info:photos[i].attributes.info});
}
photoList.selectedIndex = 0;
}
xml.load("conformation.xml");
var PList:Object = new Object();
PList.change = function(evt_obj:Object) {
var item = evt_obj.target.selectedItem;
textHolder.text = item.info;
infoField._visible = true;
startLoading(photoList.getItemAt(photoList.selectedIndex).jpg);
function startLoading(whichImage) {
loadMovie(whichImage, "photoHolder");
infoLoaded = photoHolder.getBytesLoaded();
infoTotal = photoHolder.getBytesTotal();
percentage = Math.round(infoLoaded/infoTotal*100);
infoField.text = percentage+"%";
if (percentage>=100) {
delete this.onEnterFrame;
infoField._visible = false;
};
}
}
};
Any ideas?
[F8] Loss Of Gradient From Illustrator To Flash
Hi i've done up a vector image of a plane with alot of gradient fills on different parts of it.
I exported this vector file to swf format and then opened it in Flash 8, discovered that the entire plane came out in large 'mosaic' form!
E.g. the body of the plane is now one huge rectangular shape. All the form is lost and so are the gradient.
Does this mean Flash can't handle imported vectors with gradient?
Can someone suggest how can i fix it?
I do need the vector image in Flash cos i need to animate it.
Your help is much appreciated!
Can Flash Detect Loss Of Focus?
Specifically - can Flash perform an action when it detects the user has click out of the aplication OR web browser it was embedded in?
I read a few ways that I could maybe pass the information from javascript but that seems clunky and may not even do what I want.
Imagine if you only wanted a movie to play and when the user clicks out of the flash it pauses it.
Any ideas? Been looking at FocusManager but it all seems individual component based - maybe I'm missing something obvious.
Thanks for any help (I did a search but to no avail)
Flash Data Text - Format Loss With IE
I have a website that is all flash. I have a main file that loads in the nav and then the nav loads in the designated .swf file for each section. So there are several sections(.swf's) with lots of text taken from a database and inserted into the swf file from an XML file. If I click in between sections, and go back to the original section of text the formatting is lost. This is only in Internet Explorer 7- this does not happen in Firefox or on the Mac. Any help would be greatly appreciated.. This seems like a major bug.
How-to Compile Slideshow Source Images Into The Resulting Swf Output File
what i want to do is make actionscript 2.0 slideshow with static list of images. i have already found numerous articles that describe how to load and loop images. the only problem is that i don't know how to tell compiler to compile source images into the output swf file. (i'm using mtasc compiler).
Total Visits/total Plays
How can I get a "total visits"type function but instead of recording the number of visits, it records the number of sounds streamed from that flash movie and makes it visible
Total, Total Newbie Question
Um, i cant quite get my character, call him bob, to fall and walk, jump and turn around on a platfrom. this is the basis for all my games!
Loss Of Effects When Transfering Files From Photoshop Into Flash
Hi, I need help with a website i'm doing for my Uni project, i'm trying to transfer images from photoshop into flash. I can do this, however i need a transparency layer, so have been saving my files as gifs to do this. The problem is that my images have gaussian blured border effects but when i get them into flash the conversion has taken this away and i am just left with a hard edged image. What am i doing wrong? Thanks for your help in advance.
Total Flash Help
Completly new the the flash 5 world, got no idea about coding or anything to be honest, i'm just wondering if anybody knows a good site that would explain the basics of flash 5 (i need XP) thanks in advance.
Im A Total Newbie In Flash Help
how the **** do all make flash? i have flash 5 and dont understand that **** tutorial and om totaly angry ARGHHHHHHHH how where when why i do asc you! >
How To Know The Total Time Of The Flash.
in flash, i want to load other swf, but how can i to know totaltime of the swf when i load it. and how can i to control this swf. e.g. play, stop, slide bar....
like this e.g. http://www.macromedia.com/software/c...ures/brz_tour/
thx thx thx
Total Newcomer To Flash
Hello everyone. I am sorry for the style of this post, I wouldn't normally resort to this but I am very new to Flash and a 3D person, 2D kind of confuses me!
I need to create a site, it's fairly simple in design but I have a feeling it may become a bit complex. It has to be entirely Flash, the image below will hopefully explain what I need. What I want to know is if I should create seperate Flash movies for each page then combine it all later, or build the entire site in one large Flash file?
[IMG]http://img529.imageshack.us/img529/3158/webhelpco3.jpg[/IMG]
How simple is it to have the slider reveal an alternate image only on that section?
Is it possible for the slider to be white with transparency?
Is it possible for the navigation system to travel along with the slab?
Can I have the slab move when the cursor nears the edges?
All I need is a yes or no answer and a simplicity scale, I am happy to research based upon initial guidance.
Any help would be hugely appreciated.
Many thanks.
Andrew.
Total Training Flash 8
dont know if this is the right place, but i have flash 8 for total training for sale. anyone interested??
sorry if this is the wrong place.
MXform To Php Mail() Displays French Chars Wrong In Resulting Mail ¿¿¿
hi there,
hope somebody can help me on this one, can't find it out - I'm still new to php
I'm using a simple PHP scipt to send e-mails form a Flash MX website's form to just one mailbox.
it works fine, except one prob: the website is in french and the special characters of the language apear wrong in the resulting e-mails : é,ô,ï,ç,etc ... the latin 1 supplement character range is not displayed correctly . The concerning characters only show up correctly in the mails when i set the textformat of the mail client to utf8 (no wonder isn't it) . but this is not desierable .... is there any other way to get it sorted ... (please no Sysem.useCodepage = true; stuff , which is kind of uneffectiv with different platforms: Mac -PC use different codepages)
mayby: what can i do to the utf8 encoded mailbody variable in PHP to make it show the accented chars ?
extract of what i tried :
snip
$mailContent = "$mailBody";
$mailMessage = utf8_decode($mailContent);
mail(.....,....,$mailMessage,...);
snip
but the script wouldn't sent mails anymore
thanx for reading and help !
bingo
File Save Error Erases .fla File
I just had a near catastrophe happen...
I had Flash MX 2004 Pro up and a movie file open that I saved Fri before going home. Monday I didn't get to the file but it was still up in my Flash app. Today I went and made changes to the file and tried to Save. It brought up the Save As dialog for some strange reason and had movie.fla.fla as the suggested file name. I changed it to movie.fla and it asked if I wanted to replace it. I said yes and then it gave me an error msg saying it could not be saved (no more details than that). I then tried Save and gave it a new file name. It gave the same error msg. I then tried Save As and a new file name and it too gave the same error msg. I don't recall exactly but it may have said it couldn't save due to a network error. I was trying to save on a file server across the network. I finally decided to quit out without a save since the changes I had made were minimal and could easily be redone. After quiting out, I went to open the movie.fla file and it was GONE!!! Apparently when I said yes to overwrite the file, it dumped it and then failed to write the new version!!! I ended up with NOTHING! Macromedia...are you listening...How about writing a new file and if no errors, THEN dumping the older version. If not for a backup done nightly here, i would have been set back weeks of work!!!
Total Newbie Flash Question
Hey guys, I'm completely new at flash... just started today actually. I want to create a nice-looking site for my web site design business and I decided to go with flash. So far I have created the animations for each 'page' (just spaced them 5 frames apart with stop commands at the end of each animation) and they all work fine. What I have done is created buttons at the top which will skip to the appropriate 'page'. My problem is though that these buttons refuse to work. I have inserted key frames into the 'over' and 'hit' animations. I have set it so the buttons turn light blue (up state is white) in the over state, and then attached a script to skip to frame whatever. But when I export the file the buttons do not turn blue when hovered over and they don't do anything when clicked (although it does turn the cursor into the hand like it is a link). Sorry if this is a really dumb question but any help would be appreciated. Thanks!
Using Flash To Get The Total Number Of File In Ext Folder
I understand that is is possible for php (or any other server script) to get the total number of file in a specific folder.
But is it possible to do this in flash alone?
I'm trying to make a standalone exe in a non-server enviroment. Any work around on this?
Thanks
chup
Flash Movie - Total Newbie Question
Hi Folks,
Totally new to Flash MX (and struggling like buggery!)
I'm trying to create a small movie to display five book covers individually.
I would (in the past) just have created an animated gif with some form of transition.
Anyone have any ideas - or sites I could look at? or keywords I could search for on this forum?
Many thanks
Simon
My Total Flash File Size Is 33mb
Just in general, is it expected that flash sites take up a bit of space? Or is there still a "norm" that many strive to achieve. My site is 5 pages (scenes) with music loops and sound effects. As well as 72 dpi images, etc.
This is my first completed flash website. I have messed around with Flash on occassion before, but this is the first I actually went through with.
Live Total Wins In A Flash Game
Hello once again everyone! I've got a new conundrum that I'm trying to figure out how to work. I'm working on a game in which you choose a side. If you beat your opponent you earn a point towards your sides cumulative wins. If you lose the other side earns a point to their cumulative wins.
How do I go about doing that. To see something what I am talking about take a look at http://pong.flash-gear.com/ and you'll notice its ability to keep the cumulative scores of each side. That's what I'm shooting for.
I'm assuming it's something to do with MySQL but I don't know how to do so and where I should look for tutorials. Any advice anyone?
Edit: Is there any way I can do it with simply a txt document and write to it? It's simply adding 1 to a number.
Total Newbie Question (Take III) For Old Flash Programmer
All I want to do is to implement a hierarchy that looks like this:
Canvas -> Sprite -> Button
A Canvas holds a Sprite that holds a Button. Problem is, any control I add in the Sprite does not appear. Here's the code:
HTML Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" >
<mx:Script>
<![CDATA[
import mx.controls.Button;
import mx.core.UIComponent;
import mx.containers.Canvas;
protected function init():void
{
var s:Sprite = new Sprite();
s.graphics.beginFill(0xFF0000);
s.graphics.drawCircle(5,5,25);
var b = new Button();
b.label = "My Button";
s.addChild(b);// add button to Sprite
//canvas.addChild(s); // I can't do this, as Sprite does not implement IUContainter
//...so I do this, which is what the docs say to do
var u:UIComponent = new UIComponent();
u.addChild(s);
canvas.addChild(u);
}
]]>
</mx:Script>
<mx:Canvas id="canvas" width="100%" height="100%" creationComplete="init()"/>
</mx:Application>
Can anyone tell me what is going on here. This should be simple, but I've been trying for days to get this to work. Thanks in advance for your help.
EJ
Total Time Display On Flash Player
I am totally new to flash. I am just using the flash payback component and the skin provided by AS3. But I realise there is no total time of the video displayed on the flash player as well as the display of the time as the seek bar moves. Can anyone help please? Thanks a million.
Pepperdip
[Flash 8]Figuring Out Total Height Of Attached MCs...
This may sound a bit redundant if you read my other post today about text, but i have another question regarding this scrollpane thing. So, again I have a movieclip called "entry" with textfileds (basically it's just a header bar and a bottom border bar with two textfields). This is dynamically attached based on the number of xml nodes into a holder clip.
My question is, can i figure out the total height of the attached entry clips? The scrollpane i have so far scrolls to a fixed height of the holder clip and i want it to scroll to the height of the attached entry clips.
Possible?
Thanks again for the help.
Here is all the code so far:
ActionScript Code:
contentXML = new XML()
contentXML.ignoreWhite = true
contentXML.load("content.xml")
contentXML.ref = this
contentXML.onLoad = function(success){
if(success){
var root = this.firstChild;
//trace(root);
entryNodes = root.childNodes;
//trace(entryNodes);
for(var i=0; i<entryNodes.length; i++) {
theDate = entryNodes[i].childNodes[0].firstChild.nodeValue;
//trace(theDate);
theTitle = entryNodes[i].childNodes[1].firstChild.nodeValue;
//trace(theTitle);
theDetails = entryNodes[i].childNodes[2].firstChild.nodeValue;
main.holder.attachMovie("entry_clip","entry_mc"+i, i);
theEntry_clip = main.holder["entry_mc"+i];
theEntry_clip.details_txt.autoSize = true;
theEntry_clip.date_txt.text = theDate;
theEntry_clip.details_txt.htmlText = '<b><u><font size = "12">' + theTitle + '</font></u></b><br><br><font size = "10">' + theDetails + '</font>';
theEntry_clip.border_mc._y = theEntry_clip.details_txt._height + theEntry_clip.details_txt._y + 5;
prevEntry = main.holder["entry_mc"+(i-1)];
theEntry_clip._y += prevEntry._y + prevEntry._height + 5;
}
} else trace("Error loading XML document")
}
This code is on the main mc that contains the holder and slider and whatnot:
ActionScript Code:
// Credit for this code goes to Ibad Desmukh aka ibadmd.
// Copyright 2006.
scrolling = function (easing) {
var moveSpeed:Number = 5;
var easingSpeed:Number = 10;
var scrollHeight:Number = sliderbg._height;
// amount of scroll
var scrollable:Number = holder._height - maskedView._height;
//trace(entryClipHeight);
var initContentPos:Number = holder._y;
// the drag positions that are possible for the slider
var left:Number = sliderbg._x;
var top:Number = sliderbg._y;
var right:Number = sliderbg._x;
var bottom:Number = sliderbg._height-slider._height+sliderbg._y;
// checking if the content is even scrollable
if (scrollable<0) {
slider._visible = false;
//sliderbg._alpha = 50;
return;
}
// current position updater
function updateContentPos() {
var percent_scrolled:Number = (slider._y/slider._height);
// instead of setting the _y property directly, we simple set newY
// that way we can adjust how we handle the new Y coordinate we'd like to move to
holder.newY = Math.round(initContentPos-(percent_scrolled*scrollable));
}
// position to move to
holder.onEnterFrame = function() {
if (!easing || easing == undefined) {
this._y = this.newY;
} else {
this._y += Math.round((this.newY-this._y)/easingSpeed);
}
};
slider.onPress = function() {
startDrag(this, false, left, top, right, bottom);
this.onMouseMove = function() {
updateContentPos();
};
};
slider.onMouseUp = function() {
stopDrag();
delete this.onMouseMove;
};
// user offset to update
updateContentPos();
//checking where the mouse was
areaJump = function () {
var maxHeight = 120;
var mouse = _ymouse;
var maxMouse = 179;
var minMouse = 20;
var mouseLimits = maxMouse-minMouse;
var mousePer = (mouse)/maxMouse;
var posY = mousePer*mouseLimits;
moveslider(posY);
};
//moving the slider and content
function moveslider(where) {
slider._y = where;
updateContentPos();
}
sliderbg.onRollOver = function() {
this.useHandCursor = false
}
sliderbg.onRelease = function() {
areaJump();
};
};
// turn easing to true or false
scrolling(true);
// set a dynamic mask
holder.setMask(maskedView);
Login-script With Flash Total N00bie
okay so i'm trying to make a flash header and i have 2 text fields and a button...username password then login button...how do i get it to connect to mysql and verify then transfer to members page...
[F8] Flash Currency Handling Has Error.NumberFormat Error, Is Losing A Dollar / Pound
When I add two numbers together Flash adds them fine. If I use the Locale to format it as currency, Flash will lose a dollar! This only happens on certain combinations of numbers. I've been banging my head off a wall on this. Paste the script below into an empty flash document to recreate the problem.
Anyone with any ideas of how to solve this please help
code: import mx.controls.*;
import mx.format.NumberFormat;
import mx.format.Locale;
import mx.format.locales.Nl;
import mx.format.locales.*;
var iPaid:Number = 0;
// simulate strings from a textinput field
var sValue1:String;
var sValue2:String;
Locale.registerLocale(new En_US());
var fmt:NumberFormat = new NumberFormat(Locale.currentLocale.currencyFormat);
sValue1 = "226.89";
sValue2 = "28525.11";
trace("sValue1: "+sValue1);
trace("sValue2: "+sValue2);
iPaid = Number(sValue1)+Number(sValue2);
trace("iPaid: "+iPaid);
trace("String(): "+String(iPaid));
trace("NumberFormat.format: "+fmt.format(iPaid));
trace("Where's my money!!!");
sValue1 = "226.11";
sValue2 = "28525.89";
trace("sValue1: "+sValue1);
trace("sValue2: "+sValue2);
iPaid = Number(sValue1)+Number(sValue2);
trace("iPaid: "+iPaid);
trace("String(): "+String(iPaid));
trace("NumberFormat.format: "+fmt.format(iPaid));
trace("Any Ideas!!!");
Error Error Adobe Flash Player Has Stopped A Potentially Unsafe Operation
Dear Sir,
This is regarding the error which i am getting when i open one perticuler adobe application
"error adobe flash player has stopped a potentially unsafe operation "
I got one cisco flash presentation i am not able to open the file because of this error. It would be really helpfull for me if you could guide how to solve this problem.Awaiting your reply.I would appreciate your earleast reply
Regards
Lijesh.
FMX: Save User-drawn Objects And Save/load DXF/DWG?
Hey everyone. Sorry to seem like a leech, but I could really use the guidance. Usually I'm pretty good for finding the solution on my own without having to trouble people, but this time I seem to be coming up short. So thanks in advance for taking the time to read this.
I'm developing an auto-cad esque flash application (going good so far too). I have no problem storing object information in a database (xy coordinates, rotation, scale etc), but now my problem is converting that data to another format; specifically DXF or DWG. Now I know the flash environment itself can import/export DXF's, but I don't know how to load the user-made data into the environment. Is it possible to have the environment run actionscripts to build these user-made objects and then manually save that to a DXF? (or even better would be a save/load DXF from the flash player)
Essentially I'd need to know if it's possible for the flash environment to read from my database (probably from reading a PHP built XML file), execute actionscript to reconstruct any objects created, and then let me go and manually (or automatically!) export a DXF of that.
Any comments or help would be greatly appreciated =]
EDIT:
The other very viable alternative is if you guys know of an XML to/from DXF/DWG converter.
I'm At A Loss
i'd like to create a "jeopardy"-style quiz game for use in an educational setting, but i have practically zero expereince with flash. the game doesnt need to be complicated, just categories with 5 questions, when $ amount clicked on, question is shown full screen, another mouseclick, back to category view. if at all possible, i'd like to be able to load dift categories and questions from a text file. can anyone point me in the right direction to get started with this? or is it beyond my very limited abilites?
thanx!
|