fl.componentsPanel.addItemToDocument + AS3 + CS5 = IDE Crash - jsfl

Anyway, I am developing a very large scale JSFL system. It's over 2,000 lines of code (Uncompressed).
In my application I have a line of code looks like that:
fl.componentsPanel.addItemToDocument({x:pos.left, y:pos.top}, 'User Interface', type);
You can figure out that this line is creating dynamically components and injecting them in a specified position on the stage.
When I create 4-5 components (using a for loop), this line makes my flash CS5.5/CS5 IDE almost crash. My flash gets stuck for a minute almost, but to be fair it's only when i am running my code on a AS3 document only.
I present a time measurement of the execution time:
4 components in AS2 document: 0.49 Seconds
4 components in AS3 document: 61.422 Seconds
Note: When i execute all the 2,000+ lines of code but that exact line i put in comment the JSFL execution time is less than 1 second in AS2 and AS3 versions of the document.
Does anyone have an idea why this line of code has such an evil behavior?

Related

Createjs tweens execute once per window session and never run until page refresh

I'm trying to run code that tweens a stage child at the end of every minigame. I have several minigames with different tweens. The idea is that when you complete some goal with said minigame, a tween will run that plays some kind of animation. Unfortunately, when one tween runs, the rest in any minigame never execute. This also goes for the initial minigame: when one tween from minigame A runs, all the tweens in minigame A don't run. The only way to get tweens working again is to refresh the page, but even then, the problem will still continue.
I have these lines of code running globally in a file called universalDeclar.js that's read before any other js file besides the createjs cdn
createjs.Ticker.timingMode = createjs.Ticker.TIMEOUT;
createjs.Ticker.framerate = 24;
When I instantiate the new game, I give a specific child (for this case, a Sprite named professor) a tween animation before its added to the stage but don't play it until some condition is met in a later function, to which I write stupidTween.paused = false;
stupidTween = createjs.Tween.get(professor, {paused: true}, true)
.to({x: 700 }, 400, createjs.Ease.linear)
After running stage.update() in the initialize function, I always reset the ticker (since I plan on implementing time limits for each minigame) and call on a new function to run every tick
createjs.Ticker.reset();
createjs.Ticker.addEventListener("tick", fillTick);
Any guidance or help on this problem would be really appreciated since a lot of my games rely on tweenable animation
Fixed the problem myself. Apparently calling createjs.Ticker.reset(); prevents any other tweens from reoccurring despite functions being initialized with every new minigame load. I had to create some new variables to manage time differences between games but everything works now

Kinect game in Unity: How to do background removal

I've been trying to make a Unity game that uses the Xbox One Kinect (V2).
I followed the instructions in this tutorial:
http://www.imaginativeuniversal.com/blog/2015/03/27/unity-5-and-kinect-2-integration/
There are two sample scenes in this zip file: (1) KinectView and (2) GreenScreen.
When I run the first sample (KinectView), the image looks warped, like the right part of the screenshot below:
When I run the second sample (the GreenScreen scene) I get a Null frame error:
Now I'm not really concerned the warping issue in the first scene (KinectView). I am concerned with the Background Removal feature in the second scene (GreenScreen). All I need is to see myself clipped against a custom background.
Can anyone help me figure out how to fix this NULL MSFR Frame issue?
I have uploaded the zipped project in case anyone is interested:
https://www.sendspace.com/file/j2ftqz
Thank you very much.
Update:
I have been messing with some of the Shader options in the Inspector, and noticed that all shader options work except the DX11\GreenScreenShader one. Some of them look like a normal video capture; others are better lit (additive/multiply/alpha blend/etc...).
Why is it that the DX\GreenScreenShader option is the only one that does not work, and instead show nothing more than a pink square.
Screenshot below.
Open the shader in question on your favorite text editor and change these two lines:
1) Line 15. from Texture2D _MainTex; to UNITY_DECLARE_TEX2D(_MainTex);
2) Line 59. from o = _MainTex.Sample(SampleType, i.tex); to o = UNITY_SAMPLE_TEX2D( _MainTex, i.tex );
Updating the shaders as shown above will solve the issue you describe.
Secondary Reference/Source: https://forum.unity.com/threads/kinect-v2-0-sdk-green-screen-demo-for-unity-3d-not-working-why.467687/

bundled aurelia app loads too slow

I've been playing around with a small app which is broken up as follows - listed in loading order:
a css file, which also imports bootstrap (size 124KB, 1.8s)
an "aurelia.js" file which contains all aurelia code (320KB, 1.8s)
a "myproject.js" file which contains my code (100KB, 0.9s)
a "dependencies.js" file which contains various dependencies (400KB, 1.2s)
The problem is that these files seem to load sequentially, taking around six seconds. How can I fix this?

Monogame (VB) .mgfx effect was built for a different platform

I am trying to impliment a guassian blur into my game and I keep getting this error when I try to import it into my project. Here is the code I used to define the effect:
Dim bytes As Byte() = File.ReadAllBytes("Content\Effects\effects.mgfxo")
Dim effect As Effect = New Effect(Game.graphics.GraphicsDevice, bytes)
Somewhere in the code for the .fx file do I need to specify the platform before converting it to a .mgtx? Thanks!
After much confusion, I finally came upon my answer (somewhat). The issue lied in the code inside the .fx file. This code ran without crashing on my windows 10 PC:
PixelShader = compile ps_4_0_level_9_1 PS_GaussianBlur();
After I changed the code, I used the monogame pipeline tool to convert it to an xnb file and plopped it into my content/Effects folder. I then used this code to directly run it:
Dim effect As Effect = content.Load(Of Effect)("Effects\GaussianBlur")
With all that said and done, the Gaussian blur effect does not occur. Whenever I try to do this, the output texture2D is only a solid color (color depending on what was in the top left corner of the original image). If anyone knows how to fix it than id greatly appreciate it, although I will be setting up a new question for that and give more detail.

Viewing QTMovie duration attributes?

I've probably spent the last 2 weeks searching through Apple Quicktime documentation to resolve what seems like a pretty basic question, but to no avail. Here's the issue...
I've got several short QTMovie files each containing three tracks -- the usual two containing the sound and video, plus an extra video track holding subtitled text images (making two video tracks in all). If I select one of these tracks in Quicktime Pro and export it as an 'Movie To Image Sequence' I might find say, 142 stills spread throughout the duration of the movie. My search method also reports the correct total number of frames.
Now, I've learned that you can take single-frame images, add them to a QTMovie, and set their individual on-screen display times for however long you want using 'attributeForKey:QTMovieDurationAttribute'. But how on earth do I go about accessing that data again? (which essentially just seems like the reverse of this process).
In pseudo-code what I'm trying to do is something like:
{
select video track #2 ...
call up the first image in the sequence ...
access and note its on-screen duration setting ...
call up the second image ...
access and note its duration ...
... repeat until done.
}
I'm not after editing this data or anything -- just finding out how I can get access to individual frames in a video track ... and where the HECK this timing info is hiding inside the bowels of QT.
As a senior citizen I think I'm starting to get too old for this sort of thing and Quicktime is a big, often complex and confusing framework, so if anyone can help me out with some advice or (ideally) just a few lines of sample code here I'd really appreciate it. Thanks in advance :-)
Okay. After several more days of digging and experimentation I finally found the answer to my own question. To get the (next) subtitle image I used:
// access the subtitle track
Track theTrack = [self getVideoSubtitleTrack];
// set flags to find NEXT image (ignoring the current one)...
myFlags = nextTimeStep;
// ... and search forward from current position.
GetTrackNextInterestingTime(theTrack, myFlags, playheadPos, fixed1, &nextInterestingTime, NULL);
This only finds the start of an image object though, and iterating through the track finds the leading edge of each successive image. But I wanted the end time of the current text too.
After getting the start time, I experimented with the seven available flags and found that setting the flag to 'nextTimeTrackEdit' gets the end time.