Misrepresentation when running in different Simulator

Hello

When I run my app in the simulator of bold9900, the layout of the display list is fine.

However when I change 9550 Simulator, the display is distorted as below: -.

Here is my code: -.

SerializableAttribute public class PredictionScreen extends form {}
    
private LabelField title;
Private VerticalFieldManager mainManager;
Private VerticalFieldManager subManager;
_introBitmap1 private bitmap; Mayan calendar
_introBitmap2 private bitmap; The book of revelation
_introBitmap3 private bitmap; Age of Aquaris
_introBitmap4 private bitmap; Nostradamus
_introBitmap5 private bitmap; King Solomon
_introBitmap6 private bitmap; Nibiru
private int deviceWidth = Display.getWidth ();
private int deviceHeight = Display.getHeight ();
private ListField _listField;
private vector _listElements;
    
public PredictionScreen() {}
    
Super (MainScreen.NO_VERTICAL_SCROLL |) MainScreen.NO_HORIZONTAL_SCROLLBAR);
title = new LabelField ("PRÉDICTIONS", LabelField.HCENTER |) LabelField.USE_ALL_WIDTH);
setTitle (title);
        
mainManager = new VerticalFieldManager(Manager.NO_VERTICAL_SCROLL |) Manager.NO_VERTICAL_SCROLLBAR | Manager.USE_ALL_HEIGHT | Manager.USE_ALL_WIDTH) {}
/*
{} public void paint (Graphics graphics)
                
Graphics.Clear; Clears the area of complete graph in the current background color.
graphics.drawBitmap (0, 0, deviceWidth, deviceHeight, _backgroundBitmap, 0, 0);
Super.Paint (Graphics); Paint the visible area of the Manager
                
}
*/
};
        
subManager = new VerticalFieldManager (Manager.VERTICAL_SCROLL |) Manager.VERTICAL_SCROLLBAR) {}
protected void sublayout (int maxWidth, maxHeight int) {}
int displayWidth = deviceWidth;
int displayHeight = deviceHeight;
Super.sublayout (displayWidth, displayHeight); Sets out the Manager field controlled
setExtent (displayWidth, displayHeight); Sets the scope of this field. The field calls this method during the page layout to define its scope (height and width).
}
};
        
_listElements = new Vector();
_listField = new ListField();
ListCallback _callback = new ListCallback();
_listField.setCallback (_callback);
_listField.setRowHeight (125);
initializeList();
        
subManager.add (_listField);
mainManager.add (subManager);
Add (mainManager);
        
}
    
private void initializeList() {}
         
String itemOne = "the Mayan calendar";
String itemTwo = "the book of revelation."
String itemThree = "in the age of Aquarius."
String itemFour = 'Prophecies of Nostradamus';
String itemFive = 'King Solomon';
String itemSix = "Nibiru";
         
_introBitmap1 = Bitmap.getBitmapResource ("1.jpg");
_introBitmap2 = Bitmap.getBitmapResource ("2.jpg");
_introBitmap3 = Bitmap.getBitmapResource ("3.jpg");
_introBitmap4 = Bitmap.getBitmapResource ("4.jpg");
_introBitmap5 = Bitmap.getBitmapResource ("5.jpg");
_introBitmap6 = Bitmap.getBitmapResource ("6.jpg");
         
_introBitmap1 = ImageUtil.bestFit (_introBitmap1, Display.getWidth (), 1000);
_introBitmap2 = ImageUtil.bestFit (_introBitmap2, Display.getWidth (), 1000);
_introBitmap3 = ImageUtil.bestFit (_introBitmap3, Display.getWidth (), 1000);
_introBitmap4 = ImageUtil.bestFit (_introBitmap4, Display.getWidth (), 1000);
_introBitmap5 = ImageUtil.bestFit (_introBitmap5, Display.getWidth (), 1000);
_introBitmap6 = ImageUtil.bestFit (_introBitmap6, Display.getWidth (), 1000);
         
_listElements.addElement ("itemOne");
_listElements.addElement (itemTwo);
_listElements.addElement (itemThree);
_listElements.addElement (itemFour);
_listElements.addElement (itemFive);
_listElements.addElement (itemSix);
        
reloadList();
}
    
private void reloadList() {}
_listField.setSize (_listElements.Size ());
_listField.setRowHeight (125);
}
    
