ActionScript 3 :: Implementing Frictionless Pendulum Using Rope Resource?
May 26, 2011
I'm developping a gameplay concept using AS3 Fisix engine in which I need for a pendulum to be frictionless. The idea is to define the head and tail positions (using the Fisix's Rope resource) by mouse clicking and dragging in the screen and let the pendulum swing so that it goes forth and gets back to its starting position without losing momentum, and keep doing this repeatedly.
So far, I managed to make the pendulum swing normally but still being affected by friction and gravity (it keeps moving until got totally still, like a real-life pendulum would do). After many trial-and-error experimentations, I realized that I couldn't find any obvious parameter to work with, either in FisixEngine instance or in the Rope object itself, which allows me to remove or disable the friction from the simulation so that the frictionless behavior could be achieved.
i am searching for a rope that has something attached at the bottom and i can swing it around by dragging the rope from the top(not from the object attached). it might be a rope(more flexible) or just a rigid line, like a draggable from top pendulum.
i came across the box2d physics engines and erik hagreis' site made with menus that are suspended with ropes. but im still stuck, i dont know how to make the ropes draggable from the top(instead of from the bottom, as in erik's site). if anyone has a hint or an alternative solution to using physics engines, let me know. im out of searches, i searched the whole net...
I am searching for a rope that has something attached at the bottom and I can swing it around by dragging the rope from the top (not from the object attached). It might be a rope(more flexible) or just a rigid line, like a draggable from top pendulum. I came across this page: [URL]. I don't know how to make the ropes draggable from the top(instead of from the bottom).
I've created an application that includes a number of Modules and uses Parsley framework. Ant is used to build the application.Recently I thought of using Resource Bundles and implemented it in the system by creating a locale/en_US folder under the src. I added a portal.properties file with all my strings defined.In my modules, I added the metadata
The build works fine and when I deploy the application and open it in my browser, I'm greeted with many errors thrown by the Flash player.But if I dismiss the messages, its working fine. My strings are replaced with the values in the property file, but how do I stop the runtime errors being thrown up?I get the below error.
Error: Unable to load resource module from portal at MethodInfo-637()at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent()[code].....
Where do I can find an example or a tutorial of a realistic simulation of a rope tied between two points? I need to make something similar to the interface of Reason, the music app.
I'm having a heck of a problem with the startDrag function in Flash right now. I'm trying to make a draggable and/or clickable curtain rope, which works now to a certain extent. When the user single clicks on the rope, it opens/closes itself. When a user clicks and drags the rope part of the way, it opens/closes itself the rest of the distance. A user can also click and drag the rope the whole way if they like. Everything does what it is supposed to when a user single clicks. If a user double clicks, the curtain is permanently draggable, which is obviously not what I'm going for.Variable used to determine whether the curtain goes up or down
I have a pendulum that swings infinitely. I'd like to set the maximum angle to a random amount to give it a sort of "blown by a random wind" effect. I'm not great at code, so I can't figure out how to randomize "maxAngle" without making the animation jerky. Does anyone have any ideas on how to do this? Here is my code and FLA...
This is one of the first real things i tried creating using actionscript. I wanted to create a flash version of Conway's game of life ( [URL] ). I got it working succesfully in flash but it's turning out to be a huge resource hog . If i put it one a 100*100 grid it freezes up my computer. i uploaded a temporary version that's supposed to run at 25fps, but as you can see it runs alot slower:[URL] is there any way i can improve my code to make it run faster? Am i using a wrong method to draw the cells? here's the code (all located on the first frame of the root timeline)
While we have a dedicated AS3 forum, we know that a lot of Flex 2 users will cross back and forth across forums because while Flex's core scripting is MXML, it fully supports AS3 as well so it's confusing sometimes what forum to post in and who is best suited to offer help. A lot of topics have been covered in the last 6-8 months at a lot of the more well known guru sites and popular blogs and as we get going we will link up anything that might be of use to users in here.Url...
As below seen in the code, I have created two objects from one object in the library. When you click on them , the trace says object sample_mc for both. So how can I check it in the code if multiple objects are from same resource in the library...
not sure where this should go so putting it here? I have created a game through a third party website: [URL] and want to embed it into my own website but it isnt working? the game is stuck on LOADING.
Some places in my flex app, I use ResourceManager.getInstance().getString, and other places I use mxml @Resource tag to retrieve resource properties dynamically loaded from ResourceManager. resourceManager.loadResourceModule(resourceModuleURL); But only strings from ResourceManager.getInstance().getString show proper locale based values, while the @Resource tag only returns values from en_US resource. I guess it is because en_US is what I compiled with (-locale=en_US ). So I am wondering if I am using a dynamicly-loaded resource, do I have to abandon the @Resource tag and use ResourceManager.getInstance().getString ?
I haven't been here for a while but as a resource of excellent ideas I am back to ask something that I feel you guys would know about.I am a teacher thinking of going self employed and I want to set up an online business charging for access to resources I create myself online to any students that would be interested.I can figure out how to set up password protected areas on my website where access is given when payment is made.
Of course this is for a limited period, say a week and then the password would automatically and randomly change.
I would give the password to those that had paid for access for the agreed period for access.As I aim to have more than one person at a time, this needs to be self regulating. Is this at all possible?Online teaching resource not exactly flash related!
Hopefully this is a straight forward question but as far as resources when compiling a flash project is flash more cpu dependent or gpu dependent? Trying to spec out a machine and need to determine what flash is going to use more.
I want to store some test data for a FlexUnit test in small XML files in my Flex project, and access them trivially for the flex test. How can I load these bits of data synchronously? HTTPService is the way I'd be loading them _a_synchronously, but adding event handlers to my test cases seems like a bit of overkill.
I'm creating a generic flash navigation. I'd like to allow people to use their own fonts like sIFR. I know i can just create a swf file with a font embedded but i'd like to make it as easy as possible for someone to swap fonts so an existing method of creating a swf font file would be preferred.
I'm usually creating 1 .as file per font and exports these .as files to swf's that I load in to my flash projects. This way I can choose what characters to embed. Now I tested copying my verdana ttf fontfiles from my Windows font folder and embedded this to create a Verdana swf fontfile. When I tested running this I tried with some swedish characters with dots. The dots above the characters from some of these characters was positioned slightly offset (like a few pixels to the right or left). Anyone had the same problem?
Example code: [Embed(source = 'fontfiles/verdana.ttf', fontName = 'Verdana', mimeType="application/x-font-truetype", unicodeRange = 'U+00-U+FF')] public static var font:Class; public function Verdana() { Font.registerFont(font); [Code] .....
I've run into this issue with my latest project, but I was able to re-create it with an almost empty project. Here is what I've done.
Created a new Flex Project Created a locale/en_US folder within this project. Added a class that extends SparkDownloadProgressBar. All this class does is attempt to create a Label.
When I try to debug this application, I get the following error.
Error: Could not find compiled resource bundle 'components' for locale 'en_US'. at mx.resources::ResourceManagerImpl/installCompiledResourceBundle()[E:dev4.0.0frameworksprojectsframeworksrcmx esourcesResourceManagerImpl.as:340]
[Code]....
The Flex Compiler/Additional Compiler Arguments section does contain "-locale en_US", but I do not want to just remove this as I am planning to have this load different property files based on the localization region at run-time and how I understand it, I will need to add each locale that I am planning to use on the compile argument line.
In the simplest of Flex Projects, create an MXML Flex Module and then load it using the ModuleManager.Create an ActionScript class that extends Module and then configure your project to compile that into a Module.Load this new module instead. The project compiles, but crashes when running with the following error:"Error: Could not find compiled resource bundle 'containers' for locale 'en_US'."I believe the compiler is failing to compile the required class definitions into ActionScript only module, while it succeeds for the MXML module.I can see that my skeleton MXML module is slightly larger than my ActionScript module (66KB vs. 45KB).
find a template or some resource that can make a scrolling background, with buttons floating. Example here: http:[url]....I want to make something similar, but I am told by my coder that its a big job to code it from scratch, is there anything already made out there, that I can use as a template?
I have a need for a blocking call that involves loading resources. How is this typically achieved in AS3? I know the standard process is to use callbacks and what not, but in this particular case I really do want a blocking call. I tried a tight loop and the resource loading doesn't seem to ever interrupt - I assume this is a result of Flash's single thread execution...
I'm writing a flex application that polls an xml file on the server to check for updated data every few seconds, and I'm having trouble preventing it from caching the data and failing to respond to it being updated.
I've attempted to set headers using the IIS control panel to use the following, without any luck:
CacheControl: no-cache Pragma: no-cache
I've also attempted adding a random HTTP GET parameter to the end of the request URL, but that seems like it's stripped off by the HttpService class before the request is made. Here's the code to implement it:
http.url = "test.xml?time=" + new Date().getMilliseconds();
And here's the debug log that makes me think it failed:
(mx.messaging.messages::HTTPRequestMessage)#0 body = (Object)#1 clientId = (null)
I have set up a project (in the same way I have numerous projects before) that uses a seperate fonts SWF to provide the fonts to my project. Once loaded I register these fonts to the global font directory using Font.registerFont(). My text styles come from an externally loaded style sheet.
For some reason that I cannot figure out, when I try to create a textField and use my embedded fonts the text disapears from screen. If when creating the textField I set embedFonts to false then the text does appear at the right size and colour (as taken from the stylesheet), but obviously with a default system font where my nice custom font should be.
The code I am using is below:
TTWTextHelper.traceAvailableFonts(); TTWTextHelper.traceStyleSheet(myStyleSheet); var myText = new TextField;
[code]....
I know that (apparently) my fonts are embeded as when I run TTWTextHelper.traceAvailableFonts() i get the two fonts listed.
public static function traceAvailableFonts():void { /* * See what fonts we have to play with
My swf is being served via http protocol. I don't really see this being easily changed. There's a resource that a website has opened up via their api that I need to access but it is using https protocol. Because of this my swf can't access the resource because of security settings.
Option 1 would be to serve my swf via https. I can't do this at the moment.
Option 2 would be set secure="false" property of the cross domain policy file. I can't do this, I dont have access.
Is there any way in action script to list all the keys (not values) of given resource bundle.My use case is to combine content of two different resource bundle. I wan to do this by creating a new resource bundle at runtime and add each key value pair from two different resource bundles into one.