First of all, I am a Flex beginner and I have problems with including third party swc:s to my project.
flex
├── build.gradle
└── test_oauth
├── build.gradle
└── src
└── main
├── actionscript
│ └── IFrameDemo.mxml
└── resources
├── FacebookGraphAPI.swc
└── index.html
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath group: 'org.gradlefx', name: 'gradlefx', version: '0.5'
}
}
subprojects {
apply plugin: 'gradlefx'
flexHome = '/Users/eoscnor/opt/flex'
}
type = 'swf'
mainClass = 'IFrameDemo.mxml'
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':flex:test_oauth:compile'.
> taskName compilation failed: Loading configuration file /Users/eoscnor/opt/flex/frameworks/flex-config.xml
/Users/eoscnor/Documents/psisite/flex/test_oauth/src/main/actionscript/IFrameDemo.mxml(47): Error: Definition com.adobe.serialization.json:JSON could not be found.
import com.adobe.serialization.json.JSON;
/Users/eoscnor/Documents/psisite/flex/test_oauth/src/main/actionscript/IFrameDemo.mxml(48): Error: Definition com.facebook.graph:Facebook could not be found.
import com.facebook.graph.Facebook;
/Users/eoscnor/Documents/psisite/flex/test_oauth/src/main/actionscript/IFrameDemo.mxml(49): Error: Definition com.facebook.graph.data:FacebookSession could not be found.
import com.facebook.graph.data.FacebookSession;
/Users/eoscnor/Documents/psisite/flex/test_oauth/src/main/actionscript/IFrameDemo.mxml(50): Error: Definition com.facebook.graph.net:FacebookRequest could not be found.
import com.facebook.graph.net.FacebookRequest;
/Users/eoscnor/Documents/psisite/flex/test_oauth/src/main/actionscript/IFrameDemo.mxml(62): Error: Access of undefined property Facebook.
Facebook.init(APP_ID, handleInit);
/Users/eoscnor/Documents/psisite/flex/test_oauth/src/main/actionscript/IFrameDemo.mxml(78): Error: Access of undefined property Facebook.
if (Facebook.getAuthResponse().accessToken == null) {
/Users/eoscnor/Documents/psisite/flex/test_oauth/src/main/actionscript/IFrameDemo.mxml(80): Error: Access of undefined property Facebook.
Facebook.login(handleLogin, {scope:"user_photos, publish_stream"});
/Users/eoscnor/Documents/psisite/flex/test_oauth/src/main/actionscript/IFrameDemo.mxml(82): Error: Access of undefined property Facebook.
resultTxt.appendText('\nLOG OUT:' + String(Facebook.getAuthResponse()));
/Users/eoscnor/Documents/psisite/flex/test_oauth/src/main/actionscript/IFrameDemo.mxml(83): Error: Access of undefined property Facebook.
Facebook.logout(handleLogout);
/Users/eoscnor/Documents/psisite/flex/test_oauth/src/main/actionscript/IFrameDemo.mxml(125): Error: Access of undefined property Facebook.
fbml:'<fb:header icon="false" decoration="add_border">Hello World!</fb:header><fb:profile-pic uid="'+Facebook.getAuthResponse().uid+'"></fb:profile-pic>',
/Users/eoscnor/Documents/psisite/flex/test_oauth/src/main/actionscript/IFrameDemo.mxml(161): Error: Access of undefined property Facebook.
Facebook.ui(uiCmb.selectedItem.label, uiCmb.selectedItem.data, null, uiDialog.selected?'popup':null);
/Users/eoscnor/Documents/psisite/flex/test_oauth/src/main/actionscript/IFrameDemo.mxml(165): Error: Access of undefined property Facebook.
Facebook.api(requestIdTxt.text + '/' +apiConnectionType.selectedItem.label, handleAPIComplete);
/Users/eoscnor/Documents/psisite/flex/test_oauth/src/main/actionscript/IFrameDemo.mxml(170): Error: Call to a possibly undefined method encode through a reference with static type Class.
resultTxt.appendText('\nResult:\n' + JSON.encode(response));
/Users/eoscnor/Documents/psisite/flex/test_oauth/src/main/actionscript/IFrameDemo.mxml(172): Error: Call to a possibly undefined method encode through a reference with static type Class.
resultTxt.appendText('\nFail:\n' + JSON.encode(fail));
/Users/eoscnor/Documents/psisite/flex/test_oauth/src/main/actionscript/IFrameDemo.mxml(196): Error: Access of undefined property Facebook.
Facebook.api('me/photos', handleImageUploadComplete, params);
/Users/eoscnor/Documents/psisite/flex/test_oauth/src/main/actionscript/IFrameDemo.mxml(206): Error: Access of undefined property Facebook.
Facebook.api(requestIdTxt.text, handleConnectionsLoad, {metadata:true});
/Users/eoscnor/Documents/psisite/flex/test_oauth/src/main/actionscript/IFrameDemo.mxml(231): Error: Access of undefined property Facebook.
Facebook.mobileLogin("http://dev.gskinner.com/facebook/", "touch");
/Users/eoscnor/Documents/psisite/flex/test_oauth/src/main/actionscript/IFrameDemo.mxml(235): Error: Access of undefined property Facebook.
Facebook.setCanvasSize(Number(widthTxt.text), Number(heightTxt.text));
/Users/eoscnor/Documents/psisite/flex/test_oauth/src/main/actionscript/IFrameDemo.mxml(240): Error: Access of undefined property Facebook.
Facebook.setCanvasAutoResize(autoSizeChk.selected, 250);
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
It does not look like FacebookGraphAPI.swc is available during compile time even if it is included to the build directory:
├── flex
│ ├── build.gradle
│ └── test_oauth
│ ├── build
│ │ ├── FacebookGraphAPI.swc
│ │ ├── advancedgrids_4.6.0.23201.swf
│ │ ├── charts_4.6.0.23201.swf
│ │ ├── framework_4.6.0.23201.swf
│ │ ├── index.html
│ │ ├── mx_4.6.0.23201.swf
│ │ ├── osmf_1.0.0.16316.swf
│ │ ├── rpc_4.6.0.23201.swf
│ │ ├── spark_4.6.0.23201.swf
│ │ ├── spark_dmv_4.6.0.23201.swf
│ │ ├── sparkskins_4.6.0.23201.swf
│ │ └── textLayout_2.0.0.232.swf
I have probably done something wrong. Could anyone please give me some hints about what I should do.