Giving next / previous a brain?

Hello;
I wrote a next previous nav for editing records on my web
site. I also on one of the same pages, have it filtering records by
the category. If a user wants to see all the records they can, or
if they select from a list on another page, they get the "products"
associated to that category.
Before I added the next / previous, numbered page nav, it
worked fine, sorting products to only the ones selected by the cat,
and showing all if selected. Once I added the nav, it would show
the catagoried products but once you click, next or page 2 you
would get them all back. How do I make the next / previous remember
what to do?
Here is my code:
<cfquery name="getProjects" datasource="#sitedatasource#"
username="#siteUserID#" password="#sitePassword#">
SELECT Projects.Name AS PName, Projects.ProjectID AS ID,
Categories.Name AS CName, Categories.CategoryID
FROM Projects INNER JOIN Categories ON projects.CategoryID =
Categories.CategoryID
<cfif StructKeyExists(url, 'ID')>
WHERE Categories.CategoryID = <cfqueryparam
CFSQLType="CF_SQL_INTEGER" value="#URL.ID#" />
ORDER BY Projects.Name
<cfelse>
ORDER BY Categories.Name
</cfif>
</cfquery>
<cfset rowsPerPage = 6>
<cfparam name="URL.startRow" default="1"
type="numeric">
<cfset totalRows = getProjects.recordCount>
<cfset endRow = min(URL.startRow + rowsPerPage - 1,
totalRows)>
<cfset startRowNext = endRow + 1>
<cfset startRowBack = URL.startRow - rowsPerPage>
<head>
</head>
<body>
<cfloop query="getProjects" startRow="#URL.startRow#"
endrow="#endRow#">
<cfoutput>
My output records go here
</cfoutput>
</cfloop>
<cfoutput>
<cfset thisPage = 1>
<cfloop from="1" to="#totalRows#" step="#rowsPerPage#"
index="pageRow">
<cfset isCurrentPage = (pageRow gte URL.startRow) and
(pageRow lte endRow)>
<cfif isCurrentPage>
<cfoutput>
#thisPage#
</cfoutput><cfelse><cfoutput>
<a href="#CGI.script_name#?startRow=#pageRow#"
class="navA">#thisPage#</a></cfoutput></cfif>
<cfset thisPage = thisPage + 1>
</cfloop>
<cfif startRowBack GT 0><a
href="#CGI.script_name#?startRow=#startRowBack#"
class="navA">&lt; Previous Records</a></cfif>
<cfif startRowNext lte totalRows><a
href="#CGI.script_name#?startRow=#startRowNext#"
class="navA">Next Records &gt; </a></cfif>
</cfoutput>
</body>
My next / prev buttons work nice, they just don't have the
memory of what was filtered or not filtered. Can someone help me
write this out so it has a brain?
Thank you.
Phoenix

You can either store the value of URL.ID in a session
variable to carry it over next/previous changes and update it when
ever the ID is changed or you can add the URL.ID back into the
next/previous link definitions as in:
<cfif startRowBack GT 0><a href="#CGI.script_name#?
id=#URL.ID#&startRow=#startRowBack#"
class="navA">&lt; Previous Records</a></cfif>
<cfif startRowNext lte totalRows><a
href="#CGI.script_name#?
id=#URL.ID#&startRow=#startRowNext#"
class="navA">Next Records &gt; </a></cfif>
HTH
CR

Similar Messages

  • How can i create an album with chose category list and next/previous button

    hello guys im working on a project for my uni i finished the whole website but one thing is missing
    i need to create a photo album with next and previous button, with choosing a category and inside each category i have like 5 pictures and i can change with the next/previous buttons to see another picture of the  same category.
    Please see the picture below to see what i mean.
    some told me it needs flash but i dont know how to work on it :S so plz if anyone can help me
    thank you

    Dear Mr. Murphy,
    thank you for your help.
    Actually i have tried to search for a tutorial and i found that one that was very helpful and gave me the half solution. the part i found and it worked with me is the part of the next and previous buttons and moving from an image to another.
    SO the part i still need is the list so when i click on a category i get the pictures of the chosen category, I had the idea of create a flash for each category alone and maybe i will be able to add them all together.
    But i guess it's too much work and there must be a way where i can make it all in one flash file.
    If you have any idea let me know please, thank you again for your help and i'm trying to search for the AS3 image gallery as you told me.
    Regards

  • How to search this forum by tags, answered questions, and quickly navigate to next/previous posts

    New user to these forums. I've read all the Search documentation.
    1. How do I search this forum by tags?
    2. Is there a way to view just the posts that were answered or where the original poster found some help?
    3. Is there a way to quickly move to next/previous posts without having to backtrack to the list of posts and then manually click the next/previous post?
    Thanks!

    New user to these forums. I've read all the Search documentation.
    1. How do I search this forum by tags?
    2. Is there a way to view just the posts that were answered or where the original poster found some help?
    3. Is there a way to quickly move to next/previous posts without having to backtrack to the list of posts and then manually click the next/previous post?
    Thanks!

  • CF Set form.variable for query and Next/Previous pages error

    I have a CF form with a select that posts to a CF "action" page.
    On the action page I: CFSET ItemNumber=#form.ItemNumber#
    I CFOUTPUT the 'ItemNumber' into the CFQUERY (which is an Inner Join dependant on the '#ItemNumber#')...
    All of the above works just fine and displays the database fields in color alternating rows, per the rest of the code.
    Here's the problem:
    I'm displaying 40 rows on a page per "Next and Previous" code. (CFPARAM name="start" default="1" and CFPARAM name="disp" default="40" along with the rest of the NextN code in the header and body). This does display 40 rows on the page and puts a link at the bottom of the page "Next 40 Rows", etc.
    Note: I'm only querying the database once and using the query (query name="data") to populate the table rows And the NextN code (CFOUTPUT name="data") And (CFIF start + disp GREATER THAN data.RecordCount, etc)...
    The problem happens when you click the "Next 40 Rows" link to display the 2nd page of rows. Since (I'm assuming) this NextN code is 're-reading' the same page from top to bottom, an error is thrown when the code tries to read the CFSET ItemNumber=#form.ItemNumber# at the top of the page.
    With the #form.ItemNumber# on this action page Originally coming from the previous posting of the form to this action page, when the "Next 40 Rows" link is clicked and the NextN code re-reads this action page - the CFSET ItemNumber (#form.ItemNumber) is not getting populated and throws the error...
    I hope I've not made this sound confusing.
    I can get the NextN code to work when I'm just querying the database without "flying in" a form variable. But when I CFSET a variable (#form.ItemNumber#) that is inserted into the query, the second page of the NextN throws an error and doesn't display.
    I would include the page code here but it would be fairly lengthy and, as well, the NextN code is a 'standard' CF code -- I've narrowed the problem down to the above "Element is undefined" (when the page tries to reload from the "Next 40 Rows" link) and am hoping there's a simple fix or another way to display the records in Next and Previous pages.
    Thanks to anyone in advance for shedding light on this.
    - e

    Thank you for the reply, Owain.
    Yes - The Next/Previous at the bottom of the page are hyperlinks.
    <a href="ThisPage.cfm?start=#Evaluate("start + disp")#">
    The following is at the top of the page (and is the variable from the form that I CFOUTPUT in the query):
    <cfparam name="ItemNumberDropdown01" default="">
    <cfset ItemNumber = #form.ItemNumberDropdown01#>
    The error report showed that the "Next Page" hyperlink was reading an undefined variable... although when the "action page" first opens from the form posting to it, it populates the CFSET just fine (per the cfparam and cfset above)... As you mention, the hyperlink clearing the form scope is what causes the error in trying to display the next set of records...
    The form page and the 'action page' are both secure pages with an application page setting the session, etc. Am I at risk in using an URL scope?
    Where would this URL scope be put? (The href is shown above - would the URL scope go in this? - How would this be written?)
    The CFPARAM and CFSET would still exist at the top of the 'action page' and still throw an error wouldn't it or would this be replaced with something else to read the form.variable for this 'first' action page to be displayed?
    Thanks again for the 'education' on this...
    - ed

  • Page numbers navigation bar instead of the standard first-next-previous-last

    I want to add page numbers to my navigationbar instead of the standard "first next previous last".
    For example I have a repeat region with a navigation bar (standard) I have 7 records per page and I would like it to say at the bottom:
    1 2 3 4 5 ect. Is there any way I can code this up with php or with dreamweaver or is there an other way to do this.
    Any help welcome

    You can do it in DW
    Add the below code
    <div class="pages">
    <ul>
    <li class="prev"><a href="#">&laquo; Previous</a></li>
    <li><a href="#">1</a></li>
    <li><a href="#">2</a></li>
    <li class="ellipsis"><strong>&hellip;</strong></li>
    <li><a href="#">6</a></li>
    <li class="current"><strong>7</strong></li>
    <li><a href="#">8</a></li>
            <li class="ellipsis"><strong>&hellip;</strong></li>
    <li><a href="#">14</a></li>
    <li><a href="#">15</a></li>
    <li class="next"><a href="#">Next &raquo;</a></li>
    </ul>
    </div>
    style it as
    .pages{display:block; width:100%; text-align:center; clear:both; font-family:Verdana, Geneva, sans-serif;}
    .pages ul{margin:0; padding:0; list-style:none;}
    .pages li{display:inline;}
    .pages strong{font-weight:normal;}
    .pages .next{margin:0;}
    .pages a,.pages .current strong, .pages .ellipsis strong{display:inline-block; padding:2px 6px; margin:0 2px 0 0;}
    .pages a{border:1px solid #DFDFDF;}

  • Next / Previous button throwing an error. Please help

    I wrote this next previous button code and it is throwing an
    error. I don't understand why or what I am missing.
    I want it to show 4 records for a page. Here is my code and
    the error.
    Code:
    <cfset CurrentPage=GetFileFromPath(GetTemplatePath())>
    <cfquery name="feat" datasource="#sitedatasource#"
    username="#siteUserID#" password="#sitePassword#" maxRows=4>
    SELECT feature.title AS ViewField1, feature.MYFile AS
    ViewField2, feature.ID AS ID
    FROM feature
    </cfquery>
    <cflock timeout="2" scope="application"
    type="READONLY">
    <cfset application.feat=feat>
    </cflock>
    <cfset MaxRows_feat=4>
    <cfset
    StartRow_feat=Min((PageNum_feat-1)*MaxRows_feat+1,Max(feat.RecordCount,1))>
    <cfset
    EndRow_feat=Min(StartRow_feat+MaxRows_feat-1,feat.RecordCount)>
    <cfset
    TotalPages_feat=Ceiling(feat.RecordCount/MaxRows_feat)>
    <cfset QueryString_feat=Iif(CGI.QUERY_STRING NEQ
    "",DE("&"&CGI.QUERY_STRING),DE(""))>
    <cfset
    tempPos=ListContainsNoCase(QueryString_feat,"PageNum_feat=","&")>
    <cfif tempPos NEQ 0>
    <cfset
    QueryString_feat=ListDeleteAt(QueryString_feat,tempPos,"&")>
    </cfif>
    <cflock timeout="2" scope="application"
    type="READONLY"><cfoutput query="feat"
    maxrows="4">#ViewField1#</cfoutput></cflock>
    <cfif PageNum_feat GT 1>
    <a
    href="#CurrentPage#?PageNum_feat=#Max(DecrementValue(PageNum_feat),1)##QueryString_feat#"
    onmouseout="MM_swapImgRestore()"
    onmouseover="MM_swapImage('Previous','','../img/previous-over.gif',1)"><img
    src="../img/previous.gif" alt="Previous Records" name="Previous"
    width="96" height="27" border="0" id="Previous" /></a>
    <cfif PageNum_feat LT TotalPages_feat>
    <a
    href="#CurrentPage#?PageNum_feat=#Min(IncrementValue(PageNum_feat),TotalPages_feat)##Quer yString_feat#"
    onmouseout="MM_swapImgRestore()"
    onmouseover="MM_swapImage('next','','../img/next-over.gif',1)"><img
    src="../img/next.gif" alt="Next Record" name="next" width="96"
    height="27" border="0" id="next" /></a>
    The Error:
    Variable PAGENUM_FEAT is undefined.
    The error occurred in
    C:\Websites\x9vdzd\feature\featured.cfm: line 8
    6 : </cfquery>
    7 : <cfset MaxRows_feat=4>
    8 : <cfset
    StartRow_feat=Min((PageNum_feat-1)*MaxRows_feat+1,Max(feat.RecordCount,1))>
    9 : <cfset
    EndRow_feat=Min(StartRow_feat+MaxRows_feat-1,feat.RecordCount)>
    10 : <cfset
    TotalPages_feat=Ceiling(feat.RecordCount/MaxRows_feat)>
    I thought I had it defined! What am I missing?
    Thanks
    Phoenix

    that is strange... it should work fine - it does in my tests.
    here is somewhat updated & modified code to try. i have
    included
    comments to try and explain what is being done.
    basic logic is as follows:
    -form is submitted
    -check if file has been selected
    -try uploading new file
    -if new file upload succeeds, delete old file if it exists
    (as part of
    updating existing record, as new records obviously would not
    have any
    old image)
    -update/insert record data as necessary
    here's the code:
    <cfif isdefined("form.feat_OK")><!--- form submitted
    --->
    <!--- set file uploading vars --->
    <cfparam name="fileuploaded" type="boolean"
    default="false">
    <cfparam name="uploadedfile" default="">
    <cfset pathToFile = "c:\websites\x9vdzd\img\feature\">
    <!--- --->
    <cfif len(trim(form.MYFile))><!--- if a file has
    been selected --->
    <!--- try uploading new file --->
    <cftry>
    <cffile Action="upload" filefield="MYFile"
    accept="image/gif,
    image/jpg, image/jpeg, image/pjpeg"
    destination="#pathToFile" nameconflict="MAKEUNIQUE">
    <cfset fileuploaded = true>
    <cfset uploadedfile = cffile.serverfile>
    <cfcatch type="any">
    <!--- if upload did not suceed, reset file uploading vars
    --->
    <cfset fileuploaded = false>
    <cfset uploadedfile = "">
    <!--- this can be further enhanced by setting some var to
    hold error
    message and return it to user --->
    </cfcatch>
    </cftry>
    </cfif>
    <cfif form.id gt 0><!--- we are updating an
    existing record --->
    <!--- if new file upload was successful and the feature
    has an image
    associated with it - delete old image --->
    <cfif fileuploaded is true AND
    len(trim(form.oldimage))>
    <cfif FileExists(pathToFile & form.oldimage)>
    <cffile action="delete" file="#pathToFile &
    form.oldimage#">
    </cfif>
    </cfif>
    <cfquery datasource="#sitedatasource#"
    username="#siteUserID#"
    password="#sitePassword#">
    UPDATE feature
    SET
    feature.title=<cfqueryparam cfsqltype="cf_sql_varchar"
    value="#form.title#">,
    feature.Body=<cfqueryparam cfsqltype="cf_sql_longvarchar"
    value="#form.PDSeditor#">,
    feature.MYFile=<cfqueryparam cfsqltype="cf_sql_varchar"
    value="#uploadedfile#" null="#NOT fileuploaded#">
    WHERE ID = <cfqueryparam value="#form.ID#"
    cfsqlType="CF_SQL_INTEGER">
    </cfquery>
    <cfelse><!--- we are inserting a new record --->
    <cfquery datasource="#sitedatasource#"
    username="#siteUserID#"
    password="#sitePassword#">
    INSERT INTO feature
    (title, body, MYFile)
    VALUES
    (<cfqueryparam cfsqltype="cf_sql_varchar"
    value="#form.title#">,
    <cfqueryparam cfsqltype="cf_sql_longvarchar"
    value="#form.PDSeditor#">,
    <cfqueryparam cfsqltype="cf_sql_varchar"
    value="#uploadedfile#"
    null="#NOT fileuploaded#">)
    </cfquery>
    </cfif>
    <!--- relocate user to previous page after insert/update
    --->
    <cflocation url="feature-manager.cfm">
    </cfif>
    hth
    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com

  • Next previous button in gallery

    Hi guys, been a while, hope everyone is well.  I am having a problem implementing a next/previous button on an image once it has been enlarged in my gallery.  I have done it in pure as3 but all tutorials seem to use the timeline.  I will post my code underneath so you can see what I am up too.  The next/previous button should I think be added to the modelClicked function.
    From what I understand, I will get a next/previous button and turn them into a button object.  I will then delete them from my stage and instantiate them within the class below.  I would then add them to the modelClicked function with events tied to them.  What should I then do in these events to make it fit in with the code below?
    Any advise appreciated,
    Cheers
    Nick
    package classes.models
        import flash.display.Bitmap;
        import flash.display.Loader;
        import flash.display.MovieClip;
        import flash.display.Sprite;
        import flash.geom.Rectangle;
        import flash.events.MouseEvent;
        import flash.events.Event;
        import flash.net.URLRequest;
        import eu.flashlabs.ui.BasicButton;
        import classes.ui.StateClip;
        import classes.ui.Placeholder;
        import classes.utils.URLUtil;
        import classes.vo.ModelsStates;
        import fl.containers.ScrollPane;
        import fl.controls.ProgressBar;
        import com.greensock.TweenLite;
        public class IndividualModel extends StateClip
            // CONSTANTS
            private static const PADDING_TOP:Number= 28;
            private static const PADDING_LEFT:Number= 50;
            private static const COLS:int= 4;
            private static const ROWS:int= 8;
            private static const GAP_HORIZONTAL:Number= 5;
            private static const GAP_VERTICAL:Number= 5;
            // MEMBER VARIABLES
            private var _data:XML;
            public function get data():XML
                return _data;
            public function set data(value:XML):void
                setData(value);
            private var items:Array;
            private var backBtn:BasicButton;
            private var itemsHolder:MovieClip;
            private var loadIndex:int;
            private var sp:ScrollPane;
            private var clonedBitmap:Bitmap;
            private var originalBitmap:Bitmap;
            private var rect:Rectangle;
            private var screen:Sprite = new Sprite();
            public function IndividualModel()
                super();
                items = [];
                addEventListener(Event.ADDED_TO_STAGE, addedToStageHandler);
            private function addedToStageHandler(event:Event):void
                initChildren();
            private function initChildren():void
                itemsHolder = new MovieClip();
                addChild(itemsHolder);
                sp = getChildByName("mc_pane") as ScrollPane;
                backBtn = getChildByName("btn_back") as BasicButton;
                backBtn.addEventListener(MouseEvent.CLICK, backBtn_clickHandler);
                screen.graphics.beginFill(0x111111, .75);
                screen.graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight);
                screen.graphics.endFill();
            public function destroy():void
                clearItems();
            // PUBLIC INTERFACE
            // LAYOUT
            private function clearItems():void
                while (items.length > 0)
                    var item:ModelsItem = items.pop() as ModelsItem;
                    itemsHolder.removeChild(item);
                    item.destroy();
            private function populateItems():void
                for (var i:int = 0; i < Math.min(COLS * ROWS, data.picture.length()); i++)
                    var item:ModelsItem = new ModelsItem();
                    item.data = data.picture[i];
                    item.x = PADDING_LEFT + (i % COLS) * (ModelsItem.ITEM_WIDTH + GAP_HORIZONTAL);
                    item.y = PADDING_TOP + Math.floor(i / COLS) * (ModelsItem.ITEM_HEIGHT + GAP_VERTICAL);
                    /*item.addEventListener(MouseEvent.CLICK, modelClicked);*/
                    itemsHolder.addChild(item);
                    /*item.mouseEnabled = false;*/
                    sp.source = itemsHolder;
                    items.push(item);
                sp.verticalScrollPolicy = "on";
                sp.horizontalScrollPolicy = "off";
                sp.update();
            // PICTURE LOADING
            private function loadNextPicture():void
                if (loadIndex < items.length)
                    var loader:Loader = new Loader();
                    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, loadNextPicture_completeHandler);
                    var item:ModelsItem = items[loadIndex] as ModelsItem;
                    loader.load(new URLRequest(URLUtil.getURL([email protected]())));
                    /*item.mouseEnabled = true;*/
            private function loadNextPicture_completeHandler(event:Event):void
                event.target.removeEventListener(Event.COMPLETE, loadNextPicture_completeHandler);
                ModelsItem(items[loadIndex]).bitmap = event.target.content as Bitmap;
                ModelsItem(items[loadIndex]).addEventListener(MouseEvent.CLICK, modelClicked);
                loadIndex++;
                loadNextPicture();
            // EVENT HANDLERS
            private function backBtn_clickHandler(event:MouseEvent):void
                state = ModelsStates.HIDDEN;
            private function modelClicked(e:MouseEvent):void
                stage.addChild(screen);
                var item:ModelsItem = e.currentTarget as ModelsItem;
                originalBitmap = item.bitmap;
                clonedBitmap = new Bitmap(originalBitmap.bitmapData.clone());
                stage.addChild(clonedBitmap);
                rect = originalBitmap.getBounds(stage);
                clonedBitmap.x = rect.x;
                clonedBitmap.y = rect.y;
                clonedBitmap.width = rect.width;
                clonedBitmap.height = rect.height;
                clonedBitmap.smoothing = true;
                TweenLite.to(clonedBitmap, 1, { x: (stage.stageWidth - originalBitmap.width) / 4, y: (stage.stageHeight - originalBitmap.height) / 6, onComplete:zoomInFinished, scaleX: 1, scaleY: 1 });
            private function zoomInFinished():void
                trace("Zoom In Finished");
                stage.addEventListener(MouseEvent.CLICK, mouseClicked);
            private function mouseClicked(e:MouseEvent):void
                TweenLite.to(clonedBitmap, 1, { x: rect.x, y: rect.y, onComplete:zoomOutFinished, width: rect.width, height: rect.height});
                stage.removeEventListener(MouseEvent.CLICK, mouseClicked);
            private function zoomOutFinished():void
                trace("Mouse Clicked");
                stage.removeChild(screen);
                stage.removeChild(clonedBitmap);
            // GETTERS & SETTERS
            private function setData(value:XML):void
                _data = value;
                clearItems();
                populateItems();
                loadIndex = 0;
                loadNextPicture();
                state = ModelsStates.SHOWN;
            // UTILS
            override protected function animateInComplete():void
                super.animateInComplete();
                switch (state)
                    case ModelsStates.SHOWN :
                        break;
                    case ModelsStates.HIDDEN :
                        break;

    I don't actually know how you're loading your data.  It's also very difficult to figure out what's happening in your code, since you're extending Classes you don't show. What I can tell you is that you need to store the data about iterating each collection at the level where it's needed. You may want to look at the composite pattern http://www.as3dp.com/2007/05/composite-pattern-book-part-1/ .
    In my opinion, the biggest problem you have is poor separation of concerns--you call things Models that are clearly Views, and because you are storing relevant data in Views rather than simply using your Views to represent data, you're making the task of representing and iterating through your data much harder than it needs to be.
    The ideal structure would be a data structure that has data for each thumbnail in some sort of collection, like an Array or Vector. This data structure would only be responsible for storing the data and maintaining a pointer to the currently selected thumbnail.  When the pointer changes, the data object dispatches a change event, so Views that care about this pointer can update. Each piece of data could then have a member variable that is one of these collections that manages the correct pointer.  That's where the composite pattern comes in.
    Now, the task of building your Views becomes much easier. You have one View that gets a collection and shows all the thumbnails and one View that gets a specific thumbnail, mix and match as needed. The Views, again watch the change event and do whatever they need to do when the pointer changes.
    At this point, who sets the pointer ceases to matter. It can be inside one of your Views or outside any of your Views--when the pointer changes, the View that is watching that particular collection will update, and if the result of that update is that a nested View then watches a different collection, that's ok--it still follows the same principles.

  • Creating next/previous buttons problem

    I am creating next & previous buttons on my main scene. I have created a scrolling photo gallery as well as a random button to randomly select images. I have a photos layer that has 15 images tagged in the AS "img1" "img2"....hopefully this all makes sense so far.
    What script can I use to easily create a next_btn. This is what I currently have
    next_btn.onRelease = function() {
        photos.gotoAndStop("img"+1);
        photos.fader.gotoAndPlay(2);
    "img"+1 goes to the "img1" however I would like it to go to the next img instead of always go to img1. I've tried _currentframe+10 (images are 10 frames apart) and some others but cannot seem to get it to work.
    I would like this to work along with the random button so that when a random image is clicked, the person can click the next button and get to the next image.
    Current script in...
    random_btn.onRelease = function(){
        var picNum:Number
        picNum = Math.ceil(Math.random()*15);
        photos.gotoAndStop("img"+picNum);
        photos.fader.gotoAndPlay(2);
    next_btn.onRelease = function() {
        photos.gotoAndStop("img"+1);
        photos.fader.gotoAndPlay(2);
    if you need any clarification let me know! thanks!

    i'll try to explain this simplier.
    scene 1 (layers)
    inside layers
    AS
    next back btn
    random btn
    photos
    displays images when clicked on from photo gallery
    scrolling photo gallery
    photo gallery + buttons for gallery
    i'm looking to create a simple < > prev and next image buttons.
    My current script from above (original post) hasn't worked out.
    random_btn.onRelease = function(){
        var picNum:Number
        picNum = Math.ceil(Math.random()*15);
        photos.gotoAndStop("img"+picNum);
        photos.fader.gotoAndPlay(2);
    next_btn.onRelease = function() {
        photos.gotoAndStop(picNum+1);
        photos.fader.gotoAndPlay(2);
    I'll take out the random_btn if need be to create just a regular next button and previous button. (i'll worry about tracking the scrolling image gallery later...one issue at a time)
    Thanks again.

  • Xml gallery with thumbnails & next/previous buttons.

    hallo all the wise people,
    sorry to bother you, but i'm kind of desperate, and nobody around to ask, so....
    i've spend now three full days editing an xml gallery... to my needs, and always goes messy, so maybe it's time give up and make my own from the scratch, or looking from a one closer to my needs =/ (helpless).
    could anyone help - maybe any of you by some chance knows a link as close as possible to tutorial/source as3 fla to sthg as close as possible to this:
    a) xml gallery
    b) thumbnails
    c) when thumbnail clicked a big picture shows
    d) next/previous buttons possible
    otherwise, i can also post the code of my gallery where i absolutely can't add next/previous buttons without making a big mess =/
    i will be totally youbie doubie grateful for any help... any, if you only know any good link, 'll try to fugure out a tutorial or edit the source myself....
    thanks in advance

    heyyyo wise one,
    at least this is really  nice of you to ask -  this gallery really makes me by now feel twice as blond as i am 8-0. but this is kinda really nested.
    the xml structure goes like this (this is easy and more or, less standard)(Caption is neglectable, probabaly i will not even display it, unless i have some extra time):
    <MenuItem>
             <picnum>01</picnum>
             <thumb>thumbs/Image00001.jpg</thumb>  
             <picture>Image00001.jpg</picture>
       <Caption>Fist Title</Caption> 
    </MenuItem>
    uaaha, then the as goes. there is the URLloader, but also two different loaders inside (one for the thumbnails, one for the big picture). and this is all inside a for each loop -eh... i was always trying to change the pictLdr behavior - the loader, that loads the big picture.
    anyway the URL loader, and the main function, which is attached to it go like this:
    var myXML:XML = new XML();
    var XML_URL:String = "gallery_config.xml";
    var myXMLURL:URLRequest = new URLRequest(XML_URL);
    var myLoader:URLLoader = new URLLoader(myXMLURL);
    myLoader.addEventListener("complete", xmlLoaded);
    // Create the xmlLoaded function
    function xmlLoaded(event:Event):void
    // Place the xml data into the myXML object
        myXML = XML(myLoader.data);
        // Initialize and give var name to the new external XMLDocument
    var xmlDoc:XMLDocument = new XMLDocument();
    // Ignore spacing around nodes
        xmlDoc.ignoreWhite = true;
    // Define a new name for the loaded XML that is the data in myLoader
        var menuXML:XML = XML(myLoader.data);
    // Parse the XML data into a readable format
        xmlDoc.parseXML(menuXML.toXMLString());
        // Access the value of the "galleryFolder" node in our external XML file
    for each (var galleryFolder:XML in myXML..galleryFolder)
       // Access the value of the "pagenum" node in our external XML file
               var galleryDir:String = galleryFolder.toString();
    //trace (galleryDir);
    //trace (galleryFolder);//output taki sam jak powyżej
    // inicjuję variable flag, która bedzie trzsymac nazwę klikniętego thumbnail
    var flag2:String = null;
    // Set the index number of our loop, increments automatically
    var i:Number = 0;
    // Run the "for each" loop to iterate through all of the menu items listed in the external XML file
    for each (var MenuItem:XML in myXML..MenuItem)
    // Access the value of the "picnum" node in our external XML file
        var picnum:String = MenuItem.picnum.toString();
    // Access the value of the "pagetext" node in our external XML file
        var Caption:String = MenuItem.Caption.toString();
    // Access the value of the "thumb" node in our external XML file
        var thumb:String = MenuItem.thumb.toString();
    // Access the value of the "pagepicture" node in our external XML file
        var picture:String = MenuItem.picture.toString();
    // Just some trace I used for testing, tracing helps debug and fix errors
    //trace(picnum);
    var thumbLdr:Loader = new Loader();
        var thumbURLReq:URLRequest = new URLRequest(galleryDir + thumb);
        thumbLdr.load(thumbURLReq);
    // Create MovieClip holder for each thumb
    var thumb_mc = new MovieClip();
    thumb_mc.addChild(thumbLdr);
    addChildAt(thumb_mc, 1);
      // Create the rectangle used for the clickable button we will place over each thumb
      var rect:Shape = new Shape;
      rect.graphics.beginFill(0xFFFFFF);
      rect.graphics.lineStyle(1, 0x999999);
      rect.graphics.drawRect(0, 0, 80, 80);      
      // Create MovieClip holder for each button, and put that rectangle in it,
      // make button mode true and set it to invisible
      var clip_mc = new MovieClip();
      clip_mc.addChild(rect);
      addChild(clip_mc);
      clip_mc.buttonMode = true;
      clip_mc.alpha = .0;
         // The following four conditionals create the images where the images will live on stage
      // by adjusting math through each row we make sure they are laid out good and not stacked
      // all on top of one another, or spread out in one long row, we need 4 rows, so the math follows
      if (picnum < "05")
           line1xpos = line1xpos + distance; // These lines place row 1 on stage
        clip_mc.x = line1xpos;
        clip_mc.y = yPlacement;
        thumb_mc.x = line1xpos;
        thumb_mc.y = yPlacement;
       else  if (picnum > "04" && picnum < "11")
        line2xpos = line2xpos + distance; // These lines place row 2 on stage  
        clip_mc.x = line2xpos;
        clip_mc.y = 86;
        thumb_mc.x = line2xpos;
        thumb_mc.y = 86;
       else  if (picnum > "10" && picnum < "14")
        line3xpos = line3xpos + distance; // These lines place row 3 on stage
        clip_mc.x = line3xpos;
        clip_mc.y = 172;
        thumb_mc.x = line3xpos;
        thumb_mc.y = 172;
       else  if (picnum > "13" && picnum < "21")
       line4xpos = line4xpos + distance; // These lines place row 4 on stage
       clip_mc.x = line4xpos;
       clip_mc.y = 258;
       thumb_mc.x = line4xpos;
       thumb_mc.y = 258;
       // And now we create the pic loader for the larger images, and load it into "pictLdr"
       var pictLdr:Loader = new Loader();
       var pictURL:String = picture;
          var pictURLReq:URLRequest = new URLRequest(galleryDir + picture);
       //var pictURLReq:URLRequest = new URLRequest("gallery/Image00004.jpg");sprawia,ze zawsze wyswitla sie jeden obrazek
          pictLdr.load(pictURLReq);
       // Access the pic value and ready it for setting up the Click listener, and function
          clip_mc.clickToPic = pictLdr;
       // Access the text value and ready it for setting up the Click listener, and function
       clip_mc.clickToText = Caption;
       //var instName:String = flag();
       // Add the mouse event listener to the moviClip button for clicking
          clip_mc.addEventListener (MouseEvent.CLICK, clipClick);
          // Set the function for what happens when that button gets clicked
       function clipClick(e:Event):void
         // Populate the parent clip named frameSlide with all of the necessary data
         MovieClip(parent).frameSlide.gotoAndPlay("show"); // Makes it appear(slide down)
         MovieClip(parent).frameSlide.caption_txt.text = e.target.clickToText; // Adds the caption
         MovieClip(parent).frameSlide.frame_mc.addChild(e.target.clickToPic); // Adds the big pic
       } // This closes the "for each" loop
    } // And this closes the xmlLoaded function
    and the effect looks like this (it's a sketch, so big pictures are loaded randomly, don;t put too much attention to it): http://bangbangdesign.pl/xmlGallery/gallery29.swf
    but i guess it's a terrible stuff to go through all this. i would be totallly satisfied with a likng to a good tutorial to do it from scratch, or just a hint where to start rebuilding this.
    + in any case i send greetinngs to whereever you are =]

  • I need a flash tutorial on Iphone style Scrolling Photo Gallery using Next/previous Buttons

    Here i have attached two sample Fla files of  iphone style scrolling photo gallery using next Previous buttons. Smoothscroller.fla is the  original file download from internet and thumbscroll.fla is the one i m trying to make. But i m getting the actionscript error in the movieclip symbol 2 frame 2 actionscript frame. Can anyone work out on my file & send me the easiest tutorial of flash so that i can complete my portfolio project.
    Mail me ur tutorials at : [email protected]

    Just Google for the Spry photo gallery and you might find
    http://cates-associates.net/tutorials/Tutorial-CS3-Spry.html
    or even a few others.
    Happy Sprying
    Ben

  • Why doesn't Firefox run an adobe flash player slide show (no arrows to move to next/previous slide), but internet explore does?

    When I try to run a slide show in Firefox, the first slide displays but the arrows to move to next/previous slide do not appear. When I try in Internet Explorer, the arrows appear. Flash Player is enabled in Firefox. There must be another setting I need to adjust. I am running Windows 7. I don't see how to access Tools menu item in Firefox. I don't see where I can check my Firefox version. It is the current version as is Flash Player.

    When I try to run a slide show in Firefox, the first slide displays but the arrows to move to next/previous slide do not appear. When I try in Internet Explorer, the arrows appear. Flash Player is enabled in Firefox. There must be another setting I need to adjust. I am running Windows 7. I don't see how to access Tools menu item in Firefox. I don't see where I can check my Firefox version. It is the current version as is Flash Player.

  • Move next/previous buttons in a region with over 100 items

    Hi,
    Is there a way to show items in a region in chunks and then have a move next/previous buttons. I have a region on a page that has over 100 items how can I show 10 items a time and then have move next/previous buttons. I am using 10.1.2.0.2
    Thanks

    In the "what to search" tab, select the pagegroup where stands your page.
    below teh pagegroup selection you got an option named "Which pages should be searched?"
    Browse to your page.
    Leave the search criterias blank (so taht the portlet won't make any filter)
    In the "results display" tab, select the pagination.
    Now, your portlet will display all items on your page.
    The best way to use it is to put all your items on page1.
    Create a page2 with only this portlet configured to serach for all items on page1.
    In your portal, just make a link to page2.
    hope this will be helpfull.

  • How do I change default Next/Previous buttons?

    When I automatically create multiple Submenus using the 'Create Chapter Index' command, Encore generates Next and Previous buttons.
    These are rather plain - they seem to be the same style regardless of the style of menu selected - and I'd like to set another default style.
    Can someone tell me how to do this, please?
    Many thanks
    John

    You can build the next/previous buttons any way you like. Just put them on the menu and then specify them as "Next" or "Previous" under the type field in the properties box. There's more information about this in the help files under chapter menu automation.

  • How to change "next" "previous" in ADF table ?

    **hi ,**
    **I am using oracle jdev 10.1.3.4**
    **I want to put my own text instead of "next" "previous" in ADF table , also I have the same problem in shuttle box ,**
    **I want to change the default javascript validation (ex: shuttle box alerts)**
    **I do not know to customize it or where these files saved ?**
    **any one can help ?**

    Hi Dave,
    Thank you so much for the email.  I tried every object and method I can
    posibly think about such as
    myTable.Rows.Item(1).PointSize = 24
    myCell.Characters.Item(1).PointSize = 24
    I got error message all the time.  These objects don’t support PointSize.
    All I need is to change point size of the text in InDesign tables created
    using VBScript. Could you help me with this?  Thanks,
    Regards,
    Li

  • Next,previous,last, and first record

    dear all masters
    plz help me my code dont work
    i used button when button pressed and code below
    First_Record;
    execute_query;
    last_record;
    execute_query;
    previous_record;
    execute_query;
    next_record;
    execute_query;
    but all wont work it wont goto the next, previous,last and first records.. master plz help me..
    micababe

    How do I navigate to the last_record after a query has fetched all my records. I jnow it existed the POST-FETCH trigger, but now how can I make this possible?
    My problem is simple. I am trying to navigate to the last record of a block after the query has fetched all the records.
    Thanks,
    Lucian

Maybe you are looking for

  • Printing in B&W with HP CM2320 MFP - follow up

    Hi everyone, In the thread below Matthaus fixed his problem with the printer on his mac as quoted: https://discussions.apple.com/thread/1979704 "Okay. I figured it out. Knowing that the Grayscale was the ticket was very helpful. I just went into the

  • MAC mini and Photoshop CS6

    Dear all, I want to swich to MAC from my current Windows PC. I'm thinking about to use a MAC mini because I have a good external display, so the iMAC is not necessary. But I would like to know if the MAC mini is powerful for using Photoshop CS6 (imag

  • Excise tax code

    i want to create tax code in purchase order related to excise , please tell me tell me which condition should be taken,which account keys i have maintain J1id, Basic excise -10 education cess-2 secondary & higher education cess-1 additional excise du

  • Computer won't let me update itunes

    when i try to update itunes it gets almost all the way to the end but then a window pops up with a message that says "the feature you are trying to use is on a network resource that is unavailable.  click ok to try again, or enter an alternate path t

  • Palm M505 doesn't start

    Hello, After starting a new application (BelTime) I got the message "Fatal exception" and can neither restart nor reset the device. Wat can I do? Post relates to: Palm m505 This question was solved. View Solution.