ActionScript 1/2 :: Write LoadMovie Error Handling
Aug 25, 2010how to write loadMovie error Handling
View 1 Replieshow to write loadMovie error Handling
View 1 Replieshow to write loadMovie error Handling
View 4 Repliesi am currently trying to learn ZendAMF, but i have a hard time troubleshooting which makes learning it quite hard. Is there a way to make the PHP file throw an exception that gets traced as an error message in AS3 (not Flex), the only error i seem to be able to get is "Error #2044: Unhandled NetStatusEvent:. level=error, code=NetConnection.Call.Failed", but it tells me jack ****.
i have gotten ZendAMF working, i just want to know how i can make error handling better, so that as an example can use PHP to tell flash that no results were found, or that the typed text was invalid. Is it better to use AS3 to check if the field was filled properly?
i am trying to write an image gallery using the loadMovie comand, loading jpegs into a blank movie clip the thing is, all the tutorials seem based around issuing the loadMovie command as you press a button to actually view that particular picture what I am trying to achieve is to have maybe the 1st and 2nd image of the gallery included in the flash movie and these load up and show instantly but whilst the viewer is looking at these the swf is busy preloading all the other images in the background. The idea being that images are loaded faster than the navigation that takes place so when the user clicks on the 3rd image it is already loaded and displays instantly and so on and so forth question is, how do i achieve this ? Do i still use loadMovie but have one script at the 1st frame that loads say all 20 images each into a different empty movie clip ?
View 7 RepliesHow do you communicate an error to the web service consumer ?
For example, my web service has a function to insert employee into db.Suppose while inserting the data , the database gave an error,what should be the best way to inform the user about the error.
One way is to depict it through the return value of the web service method but what to do when the function is supposed to return a complex object like employee when there is no error ,and will send an error string when there is an error ?
I'm asking many questions these days but its really urgent
I am doing an application to load xml file into data grid and everything is done now. The only thing left is that i wanna make sure that if the xml file isn't there, the user will not have a runtime error.I have the following code to load the file.
var myXML:XML = new XML();var XML_URL:String = "questions.xml";
var myXMLURL:URLRequest = new URLRequest(XML_URL);var myLoader:URLLoader = new URLLoader(myXMLURL);
myLoader.addEventListener("complete", xmlLoaded);
i tried many ways i found on the net using try and catch but didnt work. Anyone can write me the peice of code to hande this error if the file is not there??
I'm working on a game, that loads up external text files to create maps. There is a error if the player moves out of bounds, and there is no map to load. All I need is a sort of check to see if the text file actually exists, before loading it
View 3 RepliesI'm trying to use the new(ish) AS3 global error handling class. I am trying to use it within a Flex mxml application. I can't get it to work at all. Below is an entire program that shows the problem. I set this to use Flash Player 10.2 and compiled with the Flex 4.5 SDK. I've tried using Flex SDK 4.0 and 4.5 but I get the error in either case. I must be missing something obvious here. This is a normal Flex SWF file that will be shown on a web page. Assuming I could import the UncaughtErrorEvent, I would then do something like this to setup the event handler:
[Code]....
There is a file (php script) stored remotely on the server and I want to read it into flash using AS3.0's URLLoader. However, if I unplug my cable just before reading the file, and attempt to read the file, I want to capture an Error event in some error handler, which would mean "internet connection is down, file can not be accessed". I am reading the AS3.0 documentation now for 2 hours already (mainly: "Handling asynchronous errors in an application" and "Events of URLLoader class"), but I didn't stumble across an example of how to catch an Error event of the URLLoader object when reading a remote file from the server. However I took all possible events I could find (even those which are not necessary at all), and tested them in the following code:
Code:
public function URLLoaderTest( ) {
_loader = new URLLoader( ); // _loader is private var of this class
configureListeners(_loader);
var request:URLRequest = new URLRequest("url_with_php_script");
_loader.load(request);
[Code] .....
This code traces tons of data, when executed with internet connection up:
Code:
openHandler: [Event type="open" bubbles=false cancelable=false eventPhase=2]
progressHandler loaded:10 total: 30
httpStatusHandler: [HTTPStatusEvent type="httpStatus" bubbles=false cancelable=false eventPhase=2 status=0]
completeHandler data: 1165428133
but it traces NOTHING (?!),
If the connection is down (whether closed by firewall, or cable-unplugged). So that basically means, none of the above events is fired, none of them takes care of the errorHandling in case of no-internet-connection (or if for some reason we can't reach the server atm). Any ErrorEvent i can use to catch such (connection down) Error Event? Or do I have to use Timer class instead to check wether the server responded in some time or not? I would like to leave this as the last option.
i've created a socket extension class. the pseudo code below tries to make a socket connection using the passed parameters. if there is an security error, such as the port number not being an acceptable port number, i want to handle the security error.
however, i can't catch the security error. a popup window appears with a description of the error and my errorHandler function is never called.
[Code]...
Is there a way to handle errors and exceptions in AS3 as one would do so using `set_error_handler` and `set_exception_handler` in PHP?
View 4 RepliesFor a client, I am working on a project where a live RTMP stream is published to an Adobe FMS 3.5.6 server from a java application, using Red5 0.9.1 RTMPClient code. This works fine, until the timestamp becomes higher than 0xFFFFFF after 4.6 hours, and the RTMP extended timestamp field starts being used. I have already found: when the extended timestamp was written after the header, the last 4 bytes of the data were being cut off. I have fixed this locally, and now the data being sent seems to me to be conformant to the spec. However, FMS still throws an error message in the core log and then kills the connection from the Red5 client. Here is the error message:
[Code]..
I've been trying to load an external SWF but keep getting this error:
TypeError: Error #1006: loadMovie is not a function.
This is the code I have:
Code:
location.loadMovie("video.swf");
"location" is the mc that loads "video.swf"
This used to work in other versions of flash but for some reason now it doesn't in these higher versions of flash?
My site has a picture gallery. It works with a movieholder and the loadMovie command. It has 9 buttons, one for each picture, and they work. There's also a previous and next button to navigate through the pictures, there the loadMovie command gives problems.
Here are 2 lines that are used in the previous button:
Code:
_root.site.alles.movieHolder.loadMovie("images/1.swf");
Code:
_root.site.alles.movieHolder.loadMovie("images/"+(fotovariabele1-1)+".swf");
I get the following error with that button:
Error opening URL "file:///C|/school/multimedia/VOLLEDIG%20NIEUWE%20SITE/images/NaN.swf"
I know nothing about a Nan.swf. I don't understand why these lines don't work in the previous button, because the 1 button (the button that loads image 1) also uses the first line, and that works. I know only very basic actionscript, but the code of the previous and next buttons are supposed to be correct except for those lines with loadMovie. In publish settings is actionscript 2.0 set.
I am in the middle of making an xml driven menu. Each button has an image which loads from an external folder and 3 dynamic text fields. The content for the text fields is taken from an external XML file and I would also like the image to be defined in the XML file. The problem I am having is when I use the code attached below .I get the following error message; :
'Error opening URL
'file:///C|/Documents%20and%20Settings/barry.gee/Desktop/undefined'
However when I manually enter the image url as commented out in the attached code the image loads fine.
I have a URL Query String Generated Flash Site and I need this code so that when it can not find the swf typed it will return with an Error. Here's my code that I thinks should work.
[Code]...
I have declared some public static consts within a class Instrument. So that I can hopefully access them like Instrument.SAX, instrument.HARP, etc. etc. But when I go to trace out or compare the consts, it gives me this error:
1058: property is write-only
i dont know if its me but have things got alot more complicated? i have made 4 .swf's that all work fine individually. i have 4 scenes that each .swf is to load into and play in turn when the main movie loads in.before the loadmovie code was:
stop();
unloadMovieNum(2);
loadMovieNum("fcbp01.swf", 2);
now however i have been advised to use:
var request:URLRequest = new URLRequest("achange.swf");
var loader:Loader = new Loader();
loader.load(request);
addChild(loader);
this does not work and i get the error code: 1151: A conflict exists with definition loader in namespace internal.var loader:Loader = new Loader();.
I'm trying to read a XML file and output the values, but i'm getting a 1120: Access of undefined property URLRequest. error.
[Code]...
I use Flashdevelop as my IDE. It is defaulting to write void with a capital V which reads Void and is causing CS5 to throw an error.
View 2 RepliesI've had FMS running on my local machine for a while and have had a little experience writing FMS apps, but I've just tried recording audio for the first time using the standard vod application and I keep getting a "Write access denied for stream" error. My AS3 code is copied and pasted for various examples and am confident that it works.
I'm running Windows XP service pack 3 & FMIS 3.5.
I've had a look at the vod/media directory and under windows->properties the read-only attribute is ticked. Every time I un-tick this it reverts back to being ticked. I've googled this and MS say that most programs ignore the read-only attribute and that it only really applied to files. I've also tried the MS fix for setting the read-only attribute via cmd and still no joy (doesn't fix read-only attribute or FMS recording the audio after setting via cmd).
I've also tried our dev server install of FMS (running under linux) and am getting the same results.
Here's my AS3 code...
private function initApp(event:Event):void
{
removeEventListener(Event.ADDED_TO_STAGE,initApp);
[Code].....
hey im trying to make a mp3 player and when u click on a play btn it plays that song. but i keep getting this output error "Error #2044: Unhandled IOErrorEvent:. text=Error #2032: Stream Error.
at slide_fla::MainTimeline/frame1()"
this is my code
ActionScript Code:
import fl.transitions.Tween;
import fl.transitions.easing.*;
var slidebind:Rectangle = new Rectangle(3, 3, 159, 0);
var loadsnd:URLRequest = new URLRequest ("s1.mp3");
var thissnd:Sound = new Sound();
[Code]...
I am trying to get metadate from my NetStream object and do things depending on what is going on. here is what I have, but I get an error I don't know what it means.
var customClient:Object = new Object();
customClient.onMetaData = metaDataHandler;
function metaDataHandler(infoObject:Object):void {
[code]....
The error I get is:Error #2044: Unhandled AsyncErrorEvent:.text=Error #2095: flash.net.NetStream was unable to invoke callback onMetaData. error=TypeError: Error #1010: A term is undefined and has no properties.
at AMG_ASP_ICS_072709_fla::MainTimeline/frame1()
which everything seems fine, but when i implement a slider on a page inside a folder in the root (i.e. aboutus/index.aspx) i get that error when the slider is trying to call the images.I have similar slider animations in pages located in the root folder and in those i get no problem at all, seems it only happens when the page is located inside a folder.The website is done using main.master on asp, maybe the cache or rendering of the website is missing something, hope someone has had something similar or know how to get around this.
View 2 RepliesI have a bit of code listens for a user to click a navigation item, however if they click another nav item then my code loads both of them and puts the content pages on top of each other.I am having loads of problems with this bit of code.
PHP Code:
private function _menuSelectHandler (event : MenuEvent):void {
if (! event.abstract) {
[code].......
I have a problem with event handling. I'm working on a calendar, on which events can be listed. With actionscript i loop through an XML file with the days (and if there, the events for that day). So far so good. Where it goes wrong is this: I only want to display blocks with the day numbers on it. When you click on a day, a box pops up and shows the event's for that day.
This is what i did: created a movieclip with classname mc. loop trough the xml file and for each day create a new instance of mc with the day number as text on it. This al works, but now i want to add an eventhandler for each day. How to do this?
Can I write more than one command in a script? I am having trouble making an if-code in Flash CS4.This code is working as I want:
stop();
instans1.onMouseDown = function (){
play();
[code].....
If I have a graphic that is fully transparent in places, can I make only the non-transparent portions of the graphic respond to mouse clicks? I realize I can probably do this with a few lines of code, e.g. detect the click and then check the alpha value under the mouse. But I was looking for something simple. For example, in Director there is an "alphaThreshold" in a graphic that determines at what alpha value a bitmap will respond to mouse clicks. Does Flash / AS3 have a similar capability?
View 1 RepliesI'd like to arrange things so that I have a chain of keyboard event handlers in my flex application, all of whom are queried when key down events occur. Basically, when a visual component is on screen, it is a candidate for handling a key press event. Something like this (clearly this is pseudocode):
<application handles_keys="F5, F6">
<tabGroup>
<tab1 handles_keys="pgup, pgdn">
<control handles_keys="0,1,2,3,4,5,6,7,8,9" />
[code]...
I have a class written that will respond to the key events the way I want it to, so how do I register one or more instances of this class to have the results I want? Also, note that there are some situations where this class should receive events that would ordinarily be handled by a UI component. The TAB key is the main example; I have a few cases where I want my key down event handler to fire even when the focus is on a text field.
We have a Flex client and a server that is using the Spring/Blazeds project. After the user logs in and is authenticated, the spring security layer sends a redirect to a new URL which is where our main application is located. However, within the flex client, I'm currently using HTTPService for the initial request and I get the redirected page sent back to me in its entirety. How can I just get the URL so that I can use navigatetourl to get where the app to go where it needs to?
View 2 Replies