Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Why does width=stage.fullScreenWidth; function inproperly ?

Community Beginner ,
Sep 07, 2014 Sep 07, 2014

Peace be upon you

I have a timebar in my flash android app (testing sample), that I want to extend horizantally to the full screen width (in all phones and tablets).

I tried many many things, visited all programming websites .. and I made use of this useful article Supporting the multiple screen sizes of multiple devices in Adobe AIR | Adobe Developer Connection

and tested them on many devices but still, something is still wrong!

when I use

1- Object(root).bar.width =stage.fullScreenWidth ;                      // the timebar fits the width but animates LATE

2- Object(root).bar.width =stage.stageWidth;                              // the timebar fits the width but animates LATE

3- Object(root).bar.width =stage.width;                                        // the timebar doesn't fit the width but animates rightaway!

4- Object(root).bar.width =Capabilities.screenResolutionX;        // the timebar fits the width but animates LATE

here the sample:testing sample.fla - Google Drive


can someone tell me why is the latency in the timebar animation !??

I want my timebar to be in it's original speed (fast) and have it to fit the screen width in any size ..

Thanks in advance ..

TOPICS
ActionScript
690
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Sep 09, 2014 Sep 09, 2014

i can't duplicate that issue using your code.  all 4 bars fill the screen width when the app starts and there's no latency.

you can confirm by creating a new fla with 4 bars and that code.  test.

if you fail to see the problem in a new fla, you can conclude there's something (other than your code) causing whatever problem you're seeing.

Translate
Community Expert ,
Sep 07, 2014 Sep 07, 2014

there's probably latency because your code doesn't execute immediately.  ie, it appears to be on a nested timeline.

put this on frame 1 of the main timeline if you're going to add code to timelines,

bar.width=Capabilities.screenResolutionX;

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 08, 2014 Sep 08, 2014

thank you for replying kglad,

but actually, the sample itself has no other lines of code ..

when I used 3- Object(root).bar.width =stage.width;           // the timebar doesn't fit the width but animates rightaway!

No latency happened .. but why is there latency with the other three ways I tried?? (as I mentioned in the question)

*I tried each one alone

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 08, 2014 Sep 08, 2014

you probably have latency because the code is nested.

to confirm, remove your Object(root) path.  if there's an error, your code is nested.

and stage.width is probably not what you want to use.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 09, 2014 Sep 09, 2014

I tried it without Object(root) and it still didn't work .. though my code isn't nested at all .. no errors to .. it's just a latency and no fit for width

here's a screenshot from my phone , you see the second bar starts rightaway!

but the other ones start late .. but they all finish in the same time!!
why??? they also won't fit the phone's screen width 😕

i coded them in this order

1- bar1.width =stage.fullScreenWidth ;            

2- bar2.width =stage.stageWidth;                    

3- bar3.width =stage.width;                             

4- bar4.width =Capabilities.screenResolutionX;       

Screenshot_2014-09-09-19-54-45.png

do you have a solution??
sorry for bothering you with this ,,

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 09, 2014 Sep 09, 2014

i can't duplicate that issue using your code.  all 4 bars fill the screen width when the app starts and there's no latency.

you can confirm by creating a new fla with 4 bars and that code.  test.

if you fail to see the problem in a new fla, you can conclude there's something (other than your code) causing whatever problem you're seeing.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 11, 2014 Sep 11, 2014

really it worked with you??!
this is weird .. I just created a new fla with a new timeBar (same as that one) with the same as file .. same problemr

can I ask for a screenshot, please? 'coz I'm shocked ..

I've been stuck with this since a long time ..

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 11, 2014 Sep 11, 2014
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 12, 2014 Sep 12, 2014

ooh, actually my timebar is different - it animates and gets shorter by time (during 10 seconds)
if you saw my fla you would see delay happening in the animation.

I checked your fla, when I maximize the swf screen, the bars don't fill the screen width; just like mine ...

anyways, I gave up on this version of timebars .. I changed it to a clock in my game..

thank you a lot for your help

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 12, 2014 Sep 12, 2014
LATEST

you're welcome.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines