Drawing During Run Time
Jul 23, 2009Does anyone have the code for drawing lines (with smoothing) in an onMouseDown click event?
View 1 RepliesDoes anyone have the code for drawing lines (with smoothing) in an onMouseDown click event?
View 1 RepliesI made a run-time drawing board, to draw a specific shape by using movieclips. But I don't know how to check it. For example, if they draw a rectangle, I want a message to show up. How can I check a drawing?
View 1 RepliesDrawing in real time in a film
View 6 RepliesOver the weekend i put together an MP3 player in Flex and just managed to figure out the SoundSpectrum.
It is working as expected.
I am facing problems when it comes to using a bitmap.
Right now, my "Analyser" class pulls the data from SoundMixer.computerSpectrum.
I then use that data with the drawing API to create a simple analyser. You know, just spikes.
Here is the code for that part:
Code:
private function update(e:TimerEvent): void
{
SoundMixer.computeSpectrum(ba, true);
var n:Number = 0;
[Code]....
Ok using common sense here, I am telling flash to take a snapshot of the Analyser and draw it to the bitmapData.
However, i cant seem to get this working. I am not using the dispose() method to clear the bitmap so id expect to see a mess of points (similar to if i removed the g.clear()) but nothing happens.
I have got problem accessing a property of a component. I want to use this property to decide whether to include a particular child component.
For example:
MyMainView.mxml lists this component
<view:AnotherView id="anotherView" aPresenter="{thePresenter}"/>
Now AnotherView.mxml has a property
<fx:Script><![CDATA[
[Code]......
flow of events on creation of a flex component and how I can use the aPresenter property in .
i'm working on a drawing tool with the flash drawing methods, but my movie starts to slow down. i'm storing the variables in an xml object and then looping through them onEnterFrame. right now i'm limiting the amount of lines that are drawn to 50. anyone have any tips on speeding up the drawing methods. as i understand it they are the same methods that flash uses to draw all it's lines. shouldn't it be able to render more than 50lines at a time.
View 2 Repliesi've tried to simulate a pencil tool, for drawing above a imagem, but the drawing is below the picture. How fix it?
[Code]....
Basically I've got a reasonably complex drawing object in a fla and I want to reproduce it in a class definition using the drawing api. However obviously this is a tedious task, so is there some trick or automated method of doing this?
Last time I needed to do this it was a drawing of an arrow and I ended up writing down x,y,width,height values for everything but this one has curves in it which I don't have experience with drawing anyway.
I cannot get this to work. Without the "var drawing", "var drawing being true or false" and the "if statement", it works fine. But I need to add the "var drawing" so that you can only draw if you turn it on by pressing the "draw_btn" button. Note, I do not get an error, the script "apparently" contains no errors. Here is the code:
ActionScript Code:
var drawing = false
_root.createEmptyMovieClip("myLine", 0);
[Code].....
I've created a drawing tool which allows the user to draw on the canvas, the problem is that if I try to draw over a movieclip nothing happens. Is there a way I can allow for the user to draw over movieclips? For example if I had a background of paper?
Here's the code I'm using for it:
// This code is for drawing the lines on the page
//1.
var drawingLine:MovieClip = new MovieClip();
addChildAt(drawingLine,0);
[code]....
I need to draw on stage about 40,000 4x4 squares each a different color. The color is determined by an xml file. I have this working in as2 and have converted it to as3 the problem is the amount of time it takes to draw is causing cs4 to time out. I have extended the script time out to 60 seconds. In cs3 as2 it would draw the squares in about 15 seconds. I was hoping as3 cs4 would improve performance but seems to be the opposite. I have tried several methods such as adding children and various drawing variations. the bellow seems to work the best, but is still causing flash to crash.
ActionScript Code:
import flash.display.DisplayObject;
import flash.display.Graphics;
import flash.display.Shape;
[Code]...
I have this clock code and would like to know what needs to be added or changed for it to reference the time off the server and not the local computer time (and preferably reference the server just once and not repeatedly). I already have a file on the server "time.php" that is providing the milliseconds. I know it should be fairly simple, but I just can't wrap my head around it.
[Code],,,
I use CS4.
Code:
package {
import flash.display.Sprite;
import flash.events.Event;[code]...........
Both of these are saved in files with the name same as the classes.
Both are saved a folder which also contains an fla file name hello.fla.So,when test the movie(hello.fla),after choosing the document class as WavyBall,I get these errors: 1046: Type was not found or was not a compile-time constant: Ball.
Source: var Ball:Ball;
1120: Access of undefined property stage.
Source:Ball.x=stage.stageWidth/2;
1120: Access of undefined property stage.
Source:Ball.y=stage.stageHeight/2;
5000: The class 'WavyBall' must subclass 'flash.display.MovieClip' since it is linked to a library symbol of that type.What is wrong?
I have a fairly complex animation movie clip within my main timeline in a Flash file. When you click a button, it plays the movie clip, then goes back out to the main timeline. The first time the movie clip runs, it plays choppy and slow, but if I play it two or more times, it plays correctly (smoothly). Is there some actionscript I need to preload the movie clip, or some other solution to the first-run slowness?
View 2 RepliesI'm testing Live streaming with FMSS. The stream is pushed to FMSS buy Adobe FMLE software. Streaming works fine until I reach 1300-1400 simultaneous connections.No matter what the encoding ratebit is (150kbps or 2000kbps) the stream is no longer play from time to time (5-8 seconds).
The CPU (2xIntel Quad) is loaded less than 20% and memory used is about 2 GB (there is plenty of memory installed 32G). The OS is RedHat 5.3 64bit platform. Network uplink maximum rate is 4Gbps.I disabled the Queue but the problem still persist.
I added in my application universal time, and I gave start and stop time. The process is going smoothly, but if I change my system (local) time, the entire time will be changed. Is there any solution to solve this problem?
[Code]...
I am working on a site that has a clock but it displays in military time, is there a way to change it to regular time. The following is the Action script:
[Code]...
I've loaded a video into the FLVPlayback component and I'm looking for a way to get the total time and the time played so far and output them to two text fields so the end result would look something like "00:12/00:50".
Right now I'm defining the video by the components inspector but I'm eventually hoping to define this bit by actionscript as well.
im making a flash upload thingy for my site, it has options to set the expiry time of the file, each time has a button which needs to be made from an array (which comes forma php script, not really relevent)... here is my code..
ActionScript Code:
if (vars.options == undefined){[code]....
i know the x values are too small but they should still all appear on the stage right ?, only the final item in the array appears...i think i might be replacing the previous one with the new one.
Im using the FLVplayback component for a project im doing. I want to add the time elapsed and time left on the controls (just like how the player on the tutorials on this site works). I dont really want to create my own controls, as im happy with the flv playback component.
View 2 RepliesI was just wondering whether it was possible to perform a function after a period of time.like +2 to hp every 6 seconds.
View 2 Repliesi've a countdown flash and am reading the currentDate from client side ( user clock on windows ). i need to read the time from html for example and save it on var then strat time from it example: HTML Code:
[Code]...
I'm using ActionScript 2 and I already placed the progress bar on the stage assigned it the instance name ProgressBar0 but i'm confused on how to give it a label, have it start at a certain time and end at a certain and show the percentage complete in the label.
View 7 Repliesi have a player in flash action 3. i need to take a the total time of the sound file and current time of the sound file. how can i code like this.
function onPlayProgress(evt:Event):void {
var sndLength:int = Math.ceil(snd.length /(snd.bytesLoaded / snd.bytesTotal));
var seekbar = 100 * (channel.position / sndLength);
[Code].....
I need to add in extra hours to the time, and the day will change automatically too. How should I change the code below?[code]
View 1 Repliesmake a clock base on given time(server time) as title,
View 2 RepliesMy goal is to change the time for setInterval each time the function is called. Planning to replace myInterval = 5000; with a randomized number. My problem is getting setInterval to recognize the myInterval variable from the function.
[Code]...
every login ,flash get server time from php. how can i update time and date in flash..?
View 3 RepliesHow to convert date and time to CDT time Zone in flex4.
View 1 RepliesHow to convert UTC time into date time format in flex. I am using sdk 3.5. for example I have current date time in UTC format as 1309522586000 (milliseconds) and I want to convert it to friday jul 1 2011. How can I do this??
View 1 Replies