Copy link to clipboard
Copied
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 ..
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.
Copy link to clipboard
Copied
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;
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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;
do you have a solution??
sorry for bothering you with this ,,
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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 ..
Copy link to clipboard
Copied
you can test yourself, http://www.kglad.com/Files/forums/bar_test.fla and http://www.kglad.com/Files/forums/bar_test.apk
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
you're welcome.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now