Hi,
I'm trying to run the lccs FlashWebCamExample on mobile.
I've created an ActionScript Mobile Project and copied the example sources to /src.
Environment is FlashBuilder 4.5 and LCCS 10.3.
I can' build the project due to error 1046: Type was not found or was not a compile-time constant: [mx.core]::IMXMLObject. FlashWebCamExample Unknown Flex Problem.
I also see warnings on WebcamSubscriber.x and WebcamSubscriber.y parameters, seems they have been depracated.
Is there something else instead?
Thanks,
Ofer
Views
Replies
Total Likes
OK, here's what I did to create a webcam on a Flex mobile project. Please
note that this will get you started, but is not meant to be
production-quality code!
1. Create a new Flex Mobile Project in FlashBuilder, and accepted the
defaults.
2. Copy the FlashWebCamExample classes into the views folder of your mobile
app.
3. Add a creationComplete handler for the default view:
creationComplete="addCam()"
4. add the following script block to your view:
<fx:Script>
<![CDATA[
import mx.core.UIComponent;
private var flashCam:FlashWebCamExample;
private function addCam():void {
flashCam= new FlashWebCamExample();
var ui:UIComponent = new UIComponent;
addElement(ui);
ui.addChild(flashCam);
}
]]>
</fx:Script>
The FlashWebCamExample class assumes that it gets created on the stage.
Because we're creating it first, then adding it to the stage, we'll need to
make some modifications to get it to run. There's almost certainly a more
elegant way to do this, but it oughtta get you started:
5. In the constructor for FlashWebCamExample, comment out the first three
lines.
6. change the authenticator and roomURL info to match your info.
7. change the last line of the contstructor from stage.addEventListener...
To addEventListener(Event.ADDED_TO_STAGE,setBackGround);
So the quick-and-dirty version of the method (with user info stripped out)
is:
public function FlashWebCamExample()
{
// stage.align = StageAlign.TOP_LEFT;
// stage.scaleMode = StageScaleMode.NO_SCALE;
// setBackGround();
//Login in to your room. Please login as room owner the first
time you run this app , so that all the nodes are created
var authenticator:AdobeHSAuthenticator = new
AdobeHSAuthenticator();
authenticator.userName="username@domain.com";
authenticator.password = "password";
_cSession.roomURL="http://collaboration.adobelivecycle.com/roomUrl";
_cSession.authenticator = authenticator;
_cSession.login();
cSession.addEventListener(SessionEvent.SYNCHRONIZATIONCHANGE,
onLogin);
addEventListener(Event.ADDED_TO_STAGE,setBackGround);
}
I hope that helps.
sasha
Views
Replies
Total Likes
Hi Sasha,
I tried it and got the following error on FlashWebCamExample.as:
"A file found in a source-path must have the same package structure 'views', as the definition's package, ''. FlashWebCamExample.as /FlashWebCam/src/views Unknown Flex Problem"
any idea?
thanks,
ofer
Views
Replies
Total Likes
Add the following to the top of the file:
package views
{
Add a corresponding } at the end.
You may need to do this for all the other .as files you've copied over from
the examples as well.
Thanks
sasha
Views
Replies
Total Likes
Hi Sasha,
Now its running. but when reaching the last line in the ctor: stage.addEventListener(Event.RESIZE,setBackGround);
it crashes saying stage is null.
ofer
Views
Replies
Total Likes
As I mentioned (or meant to mention, anyway), you need to change that line
to addEventListener(Event.ADDED_TO_STAGE,setBackGround);
Or, you can actually just comment it out, for simplicity's sake.
Views
Replies
Total Likes
Missed this one,
now I changed and its running.
thanks,
Ofer
Views
Replies
Total Likes
Hi Sasha,
On initiation I et th following null pointer exception:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
The full log is bellow.
I verified skype or any other webcam aplication are diabled.
ofer
[SWF] FlashWebCam.swf - 3,183,924 bytes after decompression
Tue Jun 28 00:46:51 GMT+0300 2011 LCCS SDK Version : 1.4.0 Player Version : AND 10,2,153,1
00:46:51 GMT+0300 requestInfo https://collaboration.adobelivecycle.com/oferkruzel/myfirstroom?mode=xml&glt=g:&x=0.0815352820791304...
00:46:54 GMT+0300 authentication status: 200
00:46:54 GMT+0300 authentication request complete
00:46:54 GMT+0300 requestInfo https://collaboration.adobelivecycle.com/oferkruzel/myfirstroom?gak=cmVuZ2EqbmExcioxMzBkMzExYzJmZipF...
00:46:55 GMT+0300 #TicketService# ticket received: b0v746a5zw1m
00:46:55 GMT+0300 Getting FMS at https://na2.collaboration.adobelivecycle.com/fms?ticket=b0v746a5zw1m&proto=rtmfp, attempt #1/3
00:46:56 GMT+0300 result: <fms>
<origin>fms5.acrobat.com</origin>
<proto_ports>rtmfp:1935,rtmps:443</proto_ports>
<retry_attempts>2</retry_attempts>
</fms>
00:46:56 GMT+0300 protocols: [object ProtocolPortPair],[object ProtocolPortPair]
00:46:56 GMT+0300 [attempt 1 of 2] Connecting to 0/1: rtmfp://fms5.acrobat.com/cocomo/na2-sdk-e151f9a7-13e9-4b92-8e95-bf213ea244a5/myfirstroom #startProtosConnect#
00:46:57 GMT+0300 tempNetStatusHandler 0/2,NetConnection.Connect.Success
00:46:57 GMT+0300 isTunneling? false
00:46:57 GMT+0300 is using RTMPS? false
00:46:57 GMT+0300 RECEIVED LOGIN AT SESSION
00:46:57 GMT+0300 .user descriptor from server [object]
00:46:57 GMT+0300 \\
00:46:57 GMT+0300 .displayName [string]= Ofer Kruzel
00:46:57 GMT+0300 .userID [string]= WCD-09CA39954DA730DC0A490D45
00:46:57 GMT+0300 .affiliation [number]= 100
00:46:57 GMT+0300 .role [number]= 100
00:46:57 GMT+0300 RECEIVENODES UserManager
00:46:57 GMT+0300 receiveAllSynchData UserManager
00:46:57 GMT+0300 RECEIVENODES FileManager
00:46:57 GMT+0300 receiveAllSynchData FileManager
00:46:57 GMT+0300 checkManagerSync:[object FileManager]
00:46:57 GMT+0300 RECEIVENODES AVManager
00:46:57 GMT+0300 receiveAllSynchData AVManager
00:46:57 GMT+0300 checkManagerSync:[object StreamManager]
00:46:58 GMT+0300 RECEIVENODES RoomManager
00:46:58 GMT+0300 receiveAllSynchData RoomManager
00:46:58 GMT+0300 checkManagerSync:[object RoomManager]
00:46:58 GMT+0300 checkManagerSync:[object UserManager]
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at com.adobe.rtc.session.sessionClasses::SessionContainerProxy/get userManager()[/Users/arun/Work/aponnusa_theoden.corp.adobe.com_1666/main/connect/cocomoPlayer10/src/com/adobe/rtc/session/sessionClasses/SessionContainerProxy.as:173]
at com.adobe.rtc.collaboration::WebcamSubscriber/subscribe()[/Users/arun/Work/aponnusa_theoden.corp.adobe.com_1666/main/connect/cocomoPlayer10/src/com/adobe/rtc/collaboration/WebcamSubscriber.as:700]
at views::FlashWebCamExample/onLogin()[C:\Ofer\Otehrs\Adobe tests\FlashWebCam\src\views\FlashWebCamExample.as:86]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at com.adobe.rtc.session::ConnectSession/checkManagerSync()[/Users/arun/Work/aponnusa_theoden.corp.adobe.com_1666/main/connect/cocomoPlayer10/src/com/adobe/rtc/session/ConnectSession.as:562]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at com.adobe.rtc.sharedManagers::UserManager/userReceivedOrEdited()[/Users/arun/Work/aponnusa_theoden.corp.adobe.com_1666/main/connect/cocomoPlayer10/src/com/adobe/rtc/sharedManagers/UserManager.as:1397]
at com.adobe.rtc.sharedManagers::UserManager/onItemReceive()[/Users/arun/Work/aponnusa_theoden.corp.adobe.com_1666/main/connect/cocomoPlayer10/src/com/adobe/rtc/sharedManagers/UserManager.as:1216]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at com.adobe.rtc.sharedModel::CollectionNode/http://www.adobe.com/2006/connect/cocomo/messaging/internal::receiveItem()[/Users/arun/Work/aponnusa_theoden.corp.adobe.com_1666/main/connect/cocomoPlayer10/src/com/adobe/rtc/sharedModel/CollectionNode.as:777]
at com.adobe.rtc.messaging.manager::MessageManager/http://www.adobe.com/2006/connect/cocomo/messaging/internal::receiveItem()[/Users/arun/Work/aponnusa_theoden.corp.adobe.com_1666/main/connect/cocomoPlayer10/src/com/adobe/rtc/messaging/manager/MessageManager.as:718]
at com.adobe.rtc.session.managers::SessionManagerBase/receiveItem()[/Users/arun/Work/aponnusa_theoden.corp.adobe.com_1666/main/connect/cocomoPlayer10/src/com/adobe/rtc/session/managers/SessionManagerBase.as:413]
Views
Replies
Total Likes
Hi Oferku,
I am guessing your issue, as I am not sure of your setup. Since you are tweaking the FlashWebCamExample, add the following lines on FlashWebCamExample.as file.
Change you onLogin method, to the code below. We are just explicitly setting the connectSession to all the LCCS components that are getting initialized.
// Add the WebCam Subscriber & the WebCam Publisher.
_webCamSubscriber = new WebcamSubscriber();
_webCamSubscriber.width = stage.stageWidth/2;
_webCamSubscriber.height = stage.stageHeight/2;
_webCamSubscriber.connectSession = _cSession;
_webCamSubscriber.subscribe();
// WebCam Publisher
_webCamPublisher = new WebcamPublisher();
_webCamPublisher.connectSession = _cSession;
//_webCamPublisher.publish();
_webCamSubscriber.webcamPublisher = _webCamPublisher;
addChild(_webCamSubscriber);
//SharedProperty for a shared Caption
_sharedProperty = new SharedProperty();
_sharedProperty.sharedID = "sharedCaption";
_sharedProperty.addEventListener(CollectionNodeEvent.SYNCHRONIZATION_CHANGE,onSharedPropSync);
_sharedProperty.addEventListener(SharedPropertyEvent.CHANGE,onSharedPropChange);
_sharedProperty.connectSession = _cSession;
_sharedProperty.subscribe();
Thanks
Arun
Views
Replies
Total Likes
Ofer,
I forgot to mention one additional step you'll need to do (although I do not
believe it's causing the exact problem you've been seeing).
There will be a file in your Flash Builder Project named something like
appname-app.xml.
Near the bottom, there's a section for the android manifest. You'll need to
uncomment the line that reads:
<uses-permission android:name="android.permission.CAMERA"/>
Thanks
sasha
Views
Replies
Total Likes
Hi Arun and Sasha,
The above changes got me passed onLogin.
I now see exception on the folowing:
VerifyError: Error #1014: Class mx.controls::Label could not be found.
Setup is:
windows 7
Flash Builder 4.5
Flash SDK 4.5
LCCS 10.3
Running in debug on desktop in mobile emulation mode for Android 2
Log
09:01:47 GMT+0300 RECEIVED LOGIN AT SESSION
09:01:47 GMT+0300 .user descriptor from server [object]
09:01:47 GMT+0300 \\
09:01:47 GMT+0300 .displayName [string]= Ofer Kruzel
09:01:47 GMT+0300 .role [number]= 100
09:01:47 GMT+0300 .affiliation [number]= 100
09:01:47 GMT+0300 .userID [string]= WCD-09CA39954DA730DC0A490D45
09:01:47 GMT+0300 RECEIVENODES UserManager
09:01:47 GMT+0300 receiveAllSynchData UserManager
09:01:47 GMT+0300 RECEIVENODES FileManager
09:01:47 GMT+0300 receiveAllSynchData FileManager
09:01:47 GMT+0300 checkManagerSync:[object FileManager]
09:01:47 GMT+0300 RECEIVENODES AVManager
09:01:47 GMT+0300 receiveAllSynchData AVManager
09:01:47 GMT+0300 checkManagerSync:[object StreamManager]
09:01:47 GMT+0300 RECEIVENODES RoomManager
09:01:47 GMT+0300 receiveAllSynchData RoomManager
09:01:48 GMT+0300 checkManagerSync:[object RoomManager]
09:01:48 GMT+0300 checkManagerSync:[object UserManager]
VerifyError: Error #1014: Class mx.controls::Label could not be found.
at com.adobe.rtc.collaboration::WebcamSubscriber/updateSubscribersDisplay()[/Users/arun/Work/aponnusa_theoden.corp.adobe.com_1666/main/connect/cocomoPlayer10/src/com/adobe/rtc/collaboration/WebcamSubscriber.as:1548]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at com.adobe.rtc.util::Invalidator/onInvalidationComplete()[/Users/arun/Work/aponnusa_theoden.corp.adobe.com_1666/main/connect/cocomoPlayer10/src/com/adobe/rtc/util/Invalidator.as:78]
at flash.events::EventDispatcher/dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.utils::Timer/tick()
Views
Replies
Total Likes
Ofer, are you sure you're using the Flash Only version of the LCCS
libraries? Because there should not be any mx components referred to at all.
So either you have used a label in whatever app you are creating, or (more
likely) you're using a flex version of the LCCS libraries. Please check to
make sure you're compiling against the SWC in
com.adobe.lccs/libs/flashOnly/player10.1/lccsFlash.swc
Thanks
sasha
Views
Replies
Total Likes
is there lccsFlash.swc for 10.3 ?
Views
Replies
Total Likes
Views
Replies
Total Likes
I tried it with lccsFlash 10.1.
it won't crash now ,but will just hang, nothing shown on stage...
Log as follow:
21:08:50 GMT+0300 protocols: [object ProtocolPortPair],[object ProtocolPortPair]
21:08:50 GMT+0300 [attempt 1 of 2] Connecting to 0/1: rtmfp://fms8.acrobat.com/cocomo/na2-sdk-e151f9a7-13e9-4b92-8e95-bf213ea244a5/myfirstroom #startProtosConnect#
21:08:51 GMT+0300 tempNetStatusHandler 0/2,NetConnection.Connect.Success
21:08:51 GMT+0300 isTunneling? false
21:08:51 GMT+0300 is using RTMPS? false
21:08:52 GMT+0300 RECEIVED LOGIN AT SESSION
21:08:52 GMT+0300 .user descriptor from server [object]
21:08:52 GMT+0300 \\
21:08:52 GMT+0300 .role [number]= 100
21:08:52 GMT+0300 .displayName [string]= Ofer Kruzel
21:08:52 GMT+0300 .affiliation [number]= 100
21:08:52 GMT+0300 .userID [string]= WCD-09CA39954DA730DC0A490D45
21:08:53 GMT+0300 RECEIVENODES UserManager
21:08:54 GMT+0300 receiveAllSynchData UserManager
21:08:54 GMT+0300 RECEIVENODES FileManager
21:08:54 GMT+0300 receiveAllSynchData FileManager
21:08:54 GMT+0300 checkManagerSync:[object FileManager]
21:08:54 GMT+0300 RECEIVENODES AVManager
21:08:55 GMT+0300 receiveAllSynchData AVManager
21:08:55 GMT+0300 checkManagerSync:[object StreamManager]
21:08:55 GMT+0300 RECEIVENODES RoomManager
21:08:55 GMT+0300 receiveAllSynchData RoomManager
21:08:55 GMT+0300 checkManagerSync:[object RoomManager]
21:08:55 GMT+0300 checkManagerSync:[object UserManager]
21:08:55 GMT+0300 RECEIVENODES sharedCaption
21:08:55 GMT+0300 receiveAllSynchData sharedCaption
Views
Replies
Total Likes
Are using the Simulator, or are you trying this directly on a device? Do you
see a stop/start button on stage to click?
Views
Replies
Total Likes
Using simulator for now.
No buttons, just white screen.
Ofer
Views
Replies
Total Likes
If there's nothing appearing on screen, it seems possible that you have not added the FlashWebCamExample class to the stage.
DO you have a default view in your application?
Did you add the first block of code I mentioned in this message: http://forums.adobe.com/message/3765114#3765114 to it?
Here's the full code of the default view in my test app:
<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" title="HomeView" creationComplete="addCam()">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<fx:Script>
<![CDATA[
import mx.core.UIComponent;
private var flashCam:FlashWebCamExample;
private function addCam():void {
flashCam= new FlashWebCamExample();
var ui:UIComponent = new UIComponent;
addElement(ui);
ui.addChild(flashCam);
}
]]>
</fx:Script>
</s:View>
If you've already got this in your default view, I suggest you put a breakpoint in the addCam() method and make sure it's getting called.
Views
Replies
Total Likes
Yap, Its all there.
all initialization methods are called, I verified that.
Ofer
Views
Replies
Total Likes
Well, if you're not seeing any stop/start button text, it seems likely that
either the component is not getting added to the stage or it's being located
or sized incorrectly. I'd suggest that you ensure it's all being initialized
correctly by debugging into the constructor and the setBackGround methods.
Thanks
sasha
Views
Replies
Total Likes
Hi Sasha,
I seems to go through all the GUI initialization methods.
I'm attaching the code.
I appreciate your patience.
Ofer
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies