ActionScript 2.0 :: Convert From Base 10 To 16 And Then Base 16 To 36.?
May 17, 2007
Its been a while since i touched flash, which is funny considering i started my web/development career here.Anyway, in PHP there is a nice little function called base_convert (http:url....) which will take any number in any base (e.g. base 10, decimal) and convert it to any base (e.g. base 16, hex).So base_convert (15, 10, 16) will output F, which is convenient.I am wondering, as i cannot seem to find, if there is any similar function in actionscript. I am trying to convert from base 10 to 16 and then base 16 to 36.
I have a method that converts an int to a base60 string (using 0-9, a-z, and A-Z chars), but can't work out how to convert it back again. Here is my method for converting base10 to base60:
public static function toBase60(value:Number):String { var targetBase:uint = 60;
[Code]....
Works well. But how do I get the base60 string back into a base10 int?
Basically, I am experiencing an inconsistency with the behavior of an equation that is calculating the change in y position from one movieclip sequentially from frame to frame, and transforming the amount of change from a smaller range to an amount of change to a larger range; moving the target mc between two points. The inconsistency is that target mc doesn't always reach the top and bottom .y points, even though the slider mc does.
I have a flash file(full link to flash looks like [url]... which loads mp3-file(link to mp3 I send with php through flashvars)
I've embed dynamically(with swfobject) this swf to my page. It's ok. Then I send ajax-request to script, which reloading div with flash. Div is empty.
Experimentally I found out that I've trouble with relative paths. Flash file embed with this address ./swf/audio/player.swf and mp3-address is ./media/audio/user/1/random.mp3.
I have opted to use the UILoader component to load external .swf's of my images. The problems I am running into are that: one, the UIloader does not seem to be loading at all some of the time
and two, I cannot have a UILoader that is larger than the dimensions I am loading the image into.
For the first problem, is there a way to put a progress bar that specifically targets the UIloader so I can make sure that it is actually loading? I've been looking for a tutorial for this, but have yet to find one that explains the code and what it does, making it difficult to customize.
For the second problem, is there any workaround for this, or are the dimensions of the loaded .swf limited to the dimensions of the base .swf?
I have a base SWF, and I am loading a another SWF into a movieClip array. I need to communicate from the loaded SWF to the base SWF I tried _root but think this only goes to the root of the loaded movieClip? This is what I tried: on (release) { _root.moveContent(2); }
I have a site that is 100 fps and i load in an swf that is 30 fps but the base movie is dominating so the loaded movie is playing at the waaay too fast 100 fps.
I've flash application (mFA) loads by some kind of logic flash applications (sFA) from another folder. Problem is that after loading for sFA base url is the same as for mFA. Does I've some possibility to change base url for loaded swf or to change base url of main swf?
I wanted to know if it is possible for AS2 to grab the base domain and set it as a variable. This would also need to work for any domain possible. For example for [url].. what ever the combination it would always return "yahoo". This would need to work with the domain the swf is being viewed on so the domain wont just be 1 domain.
im am tryin to make a xml base gallery but im running into some problems. according to me is everything fine. xml, fla and images are in the same folder but somehow i get: Error #2044: Unhandled IOErrorEvent:. text=Error #2035: URL Not Found.
I'm creating an application with an animated kid figure. All the kid symbols sit in a kidLibrary.Fla file, Each of these symbols have a class named "Kid" linked to it on its Properties >Base Class. This Kid class is responsible for setting the right color and hair type for each kid symbol instance. Every time i need to include one of these kid symbols i drag it to the current .fla file I'm working on. If I place only one kid symbol in the library of the file I'm working on, everything works fine!
Now here is the problem: When i place more than one kid symbol in the library, and then drag it to the stage, then one of the symbols works fine while the other one doesn't seem to access all the properties of the Kid base-class. The result is that only one symbol act perfect while the other one(s) not.
I'm writing a series of Search windows for an application. I create the FLA files on the stage, each has 3 simple buttons: next_btn, prev_btn, and close_btn. Those all have event listeners which call findNext(), findPrev() and closeWin() respectively. Each search window looks for different things, some with a text box and some with a combo, etc.
So I have a base class com.search that extends Sprite and adds the eventListeners at startup (actually, on addedToStage). Like this:
function isAddedToStage(evt:Event){ next_btn.addEventListener("click",findNext); prev_btn.addEventListener("click",findPrev); close_btn.addEventListener("click",closeWin);}
[Code]....
If I add the event listeners in the derived class rather than the base, it works fine. But that seems to defeat the purpose of inheritance, plus it infers that I won't be able to derive new classes/swfs from those derived classes.
how does one reference objects created on the stage from a base class of that document's class?
I frequently create a lot of Library Symbols, export for Actionscript, letting Flash auto-generate the Class & extending a custom base-class in order to give them all custom functionality w/out having to create a Class for each, and/or without having to create a FactoryClass for instantiating X number of ClassObjects for each Symbol to be added to.It's really fast for prototyping, and with this workflow I've only hit a few obstacles. Those are:
1 - If the Symbol has children you cannot give the children instance-names, else the compiler gives an error related to automatically declaring stage instances. Two workarounds for this are that you can uncheck automatically declare stage instances, and do it manually in your base-class. or you can avoid using instance-names, and use getChildAt().
2 - If the Symbol is a MovieClip, the timeline doesn't inherit the base-classes imports. I don't have a workaround for this.are these limitations that could be addressed by Adobe's Flash team, or are they limitations that are unavoidable without altering the workflow?
That is i have called one AA class in to stage. AA class is extends from BB class. BB class extends from CC class.CC class extends MovieClip. In CC class i have given CLICK event trace("this is CC class"). i am also given for AA class CLICK event ("this is AA class ").When I Click the AA in out put panel "this is CC class" ,"this is AA class ") i want to stop CC Class mouseEvents.
In my flex app I have various custom components done with mxml or actionscript.I want all of them to extend a base-class where I can define properties/event listeners etc.Can someone give me an example how to create that base class and how I can extend it in mxml and actionscript components?
I have a BaseComponentClass that I am using as the class that all my custom components extend.For some reason, none of my custom components show up at runtime. I am not getting any compile or runtime errors either.I am implementing all the protected UIComponent methods.[code]The Button never shows up at runtime.
I then, in the Flash document, create a movie clip which has this class set as the "Base class" in the properties. However, if I then do this.updateText(); in the movie clip's frame script, it complains
TypeError: Error #1006: updateText is not a function. at miranda_fla::MenuButton_3/frame1()
Why doesn't it work? I know the class is read and compiled, because I had an error there which was reported.
If I've already specified in the symbol's package which class the symbol's class extends, do I still need to specify the base class in the symbol properties dialog?
I'm developing an application "with Flex Adobe Builder, AS3" that will add contacts in the user contacts and may retrieve some and add events and get from the user calender.
Flex didn't provide and API to do such a thing yet, so, can I access the contacts data base by it's uri and select and insert into it directly ?
I'm using several custom MXML components in my Flex 4.5 application.They all use absolute coordinates to place Image, Label, Line, etc. components and are currently based on a spark.components.BorderContainer:
Then I've realized, that I probably don't have to use BorderContainer, because I don't draw/need any borders around my custom components.But I don't know, what to take instead of it.I've tried taking <mx:UIComponent> (and removing <s:Layout> tag above), but then I get the error:
'Image' declaration must be contained within the <Declarations> tag since it does not implement 'mx.core.IUIComponent'.
'Label' declaration must be contained within the <Declarations> tag since it does not implement 'mx.core.IUIComponent'.
Is there some simplest possible spark "container"? And do I need a "container" at all if I use (and want to use) absolute coordinates?
i have mentioned that my animation needs to work for 5 sec. On 1024 to 1600 monitor it woks fine. But on smaller monitor it's too fast. How do i slowdown based on screen width. i.e animation needs to calculated based on screen width, say i mention for 1024 width it needs to work for 7 sec. Even if the screen decreases it should work for 7 sec. Again on larger monitor since width is more again and time is less (7 sec) the animation is again fast so here again the time has to be increased.
I have a Actionscript base class already created but when i type in the location for it i get back the file cant be found error.This is the url for my code
gamegamesmygameutilitykeybinderChanger
Now i have tried it without the as3 format but it just seem to find this file.
I have swc library, which I use for skin assets, and I link this swc externaly (load on runtime before any usage of swc classes and put it into proper application domain).The problem occure when I use swc classes in my application as base classes and run app (compilation is ok). In this case I get #1014 Verify error - class not found. (the code which e.g. instantiate those base classes is never executed before swc is loaded, but seems Flash Player makes some verifying).[code]When I don't use swc classes as base classes, everything is ok.
My Flash app doesn't work in FireFox (but works in IE). The problem I know is associated to loading external SWF and JPG files when using a BASE folder. Without the base folder it works fine. Here is some syntax I use: [On Frame 1 of the base SWF, i.e. one frame before the preloader frame:] .... _root.logo_mc.loadMovie("FlashFiles/Logo.jpg", "GET");
This file never gets loaded into the BaseApp.swf. The object html tag looks something like this: <OBJECT.... <PARAM NAME=movie VALUE="[URL]"> <PARAM NAME=menu VALUE=false> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF> [Code] .... What's the easiest resolution to get it working in FireFox as well as IE?
when I create a new flash project, I would like to put the source files in /src/ folder.When I try to add the base class to my project, flash can't find it.I've added the folder "src/" to source paths, in flash preferences.