ActionScript 3.0 :: Flash URLLoader Inconsistent Working
Jun 26, 2011
The thing is that i have the following code. It simply does not execute the loader_complete function (found it with adding different traces) In other frame in the same project it does work, identical code. What could be the source of this inconsistency?[code]
I have a problem that seems very strange. A flash script is using URLLoader to update some records and send back a message. In the flash IDE there is no problem. However, when I upload to the server, or viewing the swf file locally in any browser, the browser just hangs and does not show anything. I have also added a IOErrorEvent.IO_ERROR handler which does not give me any information. The URLloader is communicating with a php script. I have found out that it works with a .txt file. Is the anything that needs to be included in the php script?
I have started creating a panel plugin for Photoshop, but I seem to have run into a road block. I am using a simple URLLoader to grab some info from the internet, but when I load the plugin it never seems to be called nor does it fail. Here is an example of what I am trying to do.
var url:String = "http://www.mySite.com/page.php";var urlR:URLRequest = new URLRequest(url);urlL = new URLLoader();urlR.contentType = "text/plain";urlR.data = "var=something";urlL.addEventListener(Event.COMPLETE,
i've been going over this code all day and I have no idea what's wrong with it. I'm doing a similiar operation a little higher and that one works so I have no idea why this one doesn't. All I'm trying to do in this case is populate a List UIComponent that I created with information that I get back from the PHP file. For some reason the loader.addEventListener(Event.COMPLETE, userOnLoad) isn't working and my program never gets any farther than that.
So I have a contact form that works flawlessly in the Flash development area, but doesn't work in-browser. I've tried in multiple browsers, and it doesn't work in any of them. Here is the relevant AS3 code:
Code: var url:String = "http://******/Scripts/sendContact.php"; var contactVar:URLVariables = new URLVariables(); contactVar.userName = commentName;
[Code]....
On a side note, if this helps any, sendToURL using the POST method doesn't seem to work with anything hosted on this server, but with GET it does.
i have this problem, the urlloader is supposed to stream some binary data to the server (upload) but it doesn't seem to work with anything except Internet Explorer! I have tried it with Safari (only on mac!) on Firefox (on mac and on windows!) and on Chrome![URL] and these source is:
I'm having some trouble getting my fonts to show up correctly. I have the fonts embedded properly, being read from an xml file. Attached is a screenshot - don't mind the terrible colors; it's all brought in through xml. The alignment of the text boxes are not complete, but I have the top headers set up properly, yet the right header is squished down.
I created a Flash .exe that plays a couple FLV files, but in testing the files we've noticed some inconsistent playback on various computers and here's what we've found: On an Intel Zeon 3ghz quadcore 32bit Windows 7 machine, the playback is smooth and acceptable, using an average of 50% of all four cores during playback.
On a single core Windows XP PC, there is some playback hesitation using 100% of the single core during playback. On an Intel P4 3ghz with HT (dual core) 32bit Windows 7 machine, the playback is initially very choppy with continueing choppiness throughout to a somewhat lesser degree, using almost 100% of both cores continuously during playback.
We want to point this out because on PCs that are less than multi-core Intel Zeons, we would reasonably expect that the playback experience for the end user will be unsatisfactory. Is there anything that can be done about this to avoid this being a problem after the fact, as this client will be having many of these USBs manufactured.
I've created a text field, styled it with CSS imported through an XML fragment, etc., and almost everything works as it should.
The exception (of course!) is with <b> and <i> tags. I've included the relevant font outlines in my SWF, and the bold or italicized text does in fact show up, but here's the thing: sometimes, the space between a word and the opening <b> or <i> tag disappears!
My text is all read in through XML <![CDATA[]]> blocks. If I had the following fragment:
Code: <![CDATA[This is <b>bold</b> text. And this is <i>italic</i>.]]>
The output might looks like this:
This isbold text. And this isitalic.Or it might looks like this:
This is bold text. And this is italic.
The problem is that the behavior changes according to the alignment of planets and phases of the moon or something I don't know. I tried forcing an extra space between opening tags, which would correct it in the instances where the space is deleted, but it adds an extra space where it's not!
I'm building a simple game where players scores 1 point each time his/her paddle makes contact with a ball falling vertically from a random X position. All works well - except for the scoring. Hits will score anywhere from 1 to 4 points; they should only be scoring 1.
I am stumped on a problem that I've been searching the forums for, but can't seem to find an answer to. I was hoping a Flash genius here might have an idea. I'm working on a site in which I'm having issues with a mailto button. Here's the deal. The site shows up in "two" places (although they both pull from the same .swf files) [URL] and [URL] The site is built using Actionscript 2.0 and publishes for Flash Player 6. I'm using both CS3 and CS4 (depending on what computer I'm working on) but always publish for CS3.
On the www location, the mailto button works properly and opens up an email. On the http:// location the button does NOT work, and will not open an email. These buttons can be found in the "who" section - when the user clicks on a profile it opens a new window with a headshot - which are the "buttons" in question. I've done tests on the server, nesting buttons inside multiple movie clips to re-create the scenario. And they work. And I've also changed the button to a movie clip using:
I'm trying to access the rotationY property in code to determine the current state of a movie clip that has its rotationY animated in the motion editor. What I'm seeing is that the value of the property reported in a trace stmt is different than the value shown in the motion editor.
In the motion editor I created a tween from rotationY=0 at frame 0 to rotationY=353 at the last frame. I've added the attached code to get the value of rotationY at every frame.
What I see is that the rotation does not increase steadily from 0 to 353. Instead it increases from 0 to 90 and then decreases back to 0 and then goes negative to -90 at which point the absolute values decrease toward 0. This seems like a bug. The rotation of the object is visibly different during the 0 to 90 deg
I have a swf which, for some reason, has four RemoteObjects pointing to the same ChannelId, but they are listing that channel as being at two different spots. In four of the five RemoteObjects, everything behaves as expected, but in the fourth (WidgetService), the version on dev is switching from dev.context.root toloc.context.root. To make matters more confusing, it only does this on the dev server (QA and production are fine, as are local builds).The relevant information from the config files follows:
#This is from build.properties, which is used by Ant #to build the swf on the server flex.sdk.dir = /path/to/sdk/flex_sdk_3.2.0.3958
I was excited to find out that Adobe released the data visualization for free so I can use the fancy charts and all with my projects even though I don't have Flex Builder Professional. So I installed the new 3.4 sdk along with the data visualizations. Most all of my projects did fine except for one. This particular project uses localizations. Are there any new compiler arguments that I need to include? I current have -source-path=locale/{locale} -allow-source-path-overlap=true. I get the inconsistent linkage error below:
I'm having an issue regarding the file size of the .swf file whenever I publish my flash game. Whenever I publish my flash, I get a .swf file that ranges from 2MB (with lots of run-time errors) to 6MB (no errors). This is completely inconsistent, and I get a different size .swf every time I publish. The run-time errors I get when I unluckily publish a .swf that is below 6MB are: Error #1034: Type Coercion failed #2022: Class x must inherit from y and #1009: cannot access a property or method from null reference. This inconsistent problem started emerging after I turned each .as file in my game into it's own class. Sometimes it works fine. Other times it blows up.
Attached is a FLA in which a target onPress gets a bullet hole attached to it and folds down. The fall down is made across five key-frames. In each frame the height (H) of the GIF, representing the folding target reduces this way:
instead trace(this._height) returns like this (and every time slightly different):
from frame 1: this._height=156 from frame 5: this._height=147 from frame 3: this._height=117 from frame 4: this._height=99 from frame 5: this._height=99
the problem seems to be caused by the cide line which attaches the bullet hole: this.attachMovie("bullet_hole_metal","bh"+i,i);
When this is commented out this._height traces correctly.
Here's the problem: In some browsers, the navigation bar at the top works how I want it to. The "slider" moves over the various buttons rapidly. This is the case for Firefox and Safari on my PC. In others, namely Internet Explorer on my PC, or Firefox on my Mac, the "slider" moves much slower than I would like. Check it out. It might go fast for you, it might go slow.I've programmed before, in other languages, and I have found Flash to be challenging but not impossible. One thing you'll notice right away is that my code is very very messy. I haven't got all the efficient ways down pat just yet.At any rate, here's the entirety of the code involved:
Code: Select all////////////// BEGIN CODE //////////////////////// stop(); var mcButtons:MovieClip; var vLmc:URLRequest;[code]............
I am building a dynamic multi-line textfield that has a backdrop so I need to know about the height of the TextField. Strangely TextField.height will almost always return the right results. But sometimes (e.g. when the last line only has one word) it will return a wrong value with the last line missing. Am I doing something wrong? Or is this known to happen. And is there a good workaround? Should I use getBounds instead?[code]
I've always struggled with this sort of stuff, dunno why:
I'm making a vertically scrolling menu with a series of thumbnails. The thumbnails are of various widths& heights. They also have registration points in inconsistent places (ie, not always the same). I want to scale and position the thumbs so that they are all central to the containing menu section. It's probably something to do with adding a container sprite/mc and stuff but I've messed about with it and nowt works.
I have two projects that use this same piece of code ... myButton.addEventListener(MouseEvent.CLICK, myButtonClick); function mybuttonClick(event:MouseEvent):void{ fscommand("exec","myApp.exe") }
When I publish the older project I get zero errors but for some reason the same code gives me this error in my new project ... "Warning: 1060: Migration issue: The method fscommand is no longer supported. Moved to flash.system package. Also, please see flash.external.External.Interface class for Javascript/ActionScript communication."
I am confused why this problem is inconsistent across two projects that both use it. If fscommand is no longer supported shouldn't I get an error on the older project? I am using CS4 and AS3 for both projects. I added another piece of code to the new project on frame 1 that mirrors the older project and I get the same error ... fscommand("showmenu", "false");
I'm trying to draw a shape with quite precise rounded corners, I'd settle for anything around 3px. Unfortunately Flash has other ideas, and is creating a rounded rectangle with four seemingly different radii. My code is below:
var sq:Shape = new Shape(); sq.graphics.beginFill(0x000000,1); sq.graphics.drawRoundRect(20,20,20,20,4,4);[code]....
The corners are noticeably different. If I were using a bigger radius it might not be so much of a problem, but because of the small radius of the corners the square just looks odd. Have I missed the drawRoundRectEvenly functio
In the order listed above, I get the following trace when I export via Flash CS3 (9.0) on my PPC mac: number
boolean true true
[code]....
The same exact FLA file, unmodified, gives the following trace output on 2 different intel macs (one mac pro, one imac) using Flash CS3 (9.0).
number boolean false false
[code]....
have a clue why this is giving falses for statements such as "(Number(435/100)==4.35))", "(435/100==4.35)" or "(Number(input_txt.text)==4.35000)" but ISN'T giving a false for (Number(input_txt.text)==(435/100)) (NOTE: input_txt.text is an input field which contains the string 4.35) I'm expecting the latter since they're generally intel chipsets too??
Note: once i compile the code on my PPC mac, intel macs that run the SWF (but don't recompile the FLA) do return the correct booleans that match the PPC output.
We're making a simple input text comparisons vs. some constant floating point numbers (e.g. 4.35). Using Actionscript 2 to Flash 9 export. Getting totally contradictory traces on two different computers compiling identical code...Here's some simple code we're using to figure out what's going on.
Also, what behavior do any PC users have? I'm expecting the latter since they're generally intel chipsets too?Note: once i compile the code on my PPC mac, intel macs that run the SWF (but don't recompile the FLA) do return the correct booleans that match the PPC output.
I have a little problem with a simple URLLoader,it simply just loads the data from an url, and processes that data, nothing complicated. But, when ever i run it, it leaves the connection open. At the bottom of the browser it says:
Transfering Data From www....
The data is read sucessfully, so it should close the connection? but doesnt seem to want to do it. Is there anyway to close all open connections, or somehow remove such message?
I'm developing a flash application that is getting information from a remote server using a URLLoader. I have a function that will create a request for information based on the product ID. When there is an error, I want to fall back to an alternate URL, but to create the alternate URL, I need to know the product ID. What is the best method to determine which URLLoader failed (and which product request failed) so that I can regenerate the new URL?
My functions are below:
function loadData(productID:String):URLLoader { var productURL:URLRequest = new URLRequest("/path/to/product/" + productID); var dataLoader:URLLoader = new URLLoader();
In my app, I load multiple xml files. And to load those, I always create a new URLLoader. Nothing special. The first file works fine, the second one does, too. The third one, however, reports to have loaded fine, but the data it holds is actually the data of the second file. The current workaround is to load the third file twice, which somehow works... weird.