private class ListCallback implements {ListFieldCallback}
' public void drawListRow (list ListField, Graphics g, int index, int y, int w) {}
System.out.println("~~~drawListRow");
String text = (String) _listElements.elementAt (index);
_listField.setRowHeight (125);
{Switch (index)}
case 0:
g.setColor (Color.WHITE);
g.drawLine (0, y, w, y);
g.setColor (Color.BLACK);
void drawBitmap (int x, int y, int width, int height, bitmap Bitmap, int left, int high)
g.drawBitmap (0, y + (list.getRowHeight () - _introBitmap1.getHeight (()) / 2, _introBitmap1.getWidth (), _introBitmap1.getHeight (), _introBitmap1, 0, 0);
g.drawBitmap (0, _introBitmap1.getWidth (), _introBitmap1.getHeight (), _introBitmap1, 0, 0);
g.drawText (text, y 10, + (list.getRowHeight () - list.getFont().getHeight())/2, DrawStyle.HDEFAULT, w);)
g.setColor (Color.WHITE);
g.drawLine (0, y, w, y);
break;
                        
case 1:
g.setColor (Color.WHITE);
g.drawLine (0, y, w, y);
g.setColor (Color.BLACK);
g.drawBitmap (0, y + 300, _introBitmap2.getWidth (), _introBitmap2.getHeight (), _introBitmap2, 0, 0);
g.drawBitmap (0, y + (list.getRowHeight () - _introBitmap2.getHeight())/2,_introBitmap2.getWidth(),_introBitmap2.getHeight(),_introBitmap2,0,0);)
g.drawText (text, y 10, + (list.getRowHeight () - list.getFont().getHeight())/2, DrawStyle.HDEFAULT, w);)
g.setColor (Color.WHITE);
g.drawLine (0, y, w, y);
break;
                    
case 2:
g.setColor (Color.WHITE);
g.drawLine (0, y, w, y);
g.setColor (Color.BLACK);
g.drawBitmap (0, y + 600, _introBitmap3.getWidth (), _introBitmap3.getHeight (), _introBitmap3, 0, 0);
g.drawBitmap (0, y + (list.getRowHeight () - _introBitmap3.getHeight())/2,_introBitmap3.getWidth(),_introBitmap3.getHeight(),_introBitmap3,0,0);)
g.drawText (text, y 10, + (list.getRowHeight () - list.getFont().getHeight())/2, DrawStyle.HDEFAULT, w);)
g.setColor (Color.WHITE);
g.drawLine (0, y, w, y);
break;
                    
case 3:
g.setColor (Color.WHITE);
g.drawLine (0, y, w, y);
g.setColor (Color.BLACK);
g.drawBitmap (0, y + 600, _introBitmap3.getWidth (), _introBitmap3.getHeight (), _introBitmap3, 0, 0);
g.drawBitmap (0, y + (list.getRowHeight () - _introBitmap4.getHeight())/2,_introBitmap4.getWidth(),_introBitmap4.getHeight(),_introBitmap4,0,0);)
g.drawText (text, y 10, + (list.getRowHeight () - list.getFont().getHeight())/2, DrawStyle.HDEFAULT, w);)
g.setColor (Color.WHITE);
g.drawLine (0, y, w, y);
break;
                    
case 4:
g.setColor (Color.WHITE);
g.drawLine (0, y, w, y);
g.setColor (Color.BLACK);
g.drawBitmap (0, y + 600, _introBitmap3.getWidth (), _introBitmap3.getHeight (), _introBitmap3, 0, 0);
g.drawBitmap (0, y + (list.getRowHeight () - _introBitmap5.getHeight())/2,_introBitmap5.getWidth(),_introBitmap5.getHeight(),_introBitmap5,0,0);)
g.drawText (text, y 10, + (list.getRowHeight () - list.getFont().getHeight())/2, DrawStyle.HDEFAULT, w);)
g.setColor (Color.WHITE);
g.drawLine (0, y, w, y);
break;
                    
case 5:
g.setColor (Color.WHITE);
g.drawLine (0, y, w, y);
g.setColor (Color.BLACK);
g.drawBitmap (0, y + 600, _introBitmap3.getWidth (), _introBitmap3.getHeight (), _introBitmap3, 0, 0);
g.drawBitmap (0, y + (list.getRowHeight () - _introBitmap6.getHeight())/2,_introBitmap6.getWidth(),_introBitmap6.getHeight(),_introBitmap6,0,0);)
g.drawText (text, y 10, + (list.getRowHeight () - list.getFont().getHeight())/2, DrawStyle.HDEFAULT, w);)
g.setColor (Color.WHITE);
g.drawLine (0, y, w, y);
break;
}
}
         
