Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Contributor
wangzw
Posts: 13
Registered: ‎03-30-2013
My Device: BB10 Dev Alpha A
Accepted Solution

how to let *.amd file work with static asset selector

well, i'm trying to use different background pattern for different visualstyle. but i don't know how to get it work.

 

my background paint is :

 

ImagePaintDefinition {
    id: backgroundPaint
    imageSource: "asset:///Background.amd"
    repeatPattern: RepeatPattern.XY
}

 Background.amd is :

#RimCascadesAssetMetaData version=1.0
source: "Background.png"
repeatable: true

 if i use folder structure like this:

-- VisualStyle.bright

  |-- Background.png

-- VisualStyle.dark

  |-- Background.png

-- Background.amd

 

the error message is:

Image not found:  "/apps/*****/native/assets//Background.png"

 

or  if i use folder structure like this:

-- VisualStyle.bright

  |-- Background.png

  |-- Background.amd

-- VisualStyle.dark

  |-- Background.png

  |-- Background.amd

 

the error message is:

"AssetMetaDataParser: File not found: /apps/*****/native/assets//Background.amd"

 

i'm so confused. could anyone help me with this problem? thank you very much!

Please use plain text.
Developer
jalue
Posts: 196
Registered: ‎03-04-2013
My Device: BB Z10

Re: how to let *.amd file work with static asset selector

Hey there...

 

Use the 2nd structure where the .amd and .png files are in the same folder..  and make the change for the imageSource in the definition...

 

 

ImagePaintDefinition {
    id: backgroundPaint
    imageSource: "asset:///VisualStyle.bright/Background.amd"
    repeatPattern: RepeatPattern.XY
}

 

Please use plain text.
Contributor
wangzw
Posts: 13
Registered: ‎03-30-2013
My Device: BB10 Dev Alpha A

Re: how to let *.amd file work with static asset selector

Thank you for your advice!

 

It looks like caused by my Dev Alpha A which is still version 10.0.0 rather than the new version 10.0.1. Because the second structure works well on the simulator Q10 which has version 10.0.1.

 

Now I'm trying to use the following structure. It has passed the test on my Dev Alpha A, and I am about to test it on the simulator Q10.

 

|-- Background.png
|-- Background.amd

-- VisualStyle.bright
  |-- Background.png
  |-- Background.amd
-- VisualStyle.dark
  |-- Background.png
  |-- Background.amd

Please use plain text.
Contributor
wangzw
Posts: 13
Registered: ‎03-30-2013
My Device: BB10 Dev Alpha A

Re: how to let *.amd file work with static asset selector

This structure works well.
Please use plain text.