Flex :: Instantiating View Won't Work?
May 23, 2011
We used to write our UnitTests with FlexUnit and we were just testing our model. Now we want to test the view too. Before i run my tests i create an instance of my view and my model to test the stuff. When i try to access the view i get a null pointer exception. If i add the view to the displaylist it somehow works - even if i remove it from the list right after adding.it looks something like this:
var myView: MyView = new myView();
//myView.initialize(); will throw error
Application.application.addChild(view);[code]..............
View 3 Replies
Similar Posts:
Mar 17, 2011
I'm having this problem: I have an external fla (Dawn.as) and I want to instantiate the class from the external file into the main swf timeline, but when I try doing that I get an error:
ActionScript Code:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at Code::Chapter/initialise()
[code].....
View 5 Replies
Aug 15, 2011
I'm currently using RobotLegs with the Presentation Model pattern to develop a Flex 4 project. I understand that all business logic related to a View resides in the Presentation Model associated with that view, however, I am confused when it comes to View specific logic.For example, I have an indicator that needs to be positioned relatively to list items depending on which list item is selected. Is it acceptable in the Presentation pattern to put the logic that will position the indicator in the View and simply have that logic run in reaction to a selectedIndex property changing in the presentation model?The reason I am considering this is that since the Presentation Model does not have a reference to the view it is difficult to come up with an ideal solution for manipulating view components.
View 1 Replies
Jun 13, 2010
I have one .mxml file (the Application) with a ViewStack (with 4 views) and a ControlBard, obviously I can change the views with it, but what I want to do is: in view #1 I have an image which I want to convert to a "hyperlink", so when I click it I go to View #2, is this doable? Also I would like to pass somehow some data (like a String) to that View #2 (lets say the it's a user avatar I click so I want to go to the second view which will show me his profile, that's why I need his name/id).
View 1 Replies
Sep 28, 2011
My problem is that when I try to pass an object from the navigator.pushView(view, dataobject), I can't figure out how to access the dataobject from actionscript. I can access {dataobject.property} from MXML easily, but I want to set a variable in the new view to the passed dataobjects property.
View 1 Replies
Nov 3, 2011
I have a custom UIComponent that is basically just this:
public class WhiteboardUIComponent extends UIComponent
{
public function WhiteboardUIComponent() {
super();
[Code]....
This is absolutely the simplest that I could make the example. The s:View is gobbling up my mouse events - if I add a handler in the MXML to the View, I get mouse events just fine. When adding a handler programmatically in my subclass' constructor, I get nothing. I thought maybe the layout was wrong, so I explicitly set the dimensions of my UIComponent and stuck it in a border just to be sure it was where it was supposed to be - same deal.
View 1 Replies
Feb 13, 2011
I wrote an flash actionscript 3.0 movie that needs to use netconnection and netstream for streaming. When I test the movie through flash ide the movie connects alright.But when I insert the swf in html and view from firefox, chrome or other browser NetConnection.connect() does not work. Movie sort of hangs at the moment NetConnection.connect is called(). The function assigned to NetStatusEvent is not called and no command after that moment is carried out.It only occurs when viewed through web browser but when it is tested in flash ide it works alright.
View 1 Replies
May 25, 2010
I imported an avi video to flash, converted it to flv with Adobe media encoder, and did some symbol animation on top of it.How do I export an avi video so that the video I imported is actually playing, and not just to see the skin and flv icon? When I test the video it makes it in swf form and I'd rather not convert it any further and mess up it's quality.Is it possible to view the video in work space while animating symbols over it (I kinda did it by heart)?
View 1 Replies
Aug 3, 2010
I'm about to have to write a web page/app that will serve the agenda for circa 100 people on a page. One line per person, one column per day with 3 clickable zones in each cell. In HTML, the page is way complex for the browser to load quick and there is no possibility to click on a border between 2 cells to for example split an event that spreads among several cells. So I search an not too overkilling technology to render this kind of view. I begun with a PHP generated HTML page but the number of elements in the page make the mouse move jerky.
Moving to JAVA would give me better performances regarding the reuse of the generator of the view but it will still be an HTML page. So, here is my question: do you think that going forward with JAVA and its graphical capability is the simple solution or is Flash a better option for this part of a Web App? I'm afraid of the code I'll have to write in JAVA to handle the GUI presentation as well as the events generated by the 1000's cells plus borders of the page. In Flash, the graphical part seems simpler even if the actions handling is still huge.
View 2 Replies
Mar 18, 2010
I am wondering how to make a 360º view bubble, like they use for Google Street View, but have no idea how to go at accomplishing this task... i have the string of photos that i attached in photoshop(so that if you connected the left to the right it would be a full 360º view).
View 1 Replies
Feb 15, 2011
There is a Flex app with 7 main views. And there is a memory issue when navigating between views.All these views were in a ViewStack, but due to some involving 3D objects I assumed it was too much to have it all in the display list. I'm now clearing all children from the stack and adding/removing them when needed. This gave a small performance increase, but still becomes unresponsive with use. The strange thing is, with this and the original method, the CPU climbs with use but eventually levels out somewhere. Now I'm creating new instances of each screen when they are navigated to and setting the previous variable to null. Now it looks like CPU is spiking when the view is created, but leveling out to something much much lower than it was. This felt like progress, but now the available memory keeps climbing where it wasn't before....
My understanding was calling remove child or remove all children would mark the object for deletion when the garbage collector next ran. I can't see any other references to the instance. My code is along the lines of [code]I have a function for each button to add a new instance like the above.The only thing I can see and feel silly asking but need confirmation, is each view extends a class called "Screen", this class contains a singleton reference to some core components.[code]Would this trick the garbage collector into thinking it was still needed? General advice on clearing Objects from the memory pool would awesome!!! I've never needed to analyze the Flash Player in such depth.I think it's an error with sound drivers, removing all sound and shes purring like a kitten. Works on my machine fine with windows XP, but not on the touch pad the application is crashing on with windows 7 (unsure of the drivers looking into them now) Now I'm thinking its not the drivers, tried 3 different versions, all with no improvement. I did discover the sound was fading in and out with the TweenLite lib. Doesn't look like there are any memory leaks in TweenLite as it works fine on other machines. Just the use of volumeEasingFunction seems to consume increasing amounts of CPU until it freaks out. It is crappy hardware running windows 7, which doesn't help.
View 1 Replies
Nov 24, 2011
I have four views:1.SplitView (main view)2.SplitViewHomeView(root Panel)3.SimpleView(Right panel)4.Details(child of Right Panel View).I am trying to accomplish the split view as in Ipad in adobe flex mobile.But unable to connect the root panel to right panel...Can any one suggest the path to me.My Code is below
Split View
**
<?xml version="1.0" encoding="utf-8"?>
[code]...
View 1 Replies
Nov 25, 2010
I am using Flash CS4 AS3.. When I open my browser "Internet Explorer 7" it opens normal. But When I open a link using the following Flash code it opens half in length and half in width. I need to click on "Maximise" button to view in full. How to solve the problem? It is our Intranet link.
PM3.addEventListener(MouseEvent.CLICK,PM3ClickHandler);
function PM3ClickHandler(event:MouseEvent):void { navigateToURL (new URLRequest ("http://engineering/history/thisyear/ceomessage.htm"));
}
I tried modifying the line as well. It also doesnt work.
navigateToURL(new URLRequest ("http://engineering/history/thisyear/ceomessage.htm"), "_blank");
View 3 Replies
Oct 8, 2009
in flash, I encounted a source file that is cropped and I cannot move it, is there some sort of cropped view in flash I dont know about? I cannot find anyinformation about it, it has rulers displayed as far as I remember.
Basically you cannot move in the file to edit anything viewpoint wise, everything outside of the movie area is invisible and not there? As if cropped.
View 0 Replies
Aug 11, 2011
I have started learning flex 4 and I got myself thinking about how to change views. So I have a question what do people usually use - states or views (ViewStack). The type of web application I am making, can use both, but what do developers use in big projects or maybe they use non of the mentioned before?[code]...Best view architecture in it?
View 1 Replies
Apr 5, 2012
I want to create log file for my flex application. That is the file should contain all the trace prints in it when I run my flex application. How can I configure flex to do this?
View 3 Replies
Sep 22, 2010
Following is a simplified version of my mxml:
[Code]...
"A term is undefined and has no properties..." which points me to the line this.parent.currentState='edit'.
View 1 Replies
Jul 6, 2011
I'm developing a flex mobile app. I've declared a Titlewindow which contains the alert message following the example of "TourdeFlex". And I failed to navigate to a new View after clicking YES button.
<fx:Script>
<![CDATA[
protected function some_handler():void
{
[code]....
This code can be successfully compiled but it was wrong during runtime:Error #1009: Cannot access a property or method of a null object reference.
View 1 Replies
Jul 11, 2011
How can I refresh view after a certain event? I have a view which contains multiple groups. I want to show or hide some groups. onCreationComplete() or initialize() method works only at the beginning of the view creation.
View 2 Replies
Jul 24, 2011
Can you use PurePDF to view files or is the api only for writing them?
View 3 Replies
Aug 23, 2011
I would like to list all network shares but have no idea where to even begin my search, I assume that it has something to do with Samba etc., but really some guidance would be very useful.
I will be using Adobe AIR 2.5 - so I assume I have access to that sort of information, though I will be using the PlayBook from BlackBerry to access the network which has a full AIR implementation.
View 1 Replies
Sep 1, 2011
I'm loading an image from an async database in every view of my app. I'm using a view transition in Pop/PushView to change between views.Problem: The image loads after the ViewTransition is complete, instead of before.
And the code:
private function NextView():void
{
selectStmt = new SQLStatement();
selectStmt.sqlConnection = conn;
[code]....
View 1 Replies
Oct 23, 2011
Here's the deal:I have an image and a button on my mobile app's homeview. I apply an animation to the image by pressing the button. That works great. PROBLEM:I want to add a view transition that pushes to the next view after the animation completes.CODE:
AS:
protected function nextView()
{
[code].....
View 1 Replies
Dec 6, 2011
I need to convert a lot of stuff in my profession - so I'm building a conversion tool for my phone with some of the conversions I use a lot. Now, I want to be able to build this properly. So far, here's my code:
[Code]...
View 2 Replies
Apr 13, 2012
Suppose I have two tabs in my app:
<ViewNavigator id="tab1" firstView="Tab1">
<ViewNavigator id="tab2" firstView="Tab2">
I go into Tab1, and start pushing other views onto the stack
navigator.pushView(Tab1View1)
navigator.pushView(Tab1View2)
and so on....
Now I want to jump directly, with NO TRANSITIONS, from one of the views deep in Tab1, into one of the views in Tab2. How do I do this?
View 1 Replies
Oct 20, 2009
I want full screen view(through code,without pressing F11) of my flex application.
View 1 Replies
Dec 28, 2009
I have one question about pureMvc. I use pureMvc to build an engine, in the engine init part i have an requirement
1) moduleA must init firt
2) moduleB , moduleC need init after moduleA init complate.
3) moduleD need init after moduleB & moduleC init complate.
4) moduleA , moduleB , moduleC , moduleD all extends Proxy beacuse the four system all need to send notifiation ,but no need to listen it.
But to fit for the requirement I can't use command to do it, because they have ini order and also they need to remember current state(ex: moudelB is init Complate but moudleC is not init complete then can't init moudleD) but command is stateless. The best way I think is use one Mediator to do it, beacuse it can both listen and send notification. My question is :
1) Is this a good way to use one Mediator to do it?
2) If use Mediator is good way, then when it hear first moduleA is init complate
registerCommand(FIRST_MODULE_INIT_COMPLATE , initStepTwoCommand);
sendNotification(FIRST_MODULE_INIT_COMPLATE);
removeCommand(FIRST_MODULE_INIT_COMPLATE);
Need to do things like that way or just do the inti logic in the Mediator?
View 1 Replies
Aug 16, 2010
Flex application is contained in one of the rows of a html table, and that row is hidden as per one use case. Flex application is refreshed when visibility of the row is changed to visible. This results in lose of data that is already entered in the flex application. Is there any way to stop this behavior?
View 1 Replies
Apr 4, 2011
I have a flex-application deployed on tomcat with blazeds. User constantly selects ranges excel-document. Now, a user enters a cell addresses in text fields (for example, C1: C20). But it is very inconvenient! How to display excel-data as a table in my application? I think, I can parse excel-document using Apach POI and transmit these data to the Flex-application. But there are other ways?
View 2 Replies
Apr 14, 2011
I'm creating a pure actionscript 3 mobile project for Blackberry Playbook. One problem I have came across is that there seems to be no inbuilt way to handle view navigation. In flex mobile projects, we have the spark.components.ViewNavigator component, but this isn't available on a pure AS3 mobile project. These two links are both making their own libraries for view navigation...
[Code]....
View 2 Replies