public Object get (ListField list, int index) {}
               
Return _listElements.elementAt (index);
}
         
public int indexOfList (String prefix, ListField list, int string) {}
              
Return _listElements.indexOf (prefix, string);
}
         
public int getPreferredWidth (ListField list) {}
              
Return Display.getWidth ();
}
         
}

protected boolean navigationClick (int status, int time) {}
          
System.out.println ("~ ~ ~ click =" + _listField.getSelectedIndex ());
If (_listField.getSelectedIndex () == 0) {}
              
UiApplication.getUiApplication () .pushScreen (new MayanCalendarScreen());
}
          
If (_listField.getSelectedIndex () == 1) {}
              
UiApplication.getUiApplication () .pushScreen (new BookOfRevelationScreen());
}
          
If (_listField.getSelectedIndex () == 2) {}
              
UiApplication.getUiApplication () .pushScreen (new AgeOfAquariusScreen());
}
          
If (_listField.getSelectedIndex () == 3) {}
              
UiApplication.getUiApplication () .pushScreen (new NostradamusScreen());
}
          
If (_listField.getSelectedIndex () == 4) {}
              
UiApplication.getUiApplication () .pushScreen (new KingSolomonScreen());
}
          
If (_listField.getSelectedIndex () == 5) {}
              
UiApplication.getUiApplication () .pushScreen (new NibiruScreen());
}
          
Returns true;
          
}
        
}

Looking at it, I would like to make two General comments

(a) you should try to avoid using pixels as dimensions for what it is, as the number of pixels on a screen and these pixels (IPR) density varies between devices, so everything is designed in a pixel as a means will not look good on devices with different screens.  For more details, see this recent thread:

http://supportforums.BlackBerry.com/T5/Java-development/how-to-develop-UI-that-is-standard-in-all-BL...

(b) I'm not sure you fully understand how ListField works for you.  When the drawListRow is called, the ListField gave you a position which corresponds to the position of the selected entry (this is essentially the index * your height rank listfields).  So you should use this instead of trying to calculate an offset.  In addition, the general approach is have a generic routine that displays any item in your listField.  So at the beginning of the drawListRow, you get the correct item (using the index), and then the rest of the treatment is content to display only a specific article.

What I would have done it, is to create a class named book, which has a title and a picture, the book added to a vector and then use this vector in the drawListRow.  I would like to get the book of the vector corresponding to the index and displays entry.

You could do the same sort of thing by creating a vector of your titles (which you are already doing) and a vector for your images, and then in drawListRow use the index to choose the title and the image of the vector.  Would save a load of code.  And make your independent ListField size, so you can easily add a new book!

Another comment:

Why you set the scope of the subManager:

Super.sublayout (displayWidth, displayHeight); Sets out the Manager field controlled
setExtent (displayWidth, displayHeight); Sets the scope of this field. The field calls this method during the page layout to define its scope (height and width).

I would remove the setExtent.

In any case to really comment on distortion, it would be good to see some screenshots.  May was able to show us these?

Tags: BlackBerry Developers

