MinimalComps Flash GUI and Transcoding Errors - apache-flex

Basically, irrespective of what changes I make to my source, compiling alway yields either a transcoding error, or a missing definition.
I'm new to flash so it's difficult for me to understand how to go about fixing the problem.
Anyway here is the source.
The stack overflow link I always put in all my source, to look at for encouragement every time I feel like banging my head against the keyboard.
// Main.as
package
{
// General imports
// http://stackoverflow.com/questions/564756/should-i-just-give-up-on-programming
import com.bit101.components.Label;
import flash.display.*;
import flash.events.*;
import AssetManager;
// Begin external facing class
public class Main extends Sprite
{
public function Main()
{
var globalFont:String = AssetManager.FONT_PFRONDA;
//var myLabel:com.bit101.components.Label = new Label(Main = null, xpos = 25, ypos = 30, text = "Test Successfull");
//addChild(myLabel);
}
}
---
// AssetManager.as
package
{
public class AssetManager
{
[Embed(source = 'C:\\Documents and Settings\\Geko\\Desktop\\Flash\\testclient\\lib\\MinimalComps_0_9_5_\\src\\assets\\pf_ronda_seven.ttf', fontName = 'PF Ronda Seven', fontWeight = 'normal', advancedAntiAliasing = 'true', mimeType = 'application/x-font-truetype')] public static const FONT_PFRONDA:String;
}
}
Currently when I try to compile I get the following error...
C:\Documents and Settings\Geko\Desktop\Flash\testclient\src\Main.as(6): col: 31
Error: Definition com.bit101.components:Label could not be found.
and if I remove the comment from "var myLabel" or "addChild lines" in Main.as, then I get..
C:\Documents and Settings\Geko\Desktop\Flash\testclient\lib\MinimalComps_0_9_5_\src\com\bit101\components\Component.as(51): col: 4: Error: transcoding parameter 'embedAsCFF' is not supported by 'flex2.compiler.media.FontTranscoder'
C:\Documents and Settings\Geko\Desktop\Flash\testclient\lib\MinimalComps_0_9_5_\src\com\bit101\components\Component.as(51): col: 4: Error: Unable to transcode /assets/pf_ronda_seven.ttf.
My classpaths are "src", "lib\MinimalComps_0_9_5_\src\assets", and "lib\MinimalComps_0_9_5_\src\com\bit101\components"
I'm using Flex SDK 3.5.0.12683 on Windows XP with FlashDevelop 3.2.1 RTM
Any ideas as to why I'm constantly receiving errors each time I try to build the project?

C:\Documents and Settings\Geko\Desktop\Flash\testclient\src\Main.as(6): col: 31 Error: Definition com.bit101.components:Label could not be found.
this would suggest that the application can't find the Label class, possible reasons could be a problem with your classes library path, not importing the Label class, problem with the Label class package name etc...
The other two errors have to do with the way your font is embed. "embedAsCFF" requires Flex SDK 4.
In the error message you get a mention to the flex2 compiler.
'flex2.compiler.media.FontTranscoder'
Are you sure to be using the Flex SDK 3.5? I don't use FlashDevelop myself , so I wouldn't know where to look in order to edit the current Flex SDK.

Related

library module upgrade to Glide 4, where should the AppGlideModule be put in

In library module to upgrade to Glide 4.9.0.
api "com.github.bumptech.glide:glide:4.9.0"
api "com.github.bumptech.glide:annotations:4.9.0"
annotationProcessor "com.github.bumptech.glide:compiler:4.9.0"
and having a kotlin extension
fun ImageView.loadImg(imageUrl: String) {
// 4.+ code
var requestOptions : RequestOptions = RequestOptions()
.placeholder(ColorDrawable(Color.LTGRAY))
.diskCacheStrategy(DiskCacheStrategy.ALL)
if (!TextUtils.isEmpty(imageUrl)) {
Glide.with(context)
.setDefaultRequestOptions(requestOptions) // or use .apply(requestOptions) but after the .load()
.asBitmap()
.load(imageUrl)
.into(this)
}
}
but it crashes
java.lang.AbstractMethodError: abstract method "void com.bumptech.glide.module.RegistersComponents.registerComponents(android.content.Context, com.bumptech.glide.Glide, com.bumptech.glide.Registry)"
at com.bumptech.glide.Glide.initializeGlide(Glide.java:270)
at com.bumptech.glide.Glide.initializeGlide(Glide.java:223)
at com.bumptech.glide.Glide.checkAndInitializeGlide(Glide.java:184)
at com.bumptech.glide.Glide.get(Glide.java:168)
at com.bumptech.glide.Glide.getRetriever(Glide.java:689)
at com.bumptech.glide.Glide.with(Glide.java:716)
at com.common.extentions.ExtensionsKt.loadImg(Extensions.kt:44)
After adding
#GlideModule
class TheAppGlideModule : AppGlideModule() {
override fun isManifestParsingEnabled(): Boolean {
return false
}
}
to the library module does not help, or adding it to hosting app only does not work either,
but after adding it to both the library module and the hosting app the crash goes away.
according to documentation https://bumptech.github.io/glide/doc/generatedapi.html,
isnt it that it not supposed to have this class defined in the library module?
anyone has same experience?
* For now the API is only generated when a properly annotated AppGlideModule is found.
* There can only be one AppGlideModule per application.
* As a result it’s not possible to generate the API for a library without precluding any application
* that uses the library from using the generated API.
Resolved, it has missed
api "com.github.bumptech.glide:annotations:$versions.glide"
in the application side (not sure why adding single one in the module did not work and why with both it worked, maybe didnt do clear/rebuild after change?)

Is there anyway to test run EDIDisassembler component with pipeline testing tool?

First, Let me explain why I need do this.
I have an inbound port with EDIReceive Pipeline configuration. it receives EDI X12 837I files and disassemble these files to 837I messages.
There's one file failed with error description below:
The following elements are not closed: ns0:X12_00501_837_I. Line 1, position 829925.
It looks like the incoming file have some structure issue. Making the disassembler cannot produce the message correctly. But the error itself don't help to locate the issue. Also, no TA1 and 999 generated to help us locate the issue.
So I created a little console application using the Pipeline Component Test Library try to run this file through the edidisassembler pipeline component to see if I can find what cause the error.
The code is pretty straightforward:
namespace TestEDIDasm
{
using System;
using System.IO;
using Microsoft.BizTalk.Edi.Pipelines;
using Microsoft.BizTalk.Message.Interop;
using Winterdom.BizTalk.PipelineTesting;
using Microsoft.BizTalk.Edi.BatchMarker;
class Program
{
static void Main(string[] args)
{
var ediDasmComp = new EdiDisassembler();
ediDasmComp.UseIsa11AsRepetitionSeparator = true;
ediDasmComp.XmlSchemaValidation = true;
var batchMaker = new PartyBatchMarker();
IBaseMessage testingMessage = MessageHelper.LoadMessage(#"c:\temp\{1C9420EB-5C54-43E5-9D9D-7297DE65B36C}_context.xml");
ReceivePipelineWrapper testPipelineWrapper = PipelineFactory.CreateEmptyReceivePipeline();
testPipelineWrapper.AddComponent(ediDasmComp, PipelineStage.Disassemble);
testPipelineWrapper.AddComponent(batchMaker, PipelineStage.ResolveParty);
var outputMessages = testPipelineWrapper.Execute(testingMessage);
if (outputMessages.Count <= 0)
{
Console.WriteLine("No output message");
Console.ReadKey();
return;
}
var msg = outputMessages[0];
StreamReader sr = new StreamReader(msg.BodyPart.Data);
Console.WriteLine(sr.ReadToEnd());
Console.ReadKey();
}
}
}
I added some breakpoint but end up with following errors in message context:
"X12 service schema not found"
Clearly, the EDIDisassembler component rely on some other stuff to do its job.
Now goes to my question:
Is there anyway to make EdiDisassembler working in testing
environment?
If there any other way to debug/trace the disassembler component
processing file other than Pipeline Component Test Library?
Theoretically, sure, but you have to replicate a lot of engine context that exists during Pipeline execution. The EDI components have issues running inside Orchestrations so it's likely a pretty tall order.
Have you tried a Preserve Interchange Pipeline with the Fallback Settings? That's about as simple as you can get with the EDI Disassembler.

Sonar and Flex plugin - Dollars ($) are not accepted in java class names

In reference to this bug from Sonar:
http://jira.codehaus.org/browse/SONAR-1865
and this one (which cross references the one above):
http://jira.codehaus.org/browse/SONAR-1637
I am still seeing this issue.
I am using Sonar server version 2.12.
I am using Hudson, version 2.2.0.
I have installed the Sonar plugin in Hudson, version 1.7.2.
and, most importantly, I have the Flex plugin installed in the Sonar server. Flex plugin version is 0.4.
When I run mvn sonar:sonar -Pflex on a flex project, i get this error in the stack trace:
Caused by: java.lang.IllegalArgumentException: Java inner classes are not supported : EntityEnums$ReportParameterName
at org.sonar.plugins.flex.FlexFile.<init>(FlexFile.java:79)
at org.sonar.plugins.flex.FlexFile.fromIOFile(FlexFile.java:165)
at org.sonar.plugins.flex.FlexSourceImporter.createResource(FlexSourceImporter.java:37)
at org.sonar.api.batch.AbstractSourceImporter.parseDirs(AbstractSourceImporter.java:75)
at org.sonar.api.batch.AbstractSourceImporter.analyse(AbstractSourceImporter.java:69)
at org.sonar.api.batch.AbstractSourceImporter.analyse(AbstractSourceImporter.java:60)
at org.sonar.batch.phases.SensorsExecutor.execute(SensorsExecutor.java:64)
Here is what my class looks like, that it is complaining about:
This is an Actionscript class, file name: EntityEnums$ReportParameterName.as. It was auto-generated from java to Actionscript using GraniteDS.
package com.digabit.core.db.entity.util {
[Bindable]
public class EntityEnums$ReportParameterName {
public static const tnid:String = "tnid";
public static const uname:String = "uname";
public static const lc:String = "lc";
public static const tnkey:String = "tnkey";
public static const oid:String = "oid";
public function EntityEnums$ReportParameterName()
{
super();
}
}
}
So, according the bug reports, this has been fixed in an earlier version of Sonar that I have; but I'm still seeing it in version 2.12. And why would the error show "java inner classes..." when this is a flex/actionscript class? Is anyone still seeing this bug behavior?
Issue has been created on Sonar Flex Plugin side ( http://jira.codehaus.org/browse/SONARPLUGINS-1623 ) and most probably would be fixed in next release.

Adobe AIR: How to play local mp3 file?

I'm testing Adobe AIR with flex, and I wanted to play a mp3 via an open file dialog, I did that :
import flash.filesystem.*;
import flash.events.Event;
import flash.media.*;
import mx.core.SoundAsset;
public var loadedFile:File;
public var channel:SoundChannel;
public var song:SoundAsset;
private function loadFile():void {
loadedFile = new File();
loadedFile.browseForOpen("Open multimedia File");
loadedFile.addEventListener(Event.SELECT, fileSelected);
}
private function fileSelected(event:Event):void {
song = new SoundAsset()
song.load(URLRequest(loadedFile.url));
channel = song.play();
}
But when I try to open a file, after the Open file dialog close, I get this error :
TypeError: Error #1034: Type Coercion failed: cannot convert "file:///C:/Users/Kedare/Music/05-Scene%20V%20~%20Prelude.mp3" to flash.net.URLRequest.
I can't find anything related to that on Google or another documentation, all the docs I find is related to play a sound using URL and not Local files :(
Any idea of what can be the problem ? What can I do ?
Thank you !
Change
song.load(URLRequest(loadedFile.url));
to
song.load(new URLRequest(loadedFile.url));

How to solve null object reference after instantiate FacebookSessionUtil

I think you can help me out from this little problem.
I am a novice in Facebook developer by choosing ActionScript 3 as my developer platform. I use SWC library from official facebook-actionscript-api that promoted by Adobe.
So I followed their tutorial. So I did following instruction:
Create Flex project.
Download and put Facebook_library_v3.4_flex.swc to \lib in Flex project.
Provide following code:
import com.facebook.Facebook;
import com.facebook.utils.FacebookSessionUtil;
private var fbook:Facebook;
private var session: FacebookSessionUtil;
protected var api_key : String = "my-facebook-app-api-key";
protected var secret_key : String = "my-facebook-app-secret-key";
public function init() : void {
//fbook = new Facebook();
session=new FacebookSessionUtil(api_key,secret_key,this.loaderInfo);
var fbook : Facebook = session.facebook;
session.validateLogin();
}
After trying to run debug session. I got the error after execute this statement:
session=new FacebookSessionUtil(api_key,secret_key,this.loaderInfo);
I think I did something wrong but I couldn't figure it out. Could you help me by giving your advice or any guideline?
This is exception I got:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at com.facebook.utils::FacebookSessionUtil()[C:\Users\MikeHunt\Work\FacebookAPI\src\com\facebook\utils\FacebookSessionUtil.as:128]
at CheeseZaa/init()[/Users/teerasej/Documents/Flex Builder 3?/freelance/CheeseZaa/src/CheeseZaa.mxml:24]
at CheeseZaa/___CheeseZaa_Application1_creationComplete()[/Users/teerasej/Documents/Flex Builder 3?/freelance/CheeseZaa/src/CheeseZaa.mxml:4]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at mx.core::UIComponent/dispatchEvent()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\core\UIComponent.as:9440]
at mx.core::UIComponent/set initialized()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\core\UIComponent.as:1168]
at mx.managers::LayoutManager/doPhasedInstantiation()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\managers\LayoutManager.as:718]
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.core::UIComponent/callLaterDispatcher2()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8744]
at mx.core::UIComponent/callLaterDispatcher()[C:\autobuild\3.5.0\frameworks\projects\framework\src\mx\core\UIComponent.as:8684]
I notice that the first line of exception show this:
com.facebook.utils::FacebookSessionUtil()[C:\Users\MikeHunt\Work\FacebookAPI\src\com\facebook\utils\FacebookSessionUtil.as:128]
But I don't sure it involve in exception.
My development platform is:
Macbook Pro
OSX Snow Leopard 10.6
Flash Player 10.0.32 Debugger
Mozilla Firefox 3.6
Flex builder 3.2
Flex SDK 3.5
Facebook_library_v3.4_flex.swc
Every suggestion and guideline would be thank you. I think this would be good for other developer that may found the same problem like me.
loaderInfo is not ready and is currently null.
try:-
public function init():void
{
addEventListener(Event.ADDED_TO_STAGE, onAddedToStage, false, 0, true);
}
private function onAddedToStage(event:Event):void
{
removeEventListener(Event.ADDED_TO_STAGE, onAddedToStage);
session = new FacebookSessionUtil(api_key, secret_key, this.loaderInfo);
var fbook:Facebook = session.facebook;
session.validateLogin();
}

Resources