I am following this page to create a custom preloader extending Sprite to load an animation SWF, but it is not working (the animation SWF is not displaying): [URL]. I know the Animation.swf file is okay, because if I load it into the main app it displays and runs. The preloader works if an image is loaded by the preloader instead of the animation SWF.
test.mxml (main app)
BTW, I typically have many more lines of ComboBox in the app to force the preloader to display, but limiting number of lines here.
I created a class, extended the sprite class, and now in the constructor I am trying to set the Sprite's width and height properties which are inherited from the DisplayObject. However, after I set this.width and this.height, and print the values, I get 0 for both.
What the heck is going on? When I view the livedocs I see that DisplayObject has width and height listed as public properties. I have been able to instantiate a Sprite directly, and set the width and height after it's been instantiated, so I don't get it.
package { import flash.display.*; public class ScrollBar extends Sprite {[code].....
I extended the DataGridColumn because I wanted to include a custom itemToLabel function (to be able to show nested data in the DataGrid. See this question.
Anyways, it also needs a custom sorting function. So I have written the sorting function like so:
private function mySortCompareFunction(obj1:Object, obj2:Object):int{ var currentData1:Object = obj1; var currentData2:Object = obj2;
[Code].....
Whenever I try to sort the column, I get the error "Error: Find criteria must contain at least one sort field value."
When I debug and step through each step, I see that the first few times, the function is being called correctly, but towards the end, this error occurs.
I'm extending the Flex 3 panel component. I need to figure out the width of the title's text. Because, title is a private variable in panel, I can't access it via title.width.I know the font, fontsize (14), and length of the title (which will vary). Knowing this info is there a way to calculate how many pixels wide the title is?
What more can be done if I extend MainClass with MovieClip rather than Sprite. I know that MovieClip extends Sprite and it has Timeline defined under it. But still how it will be usable to me by MovieClip ?
package { import flash.display.Sprite; import flash.text.TextField; import flash.text.TextFormat; import flash.display.MovieClip; import flash.text.TextFieldType; [Code] ..... How to use Timeline if I replace Sprite by MovieClip ?
What I'd like to do: create an MXML component with some children, then extend it via MXML to create a new component with more children, without losing the original set.In other words
create a component bc.mxml <?xml version="1.0" encoding="utf-8"?> <s:BorderContainer xmlns:fx="http://ns.adobe.com/mxml/2009"
I made the transition to AS3 two years ago, but I still carry with me old AS2 habits. Could someone please help me understand how I extend a custom class correctly. I have the bad habit of putting most of my code in one .as file (the Document class), but I use a few custom classes now and then. What I'm tring to figure out is how I would extend a class of this type:
public class ClipDragger { private var _clip:MovieClip; public function ClipDragger(clip:MovieClip) { _clip = clip;
[code]....
For example I would like to add a MOUSE_MOVE listener, and also add actions to the drag function.
im trying to port my code to as3 but i stumbled on a problem i have no idea how to fix. error report:
Code: verify PointAirFri$iinit() stack: scope: [global Object$ Point$ PointAirFri$] locals: PointAirFri Number Number Number 0:getlocal0 stack: PointAirFri scope: [global Object$ Point$ PointAirFri$] locals: PointAirFri Number Number Number 1:pushundefined stack: PointAirFri void? scope: [global Object$ Point$ PointAirFri$] locals: PointAirFri Number Number Number 2:setslot 14 stack: scope: [global Object$ Point$ PointAirFri$] locals: PointAirFri Number Number Number 4:abs_jump 78424138 45 stack: scope: [global Object$ Point$ PointAirFri$] locals: PointAirFri Number Number Number 0:getlocal0 stack: PointAirFri scope: [global Object$ Point$ PointAirFri$] locals: PointAirFri Number Number Number 1:pushscope stack: scope: [global Object$ Point$ PointAirFri$] PointAirFri locals: PointAirFri Number Number Number 2:getlocal0 stack: PointAirFri scope: [global Object$ Point$ PointAirFri$] PointAirFri locals: PointAirFri Number Number Number 3:constructsuper 0 VerifyError: Error #1063: Argument count mismatch on Point$iinit(). Expected 3, got 0. at PointAirFri$iinit() at docClass/::init() at docClass$iinit() this is how the defined the classes:
Code: package{ public class Point { vars public function verlet(a) { code } public function savePoint() {; code } public function restore() { code } public function Point(__x:Number, __y:Number, __fr:Number) { x = __x; y = __y; dx = 0; dy = 0; vx = 0; vy = 0; friction = __fr; } } }
package{ import Point; public class PointAirFri extends Point { private var airFriction; public override function verlet (a) { code } public function PointAirFri(__x:Number, __y:Number, __afr:Number) { x = __x; y = __y; dx = 0; dy = 0; vx = 0; vy = 0; airFriction=__afr; } } }
if anyone has any idea why that error happens please enlighten me
I have pre-existing PDF files which I would like to send to a PrintJob in Flex 3. I can load the files fine with UrlRequest, but I need to somehow get the data into a Sprite to be included into a PrintJob.
How to make a custom item renderer in flex 4 without extending the ItemRenderer class?I need this because I want to use a custom class that is extended in all my components. as this item renderer for me is like a component, i would like to extend that custom class.[code]the ThumbView doesn't extend the ItemRenderer
I'm using NetStream class to create p2p video conferension. Is it possible to add overlay pictures or animation into video captured from webcam and then send reencoded stream to other user?
I created separate own canvas component for Home page, Contact page, Rules page etc.In my main application it has link button like Home,Contact,Rules in application controller(child state) . [code]...
I am currently working with Flex 4. I successfully use custom preloader by s:application ... preloader="path"..., but i want the preloader to load external file as well, can it do that? How can i call the variables in the preloader?
In AIR application i have link button like winner statistics . if i like this button then show winner statistics (canves) reports full page on my application . I Already created winner statistics using canves component .Which container is mostly used for view data ? Please refer me ? i tried viewstack but it will overwrite Main page ?
I have a Flex application that automatically loads the SWF and it's contents and displays the default progress bar like in all Flex apps. Currently I have a class in the application using a Loader instance to load an external bitmap to be added to the stage/canvas. I'd like to handle the loading of this bitmap in the Flex default preloader and get rid of the Loader instance entirely.
I have a flashbuilder project with a big image. The problem is that the default preloader does not load the images/swf's inside the project. Is there a way to preload them?
This is NOT duplicate of my earlier post (its is slightly different)But this is similar issue with similar error but its not the same error The error I am getting now is below while dispatching the custom event from my custom component
TypeError: Error #1034: Type Coercion failed: cannot convert events::MapEvent@a74ab51 to flash.events.MouseEvent. dispatchEvent(new MapEvent(MapEvent.CLICKED_ON_MAP));
Note: The error in my earlier post is giving below error message
Type Coercion failed: cannot convert flash.events::Event@81ecb79 to com.events.ShopEvent
The difference here are two things, the earlier error is while converting flash event to custom event and now this one is while converting custom event to flash event and secondly, I have no clue why it is trying to convert to the mouseevent where I am just dispatching my custom event with proper listeners.
I don't know, whenever I try to make a sprite animation and I click on Trace Bitmap, it shows a loading bar, I wait and wait, and when about more then half is done loading, and a little is left, the screen freezes, and I cant even click cancel to stop the loading bar.
I've got an app where numerous Sprite objects are being placed on the stage, and then when an event occurs (mouse click most likely) I want all the Sprites to move, independently, based upon an algorithm that each Sprite has. I can't get the Sprite objects to respond to the event; I get no errors.
Here's my Event class: package { import flash.events.Event; public class MyCustomEvent extends flash.events.Event { public static const CONTROL_TYPE:String = "moveThem"; [Code] .....
Basically I have lot of text fields that are rendered dynamically, and I want the user to be able to right click on one and edit it.
Is it good practise to use the right-click bring up custom menu on a sprite. And is the method guaranteed to work accross all browsers? Do mac mice have right mouse click buttons?
[URL]
And if not, what would be a good work around. Maybe bringing up a yahoo astra message box with the two options one for left mouse click, one for right click and edit text field?
I am writing a class button that extends Sprite. I use graphic fill to draw button and then use addEventListener to add Tween to MouseOver event. Problem is:
1) If I use MOUSE_OVER event, the tween became sometimes corrupt when Mouse is INSIDE the button.
2)If I use ROLL_Over event, the tween became sometimes corrupt when Mouse is NEAR the button BUT ok WHEN mouse is far enough.