Displaying images when click on next button - blackberry

I am developing an application with next and previous buttons. Between those buttons, I want to place numbers. This would look like:
PreviousBtn 1 2 3 4 5 NextBtn
How can I place the five numbers between the buttons?
Instead of ButtonField I have a custom button class to implement buttons. I am using the following code.
numberBtn = new ImgButtonField[ total().size()];
for (i = 0; i <total().size(); i++) {
numberBtn[i] = new ImgButtonField(total().elementAt(i).getNo());
}
the numberBtn is having total 40 numbers. How can I display (PreviousBtn 1 2 3 4 5 NextBtn) format, if I clicked on next or pre buttons it should show (PreviousBtn 2 3 4 5 6 NextBtn).
I have images corresponding to the numbers suppose if I click on 1 it should display one image on the screen and so on. So how to place these all images without giving all image resource paths for each corresponding number. Is any simpler way to get all images at a strech when numbers are clicked?

Place that 40 image button in to horizontal field manager.. Scroll the manager whenever you press next and previous button.. This is simple way to do this..

Related

How can I creat a function

How can I creat a function that will call another function when I click a div tag 4 to 6 times.
What am really trying to make is that I want to creat a website with some hidden sports were only users who know that spot can click 4 times and something like a button appears and then they click it

How to change what a button does with the click of another button?

I have a button 1 that calls a function findRandomPlaces()
In this function it does a lot of things such as looping through an array, giving back a random place in the array when the button is clicked and more.
The format of the array is
places = [["name","description","latitude","longitude"]]
Button 1 = "Find Random Place"
Button 2 = "GO"
What I want to do is when that button 1 is clicked a second button(button 2) will appear that would correspond to that random value from button 1.
For example if button 1 gave us the random place "Home", then the corresponding button 2 would give us directions to "Home", if you click button 1 again and it gives the random location "Work", then button 2 would give directions to work using that specific latitude and longitude.
The problem I have is within findRandomPlaces() due to the random place it gives. I can only put the code in there since it changes with every button click and I don't know how to put the code from within this function into button 2.
Declare another variable that saves the random location name/coordinates when Button 1 is clicked.
Then inside Button 2's action you can check that variable to give direction accordingly.
It would work if both of these are in the same view controller.

iOS - How to add custom image and 2 tables to UI View Controller

I bring this question regarding a project work which is rather complex. I want to notify you that I never coded on iOS before and this is my debut, but in some good light, I have a good knowledge of programming. After few hours of work I managed to create the 1st part of the project, but now I am stuck on the second part of the project due to the multiple features the app has. I posted you a picture with the demo, it's on an Android device, I want to make it on iOS.
I will describe a little the project. On this 'page' the application has 3 parts. In the 1st part which named by meFeature 1 I have a picture, a photo of a plane. The photo is all gray, but if I tap one of those 3 parts I marked with 3 different colors: red, blue and green which corespond with the back, wings and front of the plane, that area will get colored specificly. e.g: All plane is gray, if I tap the back of the plane, the back of the plane will turn red, while the remaining 2 parts are gray. This feature will show me what part of the plane I chosed.
Here I am thinking at placing 4 photos, the original one (full gray) and other 3 photos in with each side marked and colored specificly (back red, wings gray, front gray; back gray, wings blue, front gray; back gray; wings gray; front green) and 3 invisible buttons for each section. If the person tap the wings for example, he will tap the invisible button placed over the wings and that will trigger the new picture to be displayed.
The second part, Feature 2 has a direct conection with Feature 1. Basically, feature 2 is a list of the parts which regards the are selected. For example, if we selected wings on feature 1, on Feature 2 I will have a list of elements displayed, e.g: long wings, short wings. Let me tell you from the beggining that all will be stored localy. My questing here is, what should I use to populate and display the list of items to show like shopping list (like in image).
After we displayed the list, we can see that every element has in corner a [+] button. This will populate the area called Feature 3. Selecting an item from Feature 2 will move it to Feature 3. Feature 3 will be like our Shopping bag and the items we chosed. We selected to buy a bread, we erase bread from feature 2 because stock is out now, and we placed in feature 3 our shopping bag.
Shall I use UI View Controller of UI Table View Controller? Also can you tell me in detail what I should chose for every feature in particular and why?
Thank you in advance.
Use a UIViewController if you only have 3 features. Then you can create three UIViews and and them as subviews inside the view controller.
Use should not use UITableViewController because it is not optimal here. It is good to use table when you have data source (for example from .plist or from an array) to fill into each cell of table. But here you have just three views, so just use UIViewController.
Add the a UIImageView and 2 UITableViews to your UIViewController in the Main.Storyboard. Then cmd + click from each view to the other, and select equal height. Then all 3 of them will be next to each other with equal heights.
as per my understanding, all of these are dependent of each other and as per your UI for feature 2 and 3, I think you should use only one tableview in your UIViewcontroller and use this as per your UI requirements as follows.
feature 1 : UIImageView
Feature 2 : UITableView1 Section1
Feature 3 : UITableView1 Section2

How can I have my iOS app recognize which row/column a button is in?

So I have 4 rows and 4 columns and each row and column contains 4 buttons
OOOO
OOOO
OOOO
OOOO
So when I click on the first O. I want xcode to recognize that it is in row1 and column 1.
I have already declared everything as buttons, ints,etc. But I need help defining rows/columns and placing these buttons in that row/column.
I am going to assume that these buttons are created using storyboard and that each one has a unique name. Provided all of this, you can create a 2-dimensional array adding each of these buttons to the appropriate spot in the array.
ex. array[0][0] = button0
This, while tedious, will solve this problem for your 16 button problem.

Adobe Captivate - must view all sub-slides before continuing

I am using Adobe Captivate to create an online learning course.
An abbreviation is broken down into 6 buttons, each with an action to bring you to their respective slides. Once the slide is complete, you are brought back to the original.
The ask: the original slide with the abbreviation should only display a 'continue' button once the user has visited all 6 slides.
Is there a way to do this with ActionScript?
You can hide or show buttons in Captivate. You can also change whether or not they are shown using Advanced Actions (you'd probably need to use the conditional actions).
I'm not familiar with ActionScript, but there's an easy way to do this using the Advanced Actions in Captivate. Here's how I would approach it. First, create six variables, one for each of the six respective slides, so you could create variables called v_slide1_viewed, v_slide2_viewed, v_slide3_viewed, v_slide4_viewed, v_slide5_viewed, and v_slide6_viewed. Set their default values equal to 0 (I usually prefix my variables with v_ to distinguish from the inbuilt Captivate variables).
Now on slide 1, set an On Enter property to assign the value 1 to the variable v_slide1_viewed. This means, that when slide 1 loads, the variable 'v_slide1_viewed' will be set to 1. Similarly do this for each of the six respective slides.
Now on the abbreviation slide, create a SmartShape (Continue) button and uncheck the 'Visible in Output' so that by default this button is not displayed. Now you can write an advanced actions (conditional) script that says if
v_slide1_viewed = 1 AND
v_slide1_viewed = 2 AND
v_slide1_viewed = 3 AND
v_slide1_viewed = 4 AND
v_slide1_viewed = 5 AND
v_slide1_viewed = 6
Then Show and select the smartshape ID or whatever you named that object.
Hope this is what you were looking for.
-Sean

Resources