Similar Questions

  • No keyboard when running Android BlackBerry 10 Simulator application

    I have my first Android app running on the Simulator BB10 Dev Alpha (10.0.10.261), which works well, other that the keyboard does not appear. My application contains code to show and hide the keyboard at opportune moments, but this does not display on the BB10 Simulator (works fine on Android devices). Is this a bug with the Simulator? Has anyone else had correctly show/hide the BB10 to their Android keyboard?

    Hey brijmohanyadav,

    He had some problems with the management framework of the Android inputs on older simulators.

    Try it on the most recent 10.2.1 simulator (https://developer.blackberry.com/android/tools/) operating system or newer (https://developer.blackberry.com/devzone/blackberry10devalpha/devalpha_update.html) and see if you can reproduce here.

    See you soon,.

  • Problem when running of several blocks of entire function

    Hello

    I'm building a great system/function using LabVIEW. Therefore, to practice and make look it tidy, I create a VI of blocks to separate and combine certain functions. But, my problem is when I did, the simulation seems to work really slow and the results are different compared to when I had the whole function/system in a single block.

    For your information, every VI blocks that I created has a loop control and simulation. When I have all interconnected, I put them all in another loop control and simulation, because some functions that I use to connect them together could not be used without the loop.

    Wondering if having a loop control and simulation in every block contributes effectively to this problems as each loop will run depends on the number of time that I put in the loop.

    If it doesn't matter which method to avoid this problem happen? My system/function looks terribly messy and it will be difficult for me to present no later than at the end of my project.

    Thank you.

    Hello

    I think what you are trying to achieve is to use simulation subsystem functionality. This allows the functions to execute outside a loop of simulation so that you can create a Subvi. After selecting the functions in your simulation loop you would like to be in a Subvi, select Edit» create Simulation subsystem. Let me know if that helps!

    Also, here is some information for this: http://zone.ni.com/reference/en-XX/help/371894E-01/lvsimhowto/sim_h_subsyssa/

    -Zach

  • Activity monitor close unexpectedly when running in the background on the left

    Recently upgraded to Mac OS Sierra and Activity Monitor to close unexpectedly when running back plan left (do not smoke and open the activity monitor window) to a blank desktop when you use an application in another office. Clean install I tried but the activity monitor would still be down at random times when left running in the background to another empty office. Someone at - there experience this problem? For most browsing on the web using Safari on another desktop computer when Activity Monitor quit unexpectedly.

    Activity monitor also using a lot of energy since the upgrade?

    Any help would be appreciated. Thank you.

    Model: MacBook Pro (retina, 13 inches, early 2015)

    OS: macOS Sierra: 10.12 (installed via the upgrade, own installed after this problem).

    Do not forget that you are using the activity monitor version which was installed when you upgraded to Sierra. Activity monitor located in the your Mac utilities folder.

    If you have moved a previous version to a different location, it will not work.

    If you are using the correct version, post crash report. Error reports lies in the application of the Console under System reports or reports from usersand end in the suffix .crash. If you choose to do so, omit or hide any information that you consider personal.

  • Satellite L500-1XD - why the screen jump when running on batteries?

    I recently bought my L500 and it works very well when it is connected to the electric network, but when I running on battery the screen jumps and flickers.
    I was told to look at the BIOS but that seems fine.

    Any ideas?

    Thank you
    Kate

    Jumps and flickers?
    The same happens when you use different power management?

  • How to load a picture of the XYgraphs when running

    Hello everyone.  I need to load a picture of the XYgraphs when running.  Each element of the array is a collection, an item is an XY Chart.  Each curve on its own XYgragh is generated as part of a search optimization.  The number of curves generated based on input from the user during execution.  Resulting curves can be sorted by the user according to different criteria.  Using the sorted curves, the user selects one or more games associated with operating conditions.  So, only 1 curve by graphic, as each curve has its own functioning conditions who were responsible of his generation (the other members of the collection).

    When I try to connect the data a little test vi, I get the error listed... that seems to be complaining that my data types match actually! ??

    Thanks a bunch

    Terry

    Look more closely at your data types.  Upstairs, you have two tables 1 d of double grouped.  While done in a 1 d table.  It is a pink cluster, transformed into a table 1 d of pink cluster.

    Look at the empty table going into the shift register.  Your XY graph is a table 1 d with a bunch of Brown.  This Brown cluster consists of two double scalars, not the two table 1 d double you up there.

    In your loop For on the top, try to convert the blue Angelfish in doubles, then the two values to group together.  Feed this cluster at the edge of the loop For and auto-index on this tunnel. Now, you will have a table 1 d with a bunch of doubles.  Which feed the element of the XY cluster at the bottom.

  • How to create the .cod file to run on the Simulator BB9900

    Hi, I already from the zip package in order to use the bbwp command to create the .cod file and be able to run on the simulator of BB9900, but when I run this command as described in: https://developer.blackberry.com/html5/documentation/compile_ww_app_for_smartphones_1873321_11.html

    It creates two files, each with a .bar file, this type of file, I can't run it on the 9900 Simulator but a .cod file is required to run applications on the sim card.

    I don't know how to create the .cod file.

    Thank you

    Have you used Blackberry Webworks SDK for smartphone or Tablet SDK? The .cod files should be located in the subfolder OTAInstall of your output folder if you are using the Webworks SDK for Smartphone

  • Application developed in Flash CS5 will not run on a Simulator

    Hi All-

    I have a few applications that I created using Flash CS5 and adobe Air 2.5. Applications work fine in flash, but when I try to run on the Simulator I get an icon of 'thinking '... (5 points that scroll on the screen as if the PlayBook (Simulator) is stuck thinking)

    Any thoughts on how to solve this problem?

    nothing not (no pun intended hah) strikes me as being wrong. The magic.bar is in tiny vs the rest, but I don't think it would affect anything. also all the xml code under the original XML code you posted im assuming that was a copy and paste error? You seem to have all of the required fields you need for file descriptor.

  • Application created using the BB for Eclipse plugin does not run in the Simulator

    Hi all!

    I created an application using BB plugin for Eclipse.  I try to run in the Simulator, but it never gets displayed (the application icon is never shown).  However, I create a "Hello World" sample, which works perfectly in the Simulator.  My application in Eclipse has never shows all files .cod or .jad, there only have files .jdp and .rapc

    My doesn´t app have encoding problems or errors of any kind (at least not displayed in the view of error).

    TIP: I have copy - paste code in different applications, is that a problem?

    I tried:

    • Restart Eclipse,
    • Configuration of active building of blackberry,
    • Cleaning of the project,
    • Creation of the project,
    • Reinstall Eclipse,

    but none of this seems to work.

    Can someone help me please?

    Best regards

    Juan.

    Hi all!

    In the event that a person gets the same problem, I mentioned.  I found the solution: it turns out that I had a very high class with a lot of code on it and that s the reason why the application does not get launched into the Simulator.  What I did that I shared this class on the 4different classes each managing different parts of the code and now it works perfectly.

    Hope someone is enjoying this, cause I spent a lot of time trying to figure out what the problem was.

    Best regards

    Juan.

  • Is it possible to indicate an application runs only on Simulator?

    Hello

    I am developing an application running on a simulator, so that it can avoid the code signing.

    How to indicate in build.xml when bb-ant-tool?

    Thank you.

    as mentioned in the main() jonberry, you can check...

    if(!DeviceInfo.isSimulator())
        return false;
    
  • TopLink Grid: Create EntityManager fails when running on WebLogic

    Hello
    I am creating WebService that usus TopLink grid to access data. First of all I created simple stand-alone application with TopLink grid and all work very well. Then, I created WebService based on app created previously.
    When I try to run WebService deployed on WebLogic, I got error:
    "line Class ="Oracle.EclipseLink.Coherence.Integrated.config.GridCacheCustomizer"file =" GridCacheCustomizer.java "="30"method ="Customize. "
    java.lang.NoSuchMethodError org.eclipse.persistence.descriptors.ClassDescriptor.setFullyMergeEntity (Z) V
    It fails in the entityManagerFactory.createEntityManager () method.
    If deleted the eclipse configuration file - link.xml webservice customizer statement works. Maybe for server application needed some additional configuration or initialization?


    Thank you
    Alex

    Published by: user9360947 on March 29, 2012 06:09

    What is the version that you perform the deployment? The method not found was added in a later version, so it is probably there is a version mismatch where the Weblogic instance that is running and the version that you configured when running stand-alone. I think you need probalby use a version of Weblogic as 12.1.1 which comes with TopLink which includes EclipseLink 2.3.2 for this to work, or use a different version of EclipseLink which comes with the Weblogic instance that you are using. Tom described here:
    http://dev.Eclipse.org/mhonarc/lists/EclipseLink-users/msg06874.html

    Best regards
    Chris

  • What page template will change when change of page template when running?

    Hi all

    When we create a portal that have not only a model for example my portal has 4 pages, each page use different page template.
    Which pages will be changed in the new template when we use the model of change running page?
    How to frame these page should change?

    Thank you.

    I understand.
    It all depends on how you have selected the model. If you selected explicitly model A, B, C or D for your pages and you change the default template, none of the pages will be updated.

    If your current default template is set to A and you create a page when running, you can choose from all models, but you can also select default Application. If you select this, your page will get you the model that has been set by default in the config tab.
    When you update the default template in the config tab, only the pages that have the model request by default assigned will be updated which means that as soon as you select a template to explicitly, the default template is not serious and he will not change your page.

    Is this clear?

    Just try, put your default template on A and create two pages:
    Page to where you select default APplication as model
    Page B, you select A model as
    Do not change the model by default in the config to B tab and look at page A and B. You will notice that A page will be updated and uses the B model while page B will always use the model A.

  • How to display values of connection/iterator when running?

    Hello:

    I'm trying to debug problems with the links and iterators, with jdev 11.1.2...

    When you look at the EL Expressions for the links, I am presented with many opportunities. I want to display those values to determine what I'm looking for. Currently, I am assigning an EL expression as #{bindings.dept.inputValue} to an af:output text field, but it is a slow, tedious process. Where in the Oracle documentation each link field mentioned?

    Also, is there a faster way to examine the values of different fields in links when running? So I'm looking for something like the browser component except for links and iterators. I can do this with the debugger, or what? If so, how? For example, what is the difference between #{bindings.dept.inputValue} and #{bindings.dept.items}.

    So the question is to know how to create a form or? to examine the values of the bindings/iterators executing?

    Thanks for the help.
    Don

    the el elvauator will get activated only when the debugger see a breakpoint...
    one thing you can do, it's that to set a breakpoint in the pagedef... for the links section or the executable section...
    as mentioned here
    http://blogs.Oracle.com/DavidGiammona/entry/new_features_in_the_adf_debugg

    You can also set the breakpoint in the taskflow... and allow the assessor of el...

  • Digest the lag when running during the generation of the ant script

    I'm tying all libraries referenced by my Flex as RSL project. When I do this through Flex Builder seems to work.  When I try to do it via an Ant build script to the mxmlc task the build succeeds (everything compiles) but when running, I get error #1001 Flex: mismatch with RSL Digest for datavisualization.swc.  Not sure why I make this especially since I specify datavisualization.swf in the rsl url not a swz file. Both methods give the same set of swf, SWC, and swz files in the deployment folder.  I can't understand what is different between the two build processes after comparing the .actionScriptProperties with the ant script.  Can anyone help to shed light on this or help me understand how push wrong with that? Thank you.

    My task as mxmlx:

    < mxmlc
    file = "${Flex.main.file}" "
    output = "${Flex.output.swf}" "
    ActionScript-file-encoding = 'UTF-8 '.
    Keep-generated-actionscript = "false".
    link-TIME-shared-library static = "false".
    local = "en_US."
    MaxMemory = "256 m" >

    < path-element source-path = "${PROJECT_FRAMEWORKS}" / >

    < dir external-library-path = "${PROJECT_FRAMEWORKS} / libs/player" includes = "playerglobal.swc" / >

    "< path-element="${PROJECT_FRAMEWORKS}/libs/framework.swc DURATION-shared-library-path ">

    < url rsl - url = ' framework_$ {FLEX_BUILD} .swf ".
    < url rsl - url = ' framework_$ {FLEX_BUILD} .swz "/ >
    < / DURATION-shared-library-path >

    "< path-element="${PROJECT_FRAMEWORKS}/libs/rpc.swc DURATION-shared-library-path ">
    < url rsl - url = "rpc_$ {FLEX_BUILD} .swf" / >
    < url rsl - url = "rpc_$ {FLEX_BUILD} .swz" / >
    < / DURATION-shared-library-path >

    < runtime-shared-library-path
    Path-Element="${PROJECT_FRAMEWORKS}/libs/Automation.swc" >
    < url rsl - url = "automation.swf" / >
    < / DURATION-shared-library-path >

    < runtime-shared-library-path
    Path-Element="${PROJECT_FRAMEWORKS}/libs/automation_agent.swc" >
    < url rsl - url = "automation_agent.swf" / >
    < / DURATION-shared-library-path >

    < runtime-shared-library-path
    Path-Element="${PROJECT_FRAMEWORKS}/libs/automation_dmv.swc" >
    < url rsl - url = "automation_dmv.swf" / >
    < / DURATION-shared-library-path >

    < runtime-shared-library-path
    Path-Element="${PROJECT_FRAMEWORKS}/libs/automation_flashflexkit.swc" >
    < url rsl - url = "automation_flashflexkit.swf" / >
    < / DURATION-shared-library-path >

    < runtime-shared-library-path
    Path-Element="${PROJECT_FRAMEWORKS}/libs/DataVisualization.swc" >
    < url rsl - url = "datavisualization.swf" / >
    < / DURATION-shared-library-path >

    < runtime-shared-library-path
    Path-Element="${PROJECT_FRAMEWORKS}/libs/Flex.swc" >
    < url rsl - url = "flex.swf" / >
    < / DURATION-shared-library-path >

    < runtime-shared-library-path
    Path-Element="${PROJECT_FRAMEWORKS}/libs/qtp.swc" >
    < url rsl - url = "qtp.swf" / >
    < / DURATION-shared-library-path >

    < runtime-shared-library-path
    Path-Element="${PROJECT_FRAMEWORKS}/libs/Utilities.swc" >
    < url rsl - url = "utilities.swf" / >
    < / DURATION-shared-library-path >

    < compile .library-path dir = "${PROJECT_FRAMEWORKS}" / locale ' append = "true" > "
    < name = "{local}" / >
    < / compile .library-path >

    ...

    < default width = "500" height = "600" / >
    < / mxmlc >

    I didn't write the patch, but I just took a quick glance. I think that the "url" element has been renamed to "rsl - url" and new elements have been added as "failover-url". You can try to match this new syntax, but I don't think that this patch will be agreed due to rename it.

    -Darrell

  • Load a font when running in another domain

    Hi, I've been struggling with trying to figure out how to make it work. I'm pretty new to Flash so it is quite possible that miss me some obvious code.

    What I'm working on a component that loads a SWF file when running via HTTP from a different domain by running the main file. The loaded SWF file has a built-in font that I want to be available in the main SWF file. As long as the font.swf is on the same domain as the main.swf, everything works fine. But as soon as I put the font.swf on a different server (Amazon S3), I get the following error when I call Font.registerFont (myFont) in main.swf:


    ArgumentError: Error #1508: the value specified for the police argument is invalid.
    to flash.text::Font$/registerFont()

    So trying to find a solution, I think that he has to walk in cross domain policies. So I created a crossdomain.xml that resides in the root of my Amazon S3 bucket. The content of the crossdomain.xml is currently:


    <? XML version = "1.0"? >
    <! DOCTYPE cross-domain-policy
    SYSTEM " " http://www.Macromedia.com/XML/DTDs/cross-domain-policy.DTD "> "
    < cross-domain-policy >
    < allow-access-from domain = "" * "/ >"
    < / cross-domain-policy >

    I also tried adding a specific entry for the domain, of that I am serving main.swf. After having done that, I got the same result.

    I might add that I do not get lifted anytime SecurityExceptions. The SWF file is retrieved correctly, and in fact I'm even able to call methods on the SWF recovered, it's just the registerFont who complains. My main.swf has the following:

    public function initApp (): void {}
    Security.loadPolicyFile ("http://mybucket.s3.amazonaws.com/crossdomain.xml" "");
    }

    public function loadFont (): void {}
    var loader: Loader = new Loader();
    var req:URLRequest = new URLRequest();
            req.url = ' http://mybucket.S3.amazonaws.com/some_dir/font.swf;
    Loader.Load (req);
    loader.contentLoaderInfo.addEventListener (Event.COMPLETE, onFontLoaded);
    }


    public function onFontLoaded (event: Event): void {}
    var dom: ApplicationDomain = event.target.applicationDomain;
    var FontAsset: * = dom.getDefinition ('FontAsset') in class;

    trace (FontAsset.getName ());
    Exception occurs when you call this line
    Font.registerFont (FontAsset.getFont ());
    }

    My font.swf file is:

    SerializableAttribute public class FontAsset extends Sprite
    {
    Security.allowDomain ("foo.mydomain.com");

    [Embed (source = "#{source_path}", mimeType = "application/x-font", fontName = "#{font_name}")]
    private static var fonts: Class;
    Font.registerFont (police);

    Public Shared function getFont (): class {}
    return of the fonts;
    }

    Public Shared function getName (): String {}
    return "#{font_name}";
    }
    }

    I tried with and without a constructor and return the non-static fonts variable and then instancing in main.swf, but I always get the same result. I also tried retrieve the remote font.swf when my main.swf running directly in the browser (file:///home/ruy/main.swf), as well as through a web server.

    I found an ad with the same exact behavior, but the wire that they send me to seems a different problem to the problem of the crossdomain (http://www.actionscript.org/forums/showthread.php3?t=182499)

    The only solution I can find so far is to put my main.swf on the same server Amazon S3, but it's as if I would be able to host it separately.

    Any ideas?

    Thank you

    Ruy

    var context: LoaderContext = new LoaderContext (true, new

    ApplicationDomain (ApplicationDomain.currentDomain), SecurityDomain.currentDomain);

    Loader.Load (req, context);

    Alex Harui

    Flex SDK Developer

    Adobe Systems Inc..

    Blog: http://blogs.adobe.com/aharui

Maybe you are looking for