You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by Burhan Aksendir <bu...@gmail.com> on 2014/08/08 22:41:54 UTC

Pagination in Flash Builder

Hi ,

I have prepared an application for Android in Adobe Flash Builder.

 I’ve got a long text I want to place in multiple pages, but I want the app
to generate this pages according to the screen size of the device. Looks
like:​

<http://apache-flex-users.2333346.n4.nabble.com/file/n7588/paginationMobile.jpg> 

I share my project file in addition. Can anybody help me, please? 

*Flash Builder 4.6 Project File:*

https://drive.google.com/file/d/0B94geQNpqygPZE81NmpfenduYzQ/edit?usp=sharing

Regards,



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Pagination-in-Flash-Builder-tp7588.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Pagination in Flash Builder

Posted by Burhan Aksendir <bu...@gmail.com>.
Thank you very much for your extremely helpful and detailed response to my
questions. 
I solved my problem.

How can I create swipe effects of textbox as in the following video?

* http://www.youtube.com/watch?v=lgKX9bevUZ0
<http://www.youtube.com/watch?v=lgKX9bevUZ0>  *

Regards,








--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Pagination-in-Flash-Builder-tp7588p7593.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Pagination in Flash Builder

Posted by jude <fl...@gmail.com>.
You can use the PaginationText component here
<https://github.com/monkeypunch3/flexcapacitor/blob/master/MainLibrary/src/com/flexcapacitor/controls/PaginationText.as>.
It is based on the TLF example made by the TLF team but their example was
broke when the new releases of TLF changed the API.

I added a few features and it has a few bugs but should get you farther
along than you are now. You will have to add swipe left and swipe right
event listeners to the stage and then advance the page or unadvance the
page. I've included an example below.


<s:Group xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:c="com.flexcapacitor.controls.*"

        gestureSwipe="scrollableview1_gestureSwipeHandler(event)"
        creationComplete="group1_creationCompleteHandler(event)"
        >

    <fx:Script>
        <![CDATA[

            import mx.core.ByteArrayAsset;
            import mx.events.FlexEvent;


            [Bindable]
            public var instructions:String;


[Embed(source="help/instructions.txt",mimeType="application/octet-stream")]
            public static const instructionsText:Class;

            protected function
scrollableview1_gestureSwipeHandler(event:TransformGestureEvent):void {
                if (event.offsetX==-1) {
                    textBox.nextPage();
                }
                if (event.offsetX==1) {
                    textBox.prevPage();
                }
            }

            protected function
group1_creationCompleteHandler(event:FlexEvent):void {
                var storyByteArray:ByteArrayAsset = ByteArrayAsset(new
AssetsClass.instructionsText());
                instructions =
storyByteArray.readUTFBytes(storyByteArray.length);
            }

        ]]>
    </fx:Script>


            <c:PaginationText id="textBox"
                              left="25" right="25"
                              width="100%" height="100%"
                              htmlText="{instructions}"
                              styleName="paginationText"
                              selectable="false"
                              replaceLinebreaksWithBreaks="true"
                              />

</s:Group>


On Sat, Aug 9, 2014 at 2:44 AM, Neverbirth <ne...@gmail.com> wrote:

> Forgot one more thing, depending of how you make and piece your text, you
> may
> need to set each row or item's width, to be the same as the list width, so
> you only have one ítem per row, as if it were a page.
>
>
>
> --
> View this message in context:
> http://apache-flex-users.2333346.n4.nabble.com/Pagination-in-Flash-Builder-tp7588p7591.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>

Re: Pagination in Flash Builder

Posted by Neverbirth <ne...@gmail.com>.
Forgot one more thing, depending of how you make and piece your text, you may
need to set each row or item's width, to be the same as the list width, so
you only have one ítem per row, as if it were a page.



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Pagination-in-Flash-Builder-tp7588p7591.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Pagination in Flash Builder

Posted by Neverbirth <ne...@gmail.com>.
Slide views (or whatever is the official name), is something that IMHO should
be improved in Flex (along with some more mobile related features).

Unless you make your own component, in order to achieve what you want first
you should look into piecing the text yourself, and then use a List
component with these properties:

<s:List pageScrollingEnabled="true" verticalScrollPolicy="off"
horizontalScrollPolicy="on">
    <s:layout>
        <s:HorizontalLayout/>
    </s:layout>
</s:List>

I'm not sure, but I think you need scrollSnappingMode="center" as well.



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Pagination-in-Flash-Builder-tp7588p7590